CodingGuidelines

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2025-01-28 09:23:38 -07:00
parent 6907f5b3fe
commit 987d3560d1
1 changed files with 11 additions and 3 deletions

View File

@ -61,12 +61,20 @@ instead, write this:
fatal ("virtual memory exhausted"); fatal ("virtual memory exhausted");
Use braces around if/for bodies that are more than one line. Do not use braces around if/for that are one line.
IE,
if (pred) if (pred)
for (int i = 0; i < len; i++) { // this body should be in {}'s bar = 1;
else
bar = 3;
Use braces around if/for bodies that are more than one line.
if (pred) {
for (int i = 0; i < len; i++) {
... ...
} }
}
Add a default clause to all switches calling switchCaseNotHandled: Add a default clause to all switches calling switchCaseNotHandled: