[DVDnav-discuss] please review: DVDFileStat, close dev on error, use parens and BSD porting bits

Diego Biurrun diego at biurrun.de
Tue Sep 1 10:11:34 CEST 2009


On Mon, Aug 31, 2009 at 06:32:11PM +0200, Nico Sabbi wrote:
> Il lunedì 31 agosto 2009 18:28:29 Erik Hovland ha scritto:
> > > Il lunedì 31 agosto 2009 18:05:04 Erik Hovland ha scritto:
> > >> I hate to bother, but could you be more specific? Does it mean
> > >> you prefer 'if(x)' over if( x )? The empty line I get.
> > >
> > > Indeed
> > >
> > >>    if( dvd_file ) {
> > >> -    if( dvd_file->dvd->isImageFile ) {
> > >> -      ;
> > >> -    } else {
> > >> +    if( !dvd_file->dvd->isImageFile ) {
> > >
> > > for example the above line reads much better to me as:
> > >
> > >  if(!dvd_file->dvd->isImageFile) {
> > > ...
> > > }
> >
> > I definitely agree w/ this style change. But it is inconsistent w/
> > the rest of the file. I would prefer to be consistent w/ the file
> > on the commit of new code and then change the style in another
> > commit. Is that reasonable?
> 
> ok

I'm all for using a consistent style, but if we are going to use one, I
would suggest Kernighan & Ritchie, which is the most common and standard
style available:

  if (!dvd_file->dvd->isImageFile) {

It uses space after if/for/while/switch and places the opening brace on
the same line.

Diego


More information about the DVDnav-discuss mailing list