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

Julien WAJSBERG flash at minet.net
Tue Dec 10 15:57:30 CET 2002


On Tue, 10 Dec 2002, Dominik Mierzejewski wrote:

> 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.

But it doesn't create more optimized binary... It's just a matter of
coding :)

-- 
Flash




More information about the MPlayer-dev-eng mailing list