]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
clang-format AlwaysBreakAfterReturnType to TopLevelDefinitions
authorMatthew Malcomson <mmalcomson@nvidia.com>
Mon, 9 Dec 2024 10:51:44 +0000 (10:51 +0000)
committerMatthew Malcomson <mmalcomson@nvidia.com>
Mon, 9 Dec 2024 16:58:55 +0000 (16:58 +0000)
The previous value of TopLevel meant that the function name of
declarations would also be on a new line.  THis does not match the
current formatting of headers.

Manual testing done on c-common.h.

Also set BraceWrapping.BeforeWhile to true to match the formatting
specified for do/while loops in GNU coding standards.
https://www.gnu.org/prep/standards/standards.html#Formatting

Ok for trunk?

contrib/ChangeLog:

* clang-format: AlwaysBreakAfterReturnType set to
TopLevelDefinitions and BraceWrapping.BeforeWhile set to true.

Signed-off-by: Matthew Malcomson <mmalcomson@nvidia.com>
contrib/clang-format

index 95f1455c14db52267e24dd39f5fbf1cd618626e5..4ed50ab6b26808589d8480d1fb69c6d637605c93 100644 (file)
@@ -27,7 +27,7 @@
 ---
 Language: Cpp
 AccessModifierOffset: -2
-AlwaysBreakAfterReturnType: TopLevel
+AlwaysBreakAfterReturnType: TopLevelDefinitions
 BinPackArguments: true
 BinPackParameters: true
 BraceWrapping:
@@ -42,6 +42,7 @@ BraceWrapping:
   AfterUnion: true
   BeforeCatch: true
   BeforeElse: true
+  BeforeWhile: true
   IndentBraces: true
   SplitEmptyFunction: false
 BreakBeforeBinaryOperators: All