On Fri, Oct 28, 2005 at 04:28:20AM -0400, Andrew Rodland wrote: > On Thursday 27 October 2005 09:37 pm, Joshua Hoblitt wrote: > > On Thu, Oct 27, 2005 at 11:22:40PM +0200, Leopold Toetsch wrote: > > > On Oct 27, 2005, at 22:31, Nick Glencross wrote: > > > >There are a few cases of -1 being assigned to unsigneds. Anyone know > > > >if that's deliberate? > > > > > > Yup. Some special out-of-band values. > > > > I suspect that gcc4 will give a warning on that. Wouldn't UINT_MAX or > > ULONG_MAX be slightly more correct? > > or ~0U / ~0UL. Again pretty much the same thing, but it shouts "magic value" > loudest to me.
It means giving up a whole bit of dynamic range but I think you gain a lot of clarity by using signed ints and making 'special out-of-band values' negative. Is there any reason those variables can't be signed? -J --
pgpSqcQQeZxvm.pgp
Description: PGP signature