Fixed various cppcheck warnings, suppressed others
- Avoid cppcheck false positive (due to pointer aliasing confusion). Reworked the code so g doesn’t alias gTmp, so that cppcheck doesn’t think that gTmp is used unititialized.
- added seemingly missing break
- removed store to local variable from a macro
- fixed other warnings.