Adjust coding according to static check

A static code check with cppcheck has been executed. Numerous
style deficiencies and some bugs were corrected.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>