3 You should follow the style of the file you're editing. In general, we
4 try to follow the rules below.
6 - indent with tabs, and a tab is always 4 characters wide
7 - opening braces are on the same line as the if statement;
8 - no braces in an if-body with just one statement;
9 - if one of the branches of an if-else codition has braces, than the
10 other branch should also have braces;
11 - there is always an empty line between variable declarations and the
32 - lines should be less than 80 characters wide;
33 - when breaking lines with functions calls, the parameters are aligned
34 with the opening parenthesis;
35 - when assigning a variable with the result of a function call, if the
36 line would be longer we break it around the equal '=' sign if it makes
40 function_with_a_really_long_name(parameter1, parameter2,
41 parameter3, parameter4);
43 x = function_with_a_really_long_name(parameter1, parameter2,
44 parameter3, parameter4);
48 #astyle -A8 -t4 -p -z2 -H -k3 -W3 -xC80 -xL -n -r "./*.c"
50 #astyle -A8t8pz2Hk3W3xC80xLnrf "*.c"
52 #default style : linux
55 --indent=force-tab-x=8
61 --align-reference=name