Skip to content
Snippets Groups Projects
Commit 3cf4717a authored by zwelch's avatar zwelch
Browse files

Add style rule to avoid combining assignment and logical tests.

git-svn-id: svn://svn.berlios.de/openocd/trunk@2503 b42882b7-edfa-0310-969c-e2dbd0fdcd60
parent eaa895a0
No related branches found
No related tags found
No related merge requests found
......@@ -106,6 +106,20 @@ int f(int x1, int x2)
int y = f(x1, x2 - x1);
...
}
@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
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment