Fix some cppcheck warning + initialize variable in header + const

variables
2 jobs for master in 8 minutes and 53 seconds (queued for 66 minutes and 17 seconds)