Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  15 Dec 2003, Stefan Ritt, , Poll about default indent style  
    Reply  18 Dec 2003, Paul Knowles, , Poll about default indent style  
       Reply  18 Dec 2003, Stefan Ritt, , Poll about default indent style  
          Reply  01 Jan 2004, Konstantin Olchanski, , Poll about default indent style  
    Reply  06 Jan 2004, Stefan Ritt, , Poll about default indent style  
Message ID: 74     Entry time: 15 Dec 2003     Reply to this: 75   78
Author: Stefan Ritt 
Topic:  
Subject: Poll about default indent style  
Dear all,

there are continuing requests about the C indent style we use in midas. As 
you know, the current style does not comply with any standard. It is even 
a mixture of styles since code comes from different people. To fix this 
once and forever, I am considering using the "indent" program which comes 
with every linux installation. Running indent regularly on all our code 
ensures a consistent look. So I propose (actually the idea came from Paul 
Knowles) to put a new section in the midas makefile:

indent:
        find . -name "*.[hc]" -exec indent <flags> {} \;

so one can easily do a "make indent". The question is now how the <flags> 
should look like. The standard is GNU style, but this deviates from the 
original K&R style such that the opening "{" is put on a new line, which I 
use but most of you do not. The "-kr" style does the standard K&R style, 
but used tabs (which is not good), and does a 4-column indention which is 
I think too much. So I would propose following flags:

indent -kr -nut -i2 -di8 -bad <filename.c>

Please take some of your source code, and format it this way, and let me 
know if these flags are a good combination or if you would like to have 
anything changed. It should also be checked (->PAA) that this style 
complies with the DOC++ system. Once we all agree, I can put it into the 
makefile, execute it and commit the newly formatted code for the whole 
source tree.
ELOG V3.1.4-2e1708b5