[FFmpeg-devel] [PATCH] Fix some warnings in nut.c

Diego Biurrun diego
Mon Nov 5 01:02:51 CET 2007


On Sun, Nov 04, 2007 at 06:05:48PM +0100, Michael Niedermayer wrote:
> On Sun, Nov 04, 2007 at 02:35:41PM +0100, Diego Biurrun wrote:
> > On Sun, Nov 04, 2007 at 02:27:05PM +0100, Michael Niedermayer wrote:
> > > On Sun, Nov 04, 2007 at 02:10:18PM +0100, Diego Biurrun wrote:
> > > > OK to apply the attached patch for
> > > > 
> > > > nut.c: In function ?ff_nut_sp_pos_cmp?:
> > > > nut.c:43: warning: suggest parentheses around + or - inside shift
> > > > nut.c:43: warning: suggest parentheses around + or - inside shift
> > > > nut.c: In function ?ff_nut_sp_pts_cmp?:
> > > > nut.c:47: warning: suggest parentheses around + or - inside shift
> > > > nut.c:47: warning: suggest parentheses around + or - inside shift
> > > > 
> > > > ?
> > > 
> > > darn no! ive rejected this at least once already
> > > this is no warning fix it is just _WRONG_ the code just doesnt
> > > work anymore after this patch!
> > 
> > Ouch, yes, I had the operator precedence of shifts and +/- backwards.
> > Here is a better patch...
> 
> patch ok, except
> 
> [...]
> > -    return (a->ts - b->ts>>32) - (b->ts - a->ts>>32);
> > +    return ((a->ts - b->ts) >>32) - ((b->ts - a->ts) >> 32);
>                                  ^                        ^
> i cant belive it, your whitespace is inconsistant

Lol, patch applied.

Diego




More information about the ffmpeg-devel mailing list