From: Ben Pfaff Date: Fri, 1 Mar 2013 19:02:31 +0000 (-0800) Subject: CodingStyle: Mention our common return value conventions. X-Git-Tag: v1.11.0~334 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=0d0673857b5b2a50f6aef62e0f042795d9893690;p=cascardo%2Fovs.git CodingStyle: Mention our common return value conventions. CC: Andy Zhou Signed-off-by: Ben Pfaff --- 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.