cppcheck: fix C-style casting