You can use AStyle (Artistic Style) source code indenter to
help you auto format your source code. It will for sure not correct all your coding styles but
for sure will eliminate most of them. You can download AStyle from this location
or install via apt-get
:
sudo apt-get install astyle
To format your file you can execute below command:
astyle --suffix=none `find . -regex '.*\.[ch]p*p*$'`