Messages in this thread | | | Subject | Re: [RFC][PATCH] new timeofday core subsystem (v. A3) | From | Andreas Schwab <> | Date | Sun, 13 Mar 2005 02:46:14 +0100 |
| |
Matt Mackall <mpm@selenic.com> writes:
> On Fri, Mar 11, 2005 at 05:24:15PM -0800, john stultz wrote: >> +struct timesource_t timesource_jiffies = { >> + .name = "jiffies", >> + .priority = 0, /* lowest priority*/ >> + .type = TIMESOURCE_FUNCTION, >> + .read_fnct = jiffies_read, >> + .mask = (cycle_t)~0, > > Not sure this is right. The type of 0 is 'int' and the ~ will happen > before the cast to a potentially longer type.
If you want an all-one value for any unsigned type then (type)-1 is the most reliable way.
Andreas.
-- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |