diff --git a/.clang-format b/.clang-format index 222df9c..5ae9bee 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,56 @@ ---- -BasedOnStyle: Google -IndentWidth: 4 -ColumnLimit: 0 \ No newline at end of file +BasedOnStyle: LLVM + +# Indentation (Linux kernel style) +UseTab: Always +IndentWidth: 8 +TabWidth: 8 + +# Keep parameters on one line as much as possible +BinPackParameters: true +BinPackArguments: true + +# Allow long lines (important!) +ColumnLimit: 0 # or set to something large like 120 + +# Prevent breaking after return type / before function name +AlwaysBreakAfterReturnType: None +AlwaysBreakAfterDefinitionReturnType: None + +# Keep function declarations/definitions on one line if possible +PenaltyBreakBeforeFirstCallParameter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 1000000 + +# Braces: K&R style everywhere, INCLUDING functions (your modification) +BreakBeforeBraces: Attach + +# Control specific brace wrapping behavior +BraceWrapping: + AfterFunction: false # <-- key change (same line for functions) + AfterControlStatement: false + AfterStruct: false + AfterEnum: false + AfterUnion: false + AfterClass: false + BeforeElse: false + +# Spaces +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false + +# Pointer alignment (kernel prefers this style) +PointerAlignment: Right + +# Keep simple statements compact +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None + +# For-loop style similar to kernel +AllowShortBlocksOnASingleLine: Never + +# Don't align weirdly +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false + +# Include handling (kernel is manual about includes) +SortIncludes: false \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 81469bd..c93a9d9 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -1,8 +1,7 @@ - - - \ No newline at end of file diff --git a/.idea/editor.xml b/.idea/editor.xml index e7b96ca..6438eb1 100644 --- a/.idea/editor.xml +++ b/.idea/editor.xml @@ -245,7 +245,6 @@