diff options
| author | Ben Pfaff <blp@nicira.com> | 2013-03-01 11:02:31 -0800 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2013-03-04 08:14:07 -0800 |
| commit | 0d0673857b5b2a50f6aef62e0f042795d9893690 (patch) | |
| tree | c379d325d6cd2a68a13a630ee619870608097f73 /CodingStyle | |
| parent | 125638ebd7fa77fb98710ae0eb91b25172f9f725 (diff) | |
| download | openvswitch-0d0673857b5b2a50f6aef62e0f042795d9893690.tar.gz | |
CodingStyle: Mention our common return value conventions.
CC: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'CodingStyle')
| -rw-r--r-- | CodingStyle | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CodingStyle b/CodingStyle index ee7a0e6d4..22f0f458a 100644 --- a/CodingStyle +++ b/CodingStyle @@ -249,6 +249,18 @@ details. (Some compilers also assume that the "if" branch is the more common case, so this can be a real form of optimization as well.) +RETURN VALUES + + For functions that return a success or failure indication, prefer +one of the following return value conventions: + + * An "int" where 0 indicates success and a positive errno value + indicates a reason for failure. + + * A "bool" where true indicates success and false indicates + failure. + + MACROS Don't define an object-like macro if an enum can be used instead. |
