[FFmpeg-cvslog] r12165 - trunk/libavcodec/dsputil.c

Rich Felker dalias
Fri Feb 22 00:43:05 CET 2008


On Fri, Feb 22, 2008 at 01:31:30AM +0200, Uoti Urpala wrote:
> On Thu, 2008-02-21 at 21:20 +0000, M?ns Rullg?rd wrote:
> > > static const unsigned long pb_7f = -1UL/255 * 0x7f;
> > 
> > This assumes two's complement signed numbers.  Using ~0UL avoids this
> > assumption.
> 
> No it does not. The only operation done to signed numbers is converting
> 255 and 0x7f to unsigned long, and the result of that does not depend on
> representation.

Indeed, thanks for pointing this out, Uoti. -1UL has type unsigned
long and its value is perfectly well specified and equal to ULONG_MAX.

Rich




More information about the ffmpeg-cvslog mailing list