mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
docs: Document cast formatting rules
This commit is contained in:
@@ -67,6 +67,18 @@ SPDX-License-Identifier: LGPL-2.1-or-later
|
|||||||
const char *foo(const char *input);
|
const char *foo(const char *input);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- Casts should be written like this:
|
||||||
|
|
||||||
|
```c
|
||||||
|
(const char*) s;
|
||||||
|
```
|
||||||
|
|
||||||
|
instead of this:
|
||||||
|
|
||||||
|
```c
|
||||||
|
(const char *)s;
|
||||||
|
```
|
||||||
|
|
||||||
- Single-line `if` blocks should not be enclosed in `{}`. Write this:
|
- Single-line `if` blocks should not be enclosed in `{}`. Write this:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
|
|||||||
Reference in New Issue
Block a user