Various SCA fixes

Various SCA fixes from cppcheck incl.:
* pass const parameter by reference
* use empty() over size() 
* perform init in initialization list
* prefer prefix ++operator for non-primitive types
* remove check for >=0 for unsigned variables
* reduce scope of variables
* remove unused variables
* correct format specifier
* suppress some cppcheck warnings
We put & with the type rather than the name. So this would be: 

       std::vector<uint32_t>& keys_hashes