summaryrefslogtreecommitdiff
path: root/share/misc
diff options
context:
space:
mode:
Diffstat (limited to 'share/misc')
-rw-r--r--share/misc/contrib16
1 files changed, 16 insertions, 0 deletions
diff --git a/share/misc/contrib b/share/misc/contrib
index 1560f37..a36c127 100644
--- a/share/misc/contrib
+++ b/share/misc/contrib
@@ -21,6 +21,22 @@ is_power_of_two(uint8_t n)
return ((n & 0x01) == 0);
}
+--
+When defining local variables in functions, they
+must be declared at the top:
+
+static void
+foo(void)
+{
+ uint8_t byte;
+ uint16_t pair;
+ uint32_t quad;
+ uint64_t oct;
+
+ ...
+}
+--
+
When checking if an integer is 0 or not, *be explicit* unless it is a bool!
Do not do this: