Resolve CppCheck error: old c-style cast