From: <zw...@ma...> - 2009-07-09 00:26:47
|
Author: zwelch Date: 2009-07-09 00:26:42 +0200 (Thu, 09 Jul 2009) New Revision: 2503 Modified: trunk/doc/manual/style.txt Log: Add style rule to avoid combining assignment and logical tests. Modified: trunk/doc/manual/style.txt =================================================================== --- trunk/doc/manual/style.txt 2009-07-08 22:26:36 UTC (rev 2502) +++ trunk/doc/manual/style.txt 2009-07-08 22:26:42 UTC (rev 2503) @@ -107,6 +107,20 @@ ... } @endcode +- Separate assignment and logical test statements. In other words, you +should write statements like the following: +@code +// separate statements should be preferred +result = foo(); +if (ERROR_OK != result) + ... +@endcode +More directly, do @b not combine these kinds of statements: +@code +// Combined statements should be avoided +if (ERROR_OK != (result = foo())) + return result; +@endcode */ /** @page styledoxygen Doxygen Style Guide |