26.04.2011 17:19, Jan Kiszka wrote:
> hw/hpet.c | 71
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> +static int modifying_bit(uint64_t old, uint64_t new, uint64_t mask)
> +{
> + return (old ^ new) & mask;
> +}
Such constructs always look suspicious. I'm not even sure anymore
(after using C for over 20 years ;) that this works... how about
return (old ^ new) & mask ? 1 : 0;
instead, or something along this? I mean, if sizeof(int)==4, how
`return 1ULL<<32' will be interpreted in this context? Tiny test
program tells me it will return 0...
/mjt
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html