[MPlayer-dev-eng] [PATCH] Yet another batch of warning fixes :->

D Richard Felker III dalias at aerifal.cx
Tue Dec 10 19:10:48 CET 2002


On Tue, Dec 10, 2002 at 12:53:52PM +0100, Arpi wrote:
> Hi,
> 
> > > > > > > -    while(in < end) *in=(*in++)>>1;
> > > > > > > +    while(in < end) { *in=(*in)>>1; in++; }
> > > > > > 
> > > > > > again, why?
> > > > > 
> > > > > Same deal.
> > > > 
> > > > yes, but the fix is wrong.
> > > > it should be (IMHO!) *(++in)=(*in)>>1; or *(in+1)=*in>>1;++in;
> > > > 
> > > > IMHO the order that gcc (and other compilers) use is calculating the
> > > > rightvalue first, then storing the result in the left value.
> > > 
> > > use:
> > > while(in < end) { *in=(*in)>>1; in++;}
> > 
> > And that's exactly what I proposed.
> 
> what about  *in++>>=1;  ? ;)
> c rulz

Looks good to me. :)

Rich




More information about the MPlayer-dev-eng mailing list