fix release build
avoid warning reg. redefined macro
fix warnings reg. wrong format specifier
avoid warnings reg. unused variables
fix warning reg. expresion always false
fix warnings reg. wrong order of evaluation
fix warnings reg. wrong header guards