fix several cppcheck warnings

7 jobs for warnings_cppcheck in 64 minutes and 19 seconds
Status Job ID Name Coverage
  Test
passed #18306
Apple
Mac-Cpp11

01:04:17

passed #18305
Qt551 VS2013
VS2013-Qt-5.5.1-x64

00:17:14

passed #18304
Qt56 VS2015
VS2015-Qt-5.6.0-x32

00:17:13

passed #18303
Qt56 VS2015
VS2015-Qt-5.6.0-x64

00:20:10

passed #18301
MultiThreads Linux
clang-c++11-Qt5

00:08:56

passed #18302
MultiThreads Linux
cppcheck

00:38:35

passed #18300
Linux
gcc-c++11-Qt5

00:03:27