[fixup] Replace some beautiful C casts with ugly static_casts