Use static_cast instead of reinterpret_cast for casting void*.