[MPlayer-dev-eng] [PATCH] Yet another batch of warning fixes :->
D Richard Felker III
dalias at aerifal.cx
Tue Dec 10 08:07:26 CET 2002
On Tue, Dec 10, 2002 at 08:25:46AM +0100, Arpi wrote:
> > #define ADDQUE(xi,xq,in)\
> > xq[xi]=xq[xi+L]=(*in);\
> > - xi=(--xi)&(L-1);
> > + xi=(xi-1)&(L-1);\
> > + xi--;
>
> why?
He's correct that something's wrong here. Read the comp.lang.c faq.
The result of an expression similar to x=--x; is undefined. I have no
idea what the code does though so I don't know if this fix is correct.
> > register int16_t* end = in+ao_plugin_data.len/2;
> > - while(in < end) *in=(*in++)>>1;
> > + while(in < end) { *in=(*in)>>1; in++; }
>
> again, why?
Same deal.
> > - uqvq = encoded[pixel_ptr++] + (encoded[pixel_ptr++] << 8);
> > + uqvq = encoded[pixel_ptr+1] + (encoded[pixel_ptr+2] << 8);
> > + pixel_ptr += 2;
>
> i can't understand nor accept such changes
He's right here too. This is NOT valid C. It's undefined which ++
happens first!
Rich
More information about the MPlayer-dev-eng
mailing list