[MPlayer-cvslog] r25521 - trunk/libmpdemux/demux_ogg.c

Michael Niedermayer michaelni at gmx.at
Tue Dec 25 19:24:36 CET 2007


On Mon, Dec 24, 2007 at 11:39:30PM +0100, Reimar Döffinger wrote:
> Hello,
> On Mon, Dec 24, 2007 at 12:29:58PM -0500, Rich Felker wrote:
> > On Mon, Dec 24, 2007 at 04:56:34PM +0100, reimar wrote:
> > > -	   *flags = ((pack->granulepos & iframemask) == 0);
> > > +	   *flags = (pack->granulepos & iframemask) == 0;
> > 
> > C has the ! operator for a reason. It would make this code a lot more
> > readable. I would go so far as to say that any occurrance of "== 0" in
> > C is bad style but this is among the most blatant offenses.
> 
> Firstly, this is not really my code so I mostly restrict myself to
> things I expect no discussion about.
> Secondly, at least to me, ! and == 0 have different semantic meanings.
> E.g. I strongly dislike !strcmp(...) because IMO the use of ! maps
> "intuitively" to an inequality, which is why I prefer strcmp(..) == 0.

hmm i dunno, IMHO ! makes more sense if you map it to no(t) 

if( ! strcmp() )
"if no difference"

if( strcmp() == 0 )
"if difference is zero"

if(!ptr) exit()
"if no (valid) pointer (then) exit"


[...]
> That said we all know we don't want "if (!(a == 0) == 1)" or similarly
> funny things. 

of course not, everyone knows its
if (!(a == '-'-'-') == '/'/'/')

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-cvslog/attachments/20071225/3153a9f9/attachment.pgp>


More information about the MPlayer-cvslog mailing list