[vorbis-dev] MSVC warnings

Beni Cherniavksy cben at techunix.technion.ac.il
Sun Jan 6 05:45:37 PST 2002



On 2002-01-06, Dave Hooper wrote:

> > >~0UL works(*), but that's maybe a little too hard too read for most
> > >folks :-(
> >
> > I would suggest this approach is the better one, since at least it's
> > relying on defined behaviour.  If you're worried about readability, I'd
> > just use a manifest constant so that the intent is clear.
>
> Or just
>
> // ret = (unsigned)(-1)
> ret=0;
> ret--;
>
> which is both portable and readable.
>
Maybe

ret = 0UL - 1;

which is equivallent but more obvious and optimizable?


-- 
Beni Cherniavsky <cben at tx.technion.ac.il>
                 (also scben at t2 in Technion)
Happy new 2 (mod 100).

<p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.




More information about the Vorbis-dev mailing list