diff options
author | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-07-08 22:26:42 +0000 |
---|---|---|
committer | zwelch <zwelch@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2009-07-08 22:26:42 +0000 |
commit | 3cf4717a2aacfc197e1b6e84cf5a3391ba5585fb (patch) | |
tree | 139499d34e1f71d318fbf3df62dd27f75fa49fee /doc/manual | |
parent | eaa895a0b25a934be19ff7ed1cf7e37d19a989cc (diff) | |
download | openocd+libswd-3cf4717a2aacfc197e1b6e84cf5a3391ba5585fb.tar.gz openocd+libswd-3cf4717a2aacfc197e1b6e84cf5a3391ba5585fb.tar.bz2 openocd+libswd-3cf4717a2aacfc197e1b6e84cf5a3391ba5585fb.tar.xz openocd+libswd-3cf4717a2aacfc197e1b6e84cf5a3391ba5585fb.zip |
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
Diffstat (limited to 'doc/manual')
-rw-r--r-- | doc/manual/style.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/manual/style.txt b/doc/manual/style.txt index b9a7612f..0fe33876 100644 --- a/doc/manual/style.txt +++ b/doc/manual/style.txt @@ -107,6 +107,20 @@ int f(int x1, int x2) ... } @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 |