[MPlayer-cvslog] CVS: main/libmpcodecs pullup.c,1.20,1.21

Felix Buenemann atmosfear at users.sourceforge.net
Sat Feb 5 01:01:56 CET 2005


On Friday 04 February 2005 17:37, D Richard Felker III wrote:
> On Tue, Feb 01, 2005 at 08:53:14PM +0100, Alex Beregszaszi wrote:
> > Hi,
> >
> > > > > Update of /cvsroot/mplayer/main/libmpcodecs
> > > > > In directory mail:/var2/tmp/cvs-serv15342
> > > > >
> > > > > Modified Files:
> > > > >  pullup.c
> > > > > Log Message:
> > > > > adding proper parenthesing
> > > >
> > > > Oh, good. I've been keeping exactly the same patch in my tree for
> > > > months, but I've never had the time to post it with proper
> > > > explanation why it is needed. Thanks.
> > >
> > > it's not needed and i was going to flame alex for not knowing c order
> > > of operations and cluttering the code (which is considered external
> > > imported code, not mplayer-native code) for cosmetics. but it's not
> > > worth arguing over...
> >
> > It's not about my knowledge but about bad compilers...
>
> rotfl, is there a compiler that compiles this wrong?? maybe gcc3?
>
> :))))

It's also about clarity, a few parentheses too much never hurt readability of 
code or mathematial formulas aswell. If in doubt, use em :-)

It's a bit like:

if(x) for(;x<y;x++) if(x%2) do_some_thing(x);

versus:

if(x) {
  for(;x < y; x++) {
    if(x%2) {
      do_some_thing(x);
    }
  }
}

Both are syntactically correct, but the first version is surely more 
error-prone when changing code and less readable.

And if you're to lazy for wrtiting parentheses, simply get a good editor like 
vim, that does the job for you.


> rich

-- 
Best Regards,
        Atmos
____________________________________________
- MPlayer Developer - http://mplayerhq.hu/ -
____________________________________________




More information about the MPlayer-cvslog mailing list