summaryrefslogtreecommitdiffhomepage
path: root/serialize
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-04-07 10:03:14 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-04-07 10:03:14 +0200
commit8382bc2dcfe613652f59c3118fa21d47b874f647 (patch)
treed0a9b5d4053637a6e3f9acf866077cee50a10a9e /serialize
parentc3fec2466ed44e3d65b8dceb5a80bc621176d45d (diff)
use static_cast on void* instead of reinterpret_cast
Diffstat (limited to 'serialize')
-rw-r--r--serialize/savegame.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/serialize/savegame.cpp b/serialize/savegame.cpp
index 8e7039e5..34e90993 100644
--- a/serialize/savegame.cpp
+++ b/serialize/savegame.cpp
@@ -460,11 +460,11 @@ struct writer final : visitor_<writer>
switch (type)
{
- case atlas_type::ground: name = reinterpret_cast<const ground_atlas*>(atlas)->name(); break;
- case atlas_type::wall: name = reinterpret_cast<const wall_atlas*>(atlas)->name(); break;
+ case atlas_type::ground: name = static_cast<const ground_atlas*>(atlas)->name(); break;
+ case atlas_type::wall: name = static_cast<const wall_atlas*>(atlas)->name(); break;
case atlas_type::vobj:
case atlas_type::anim:
- name = reinterpret_cast<const anim_atlas*>(atlas)->name();
+ name = static_cast<const anim_atlas*>(atlas)->name();
break;
default:
fm_abort("invalid atlas type '%d'", (int)type);
@@ -896,7 +896,7 @@ struct reader final : visitor_<reader>
auto a = atlases[id];
fm_soft_assert(a.type == Type);
using atlas_type = typename atlas_from_type<Type>::Type;
- const auto* atlas = reinterpret_cast<const atlas_type*>(a.atlas);
+ const auto* atlas = static_cast<const atlas_type*>(a.atlas);
return atlas->name();
}