From: Daan De Meyer Date: Sat, 22 Nov 2025 21:50:39 +0000 (+0100) Subject: docs: Document cast formatting rules X-Git-Tag: v259-rc2~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dd281e19a7c9b5c25618f98f95b6d767e4e436c5;p=thirdparty%2Fsystemd.git docs: Document cast formatting rules --- diff --git a/docs/CODING_STYLE.md b/docs/CODING_STYLE.md index 18fefb48466..a890bd25ecd 100644 --- a/docs/CODING_STYLE.md +++ b/docs/CODING_STYLE.md @@ -67,6 +67,18 @@ SPDX-License-Identifier: LGPL-2.1-or-later 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: ```c