- constify some read-only members and remove superfluous casts
[oweals/busybox.git] / docs / style-guide.txt
index d7d8e5ec7801e9defda951e04ee06a8175db2497..ba0cdbaa487e7f6579746c7d6101e9a3d8416bc4 100644 (file)
@@ -51,13 +51,13 @@ indentation style in the Apache and Postfix source does this sort of thing:
 \s\s\s\sif (expr) {\n\tstmt; --ick.) The only exception to this rule is
 multi-line comments that use an asterisk at the beginning of each line, i.e.:
 
-       /t/*
-       /t * This is a block comment.
-       /t * Note that it has multiple lines
-       /t * and that the beginning of each line has a tab plus a space
-       /t * except for the opening '/*' line where the slash
-       /t * is used instead of a space.
-       /t */
+       \t/*
+       \t * This is a block comment.
+       \t * Note that it has multiple lines
+       \t * and that the beginning of each line has a tab plus a space
+       \t * except for the opening '/*' line where the slash
+       \t * is used instead of a space.
+       \t */
 
 Furthermore, The preference is that tabs be set to display at four spaces
 wide, but the beauty of using only tabs (and not spaces) at the beginning of
@@ -126,6 +126,15 @@ between it and the opening control block statement. Examples:
 
                do {
 
+Exceptions:
+
+ - if you have long logic statements that need to be wrapped, then uncuddling
+   the bracket to improve readability is allowed:
+
+               if (some_really_long_checks && some_other_really_long_checks \
+                   && some_more_really_long_checks)
+               {
+                       do_foo_now;
 
 Spacing around Parentheses
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -610,7 +619,7 @@ begin with a C keyword, but not always.
 
 Furthermore, you should put a single comment (not necessarily one line, just
 one comment) before the block, rather than commenting each and every line.
-There is an optimal ammount of commenting that a program can have; you can
+There is an optimal amount of commenting that a program can have; you can
 comment too much as well as too little.
 
 A picture is really worth a thousand words here, the following example