Skip to content

Commit

Permalink
coding convention: update braces usage
Browse files Browse the repository at this point in the history
JIRA: CI-273
  • Loading branch information
damianloew committed May 10, 2023
1 parent 11385c9 commit 1a9564b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions coding.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ Local variables should be defined before the function code according to ANSI C 8
b = _vm_zalloc(z, NULL);
kmalloc_common.allocsz += (1 << idx);
if (idx == hdridx)
if (idx == hdridx) {
kmalloc_common.hdrblocks--;
}
if (z->used == z->blocks) {
_vm_zoneRemove(&kmalloc_common.sizes[idx], z);
Expand Down Expand Up @@ -141,8 +142,9 @@ In case of increment `++` and decrement `--` operators following rules should be
Notation of conditional expression is presented below.
```c
if (expr)
line 1
if (expr) {
line 1
}
if (expr0) {
line 1
Expand All @@ -158,7 +160,7 @@ Notation of conditional expression is presented below.
}
```

A space should be used after a keyword of the conditional instruction. Opening and closing braces should be used only if the body of the conditional instruction is longer than one line. The opening brace should be put in the same line as the keyword of the conditional instruction. The closing brace should be placed after the last line of the conditional instruction in a new line.
A space should be used after a keyword of the conditional instruction. Opening and closing braces should be always used. The opening brace should be put in the same line as the keyword of the conditional instruction. The closing brace should be placed after the last line of the conditional instruction in a new line.

## Type definition

Expand Down

0 comments on commit 1a9564b

Please sign in to comment.