[huge patch] reformat whole code base of Kalzium

Review Request #120238 - Created Sept. 17, 2014 and submitted

Martin Walch

Across the project there are many coding styles with lots of different indentation patterns. There are three different tabs to space conversions (1:2, 1:4, 1:8), even mixed within individual files. This makes the code unnecessarily hard to read and to edit.

In the hope that I do not offend anybody: unify code style.

Roughly apply the style from kdelibs:

  • get rid of all tabs
  • indentation is four spaces
  • unify includes and include guards
  • less blank lines
  • one space after "if", "for", etc.
  • no space after cast
  • prefix operators ("++", "--") instead of postfix where applicable
  • pointers: preferably single space before "*" (same for "&")
  • opening curly braces on same line except for implementations
  • no whitespace after opening parenthesis "(" or before closing ones ")"
  • no single line "if", "for", "else", etc. (always curly braces)
  • indent "case" to same level as corresponding "switch"
  • at least in some files adjust line wraps to a limit of 100 chars
  • exactly one newline at EOF

Also some formatting to copyright statements (I hope this is legally ok)

fix some spelling errors
constify& some foreach loops (suggested by krazy2)
* replace some single char strings with chars (suggested by krazy2)

This whole patch fixes between 15 and 20 krazy2 warnings.

  • compiling
  • starting the program (did not test all features)
Martin Walch
Martin Walch
Etienne Rebetez
Martin Walch
Review request changed

Status: Closed (submitted)