summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-04-24 21:33:28 -0400
committerIan Moffett <ian@osmora.org>2025-04-24 21:33:28 -0400
commit686747bea40b4c01243ffcca2c830686fcf96d8e (patch)
treeef01500bb8574f55475661b2d082cc4d708bcd7e
parentd1aab61698855709e2dc9ffb264d7d668a101fbc (diff)
docs: contrib: Add note about switch/casemainexpt
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--share/misc/contrib31
1 files changed, 31 insertions, 0 deletions
diff --git a/share/misc/contrib b/share/misc/contrib
index a36c127..39c9c02 100644
--- a/share/misc/contrib
+++ b/share/misc/contrib
@@ -62,6 +62,37 @@ if (!blah) {
--
+When writing switch statements, no indentation is needed
+before the "case" statement, do this:
+
+switch (v) {
+case 0:
+ ...
+ break;
+case 1:
+ ...
+ break;
+case 2:
+ ...
+ break;
+}
+
+Not this:
+
+
+switch (v) {
+case 0:
+ ...
+ break;
+case 1:
+ ...
+ break;
+case 2:
+ ...
+ break;
+}
+
+--
Now, only use predefined integer types in sys/cdefs.h like so:
uint8_t a;