Matthias Melcher wrote:
>
> Related to FLTK 3: since I have touched EVERY file of FLTK3 anyways, there is 
> no need to keep history of a file or do a diff at some point. That would be a 
> nice occasion to run some app that will re-indet the files.
>
> Any suggestions for a tool? Preferably on OS X? Maybe someone even has the 
> correct settings for FLTK's coding style?
>
> Xcode would be OK, but it left-aligns all comments which destroys doxygen 
> indenting in /code sections :-(
>
> - Matthias

I've used astyle http://astyle.sourceforge.net/ and for me it's a good 
choice.

My options passed to astyle: astyle.exe --options=fltk_style.txt 
Fl_Help_View.cxx

fltk_style.txt
------------------
--mode=c

#uses tab every 4 spaces
-T

#Attach brackets to their pre-block statements
-a

#Indent 'switch' blocks so that the 'case X:' statements are indented in 
the switch block.
#The entire case block is indented.
-S

#Indent multi-line preprocessor definitions ending with a backslash.
#Should be used with --convert-tabs for proper results.
#Does a pretty good job, but can not perform miracles in obfuscated 
preprocessor definitions.
#Without this option the preprocessor statements remain unchanged.
-w

#Indent a maximum of # spaces in a continuous statement,
#relative to the previous line (e.g. --max-instatement-indent=40).
# # must be less than  80. If no # is set, the default value of 40 will 
be used.
#A maximum of less than two indent lengths will be ignored.
-M

#Pad empty lines around header blocks (e.g. 'if', 'for', 'while'...).
-f

#Insert space padding around operators.
#Operators inside block parens [] are not padded.
#Any end of line comments will remain in the original column, if possible.
#Note that there is no option to unpad. Once padded, they stay padded.
-p

#Insert space padding around parenthesis on the inside  only.
#Any end of line comments will remain in the original column, if possible.
#This can be used with unpad-paren  below to remove unwanted spaces.
-D

#Insert space padding after paren headers only (e.g. 'if', 'for', 
'while'...).
#Any end of line comments will remain in the original column, if possible.
#This can be used with unpad-paren to remove unwanted spaces.
-H

#Add brackets to unbracketed one line conditional statements  (e.g. 
'if', 'for', 'while'...).
#The statement must be on a single line.
#The brackets will be added according to the currently requested 
predefined style or bracket type.
#If no style or bracket type is requested the brackets will be attached.
#If --add-one-line-brackets is also used the result will be one line 
brackets.
#-j
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to