[MPlayer-dev-eng] [PATCH] a few warnings (mpeg_hdr.c)

Zoltan Hidvegi mplayer at hzoli.2y.net
Wed Mar 2 00:33:09 CET 2005


Nico Sabbi wrote:
...
> >-  if(overscan=getbits(buf, n++, 1))
> >+  if((overscan=getbits(buf, n++, 1)))
...
> is gcc so idiotic?

It is a very common mistake to write single = when you really meant
==.  The convention is to use an extra parenthesis to use the truth
value of an assignment, otherwise gcc will warn.  It is very useful if
you wrote your code with that in your mind to begin with, it has saved
my butt several times.

Zoli




More information about the MPlayer-dev-eng mailing list