diff options
author | Ian Moffett <ian@osmora.org> | 2025-04-24 21:33:28 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-05-02 16:43:59 -0400 |
commit | 952d23a5402e352bf89c22193768e6b9da20a0eb (patch) | |
tree | 8b26c246d239ecec8108060bfe957c83d34dcf9b | |
parent | ca0cc7e9b837c01c921626f7fbc4ed46189c718e (diff) |
docs: contrib: Add note about switch/case
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | share/misc/contrib | 31 |
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; |