1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-25 13:49:55 +03:00

docs: add coding style example

Add example of how to structure else-blocks following a multiline block.
This commit is contained in:
Anders Wenhaug
2021-06-23 23:39:56 +02:00
committed by Yu Watanabe
parent b905f3bbba
commit 4dbad977ff

View File

@ -69,6 +69,14 @@ layout: default
```
- Do not write `foo ()`, write `foo()`.
- `else` blocks should generally start on the same line as the closing `}`:
```c
if (foobar) {
find();
waldo();
} else
dont_find_waldo();
```
## Code Organization and Semantics