cppcheck fixes (code quality)
These are a set of (mostly trivial) fixes to cppcheck
warnings. A few real (although unlikely) bugs were caught. There are still a few non-trivial ones remaining that would need to be addressed separately.
To reproduce (after cmake config):
cppcheck --quiet --inline-suppr --check-level=exhaustive --template=gcc --enable=warning,portability --library=boost --suppress=duplInheritedMember --suppress=invalidscanf --suppress=syntaxError --suppress=unknownMacro --project=compile_commands.json
Edited by Frank Winklmeier