From 06f42ba69cdf67a768cce30b5e0b82881fb80ab0 Mon Sep 17 00:00:00 2001 From: elsid Date: Sun, 26 Mar 2023 16:04:15 +0200 Subject: [PATCH] Use fixed size enum type for ESM::Dialogue::mType --- apps/opencs/model/world/columnimp.hpp | 3 ++- components/esm3/loaddial.hpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/opencs/model/world/columnimp.hpp b/apps/opencs/model/world/columnimp.hpp index a24a661cda..91db8d0c41 100644 --- a/apps/opencs/model/world/columnimp.hpp +++ b/apps/opencs/model/world/columnimp.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -1342,7 +1343,7 @@ namespace CSMWorld { ESXRecordT record2 = record.get(); - record2.mType = data.toInt(); + record2.mType = static_cast(data.toInt()); record.setModified(record2); } diff --git a/components/esm3/loaddial.hpp b/components/esm3/loaddial.hpp index 6c3ec16e71..9fb57aa390 100644 --- a/components/esm3/loaddial.hpp +++ b/components/esm3/loaddial.hpp @@ -30,7 +30,7 @@ namespace ESM /// Return a string descriptor for this record type. Currently used for debugging / error logs only. static std::string_view getRecordType() { return "Dialogue"; } - enum Type + enum Type : std::int8_t { Topic = 0, Voice = 1, @@ -41,7 +41,7 @@ namespace ESM }; RefId mId; - signed char mType; + Type mType; InfoContainer mInfo; InfoOrder mInfoOrder;