[MPlayer-dev-eng] [PATCH] Compiler warnings almost gone :)

D Richard Felker III dalias at aerifal.cx
Fri Jan 10 11:52:52 CET 2003


On Fri, Jan 10, 2003 at 11:41:23AM +0100, Dominik Mierzejewski wrote:
> On Friday, 10 January 2003, Alex Beregszaszi wrote:
> > Hi,
> > 
> > > After the last few patches I'm almost done with eliminating compiler
> > > warnings. :) Only a few worth mentioning remain. Two, in particular,
> > > are probably easy to fix by the maintainers:
> > > 
> > > pl_format.c:231: warning: suggest parentheses around + or - inside
> > > shift vo_dga.c:580: warning: suggest parentheses around && within ||
> > > 
> > > Is the attached patch a good fix?
> > 
> > The vo_dga fix should be trivial, but the pl_format not.
> > I think it should be (1<<31)-1 instead your version ( (1<<(31-1)) ).
> 
> Maybe so, but according to C standard - has higher priority than <<, so it
> was executed in that order anyway. I don't pretend to understand this code,
> so I don't know what is the right solution here.

If that's true, then congradulations, you found a real bug. 1<<(31-1)
is nonsense, you'd just write 1<<30. It's obviously supposed to be
(1<<31)-1, i.e. the largest 32bit signed integer. pl_*.c is obsolete
anyway though.

Rich



More information about the MPlayer-dev-eng mailing list