diff --git a/Documentation/NuttXCCodingStandard.html b/Documentation/NuttXCCodingStandard.html index 7d65a766a26..a116f981e7c 100644 --- a/Documentation/NuttXCCodingStandard.html +++ b/Documentation/NuttXCCodingStandard.html @@ -12,7 +12,7 @@

NuttX C Coding Standard

-

Last Updated: May 6, 2017

+

Last Updated: June 9, 2017

@@ -736,12 +736,25 @@ void some_function(void) @@ -779,12 +805,36 @@ while (true) ... } } + +if (a < b) + { + if (a < 0) + { + c = -a; + } + else + { + c = a; + } + } +else + { + if (b < 0) + { + c = -b; + } + else + { + c = b; + } + } +

- Exceptions. + Exception to Indentation Rule for Braces. The exception is braces that following structure, enumeration, union, and function declarations. There is no additional indentation for those braces; those braces align with the beginning of the definition @@ -854,6 +904,7 @@ int animals(int animal) { ... } + @@ -2123,11 +2174,15 @@ x++;

  • Braces and indentation. - The placement of braces and statements must follow the standard rules for braces and indentation. + The placement of braces and statements must follow the standard rules for braces and indentation.
  • - Followed by a single blank line. - The final right brace must be followed by a blank line. + Final brace followed by a single blank line. + The final right brace must be followed by a blank line. + This may be the final brace of the if compound statement. + Or it may be the the final brace of the else compound statement if present. + A blank line never follows the right brace closing the if compound statement if else is present. + Use of braces must follow all other standard rules for braces and spacing.