mac-learning: Reference count 'struct mac_learning".
[sliver-openvswitch.git] / CodingStyle
index b0aeb4e..22f0f45 100644 (file)
@@ -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.
@@ -432,8 +444,8 @@ precedence makes it necessary, or unless the operands are themselves
 expressions that use && and ||.  Thus:
 
     if (!isdigit((unsigned char)s[0])
-            || !isdigit((unsigned char)s[1])
-            || !isdigit((unsigned char)s[2])) {
+        || !isdigit((unsigned char)s[1])
+        || !isdigit((unsigned char)s[2])) {
         printf("string %s does not start with 3-digit code\n", s);
     }