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

Uoti Urpala uoti.urpala
Thu Feb 21 20:01:37 CET 2008


On Thu, 2008-02-21 at 20:28 +0200, Uoti Urpala wrote:
> On Thu, 2008-02-21 at 08:54 +0100, lorenm wrote:
> > +static const unsigned long pb_7f = 0x7f7f7f7f7f7f7f7fUL;
> > +static const unsigned long pb_80 = 0x8080808080808080UL;
> 
> I think these should have a comment about truncation on 32-bit platforms
> being intentional. And the code will fail on a 128-bit platform :)

I forgot to add that these could be written in a way that is independent
of sizeof(long) and doesn't cause compiler warnings about truncation on
platforms with shorter longs:
static const unsigned long pb_7f = -1UL/255 * 0x7f;
That may need to comment too though, as it probably wouldn't be
immediately obvious to all readers what it expands to.





More information about the ffmpeg-cvslog mailing list