summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-04-24 21:33:28 -0400
committerIan Moffett <ian@osmora.org>2025-05-02 16:43:59 -0400
commit952d23a5402e352bf89c22193768e6b9da20a0eb (patch)
tree8b26c246d239ecec8108060bfe957c83d34dcf9b
parentca0cc7e9b837c01c921626f7fbc4ed46189c718e (diff)
docs: contrib: Add note about switch/case
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;