cppcheck: work around false positives
cppcheck: initialize member
cppcheck: pass by reference instead of value; fix comment
cppcheck: reduce variable scopes
cppcheck: reduce variable scope
cppcheck: reduce variable scope
cppcheck: reduce variable scope
cppcheck: reduce variable scope