On Fri, Sep 2, 2011 at 11:29 AM, Even Rouault <[email protected]> wrote: >> (setq-default c-basic-offset 4 >> tab-width 4 >> indent-tabs-mode nil) >> (c-set-offset 'case-label '+) > > Not sure if it is RFC material, but you can definitely share it in > http://trac.osgeo.org/gdal/wiki/HowToContribute > > You have summed up perfectly the most important coding conventions.
Etienne, Agreed, 4 character indent using spaces not tabs is the key thing to avoid messiness for others. > You have also probably noticed the nice visual ascii art that is generally > prepended before each function/method : > > /************************************************************************/ > /* foo() */ > /************************************************************************/ I actually have emacs macros for editing these header blocks. I could share them if you are interested, but they are not that critical. I deliberately have avoided trying to be really strict about code formatting in GDAL/OGR. I think over-strictness can be offputting to new contributors and lead to disputes over details. But do make an effort to fit into the modules you work on and feel free to take more liberties on drivers that you are writing from scratch. > And if you really want to confuse FrankW and make him believe he has written > the code himself, you'd write if( foo ) rather than if (foo) ;-) This is one of the details that seems fairly idiosyncratic to me, but it is contrary to Google code style so perhaps I will adapt to "if (foo)" now. Best regards, -- ---------------------------------------+-------------------------------------- I set the clouds in motion - turn up | Frank Warmerdam, [email protected] light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush | Geospatial Software Developer _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
