Skip to content

Commit

Permalink
CodingStyle: Mention our common return value conventions.
Browse files Browse the repository at this point in the history
CC: Andy Zhou <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
blp committed Mar 4, 2013
1 parent 125638e commit 0d06738
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CodingStyle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0d06738

Please sign in to comment.