]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
docs: Document cast formatting rules
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 22 Nov 2025 21:50:39 +0000 (22:50 +0100)
committerMike Yuan <me@yhndnzj.com>
Sat, 22 Nov 2025 22:41:46 +0000 (23:41 +0100)
docs/CODING_STYLE.md

index 18fefb484668a1024129241b814aa3be177518e2..a890bd25ecd8e02db12070fadde923664aec552d 100644 (file)
@@ -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