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

Dominik Mierzejewski dominik at rangers.eu.org
Tue Dec 10 12:44:42 CET 2002


On Tuesday, 10 December 2002, 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

Yes it does. In allowing you to write very concise and cryptic code.
But your solution compiles without warning and if I understand it
correctly, should work exactly the same.
 
-- 
MPlayer RPMs maintainer: http://www.piorunek.pl/~dominik/linux/pkgs/mplayer/
"The Universe doesn't give you any points for doing things that are easy."
        -- Sheridan to Garibaldi in Babylon 5:"The Geometry of Shadows"



More information about the MPlayer-dev-eng mailing list