Code cleanup and clang format update

remove redundant extern keywords across the repo.

add update clang format options:

  • SeparateDefinitionBlocks: Always (new) - forces new lines between functions and other definition blocks.
  • InsertBraces: true (new) - forces braces even for single line control flow statements (if/while/etc).
  • AllowShortBlocksOnASingleLine: Empty (changed) - only empty blocks allowed on same line (ie {}).
  • AllowShortCaseLabelsOnASingleLine: false (changed) - case statements on individual lines.
  • AllowShortFunctionsOnASingleLine: Empty (changed) - function body on separate line always, even for single line.
  • AllowShortLoopsOnASingleLine: false (changed) - same for loops.
  • PointerAlignment: Left (changed) - align pointer to type instead of variable, ie int* a; instead of int *a;

STYLE.md is updated accordingly.

these make code easier to read, by ensuring control statements are on their own lines, easier to debug - setting breakpoint on single line function is awkward, and forcing braces around single line statements help avoid mistakes where formatting may confuse execution flow.

This is on top on my previous MR (!2606 (merged)) so review only commits since "Remove redundant "extern" keywords across the codebase" (310c9a98)

Edited by Sergey Sablin

Merge request reports

Loading