diff --git a/apps/esmtool/labels.cpp b/apps/esmtool/labels.cpp index 9fb233237..d7d3cf9ce 100644 --- a/apps/esmtool/labels.cpp +++ b/apps/esmtool/labels.cpp @@ -16,7 +16,7 @@ #include #include -std::string bodyPartLabel(char idx) +std::string bodyPartLabel(signed char idx) { const char *bodyPartLabels[] = { "Head", @@ -47,14 +47,14 @@ std::string bodyPartLabel(char idx) "Weapon", "Tail" }; - + if ((int)idx >= 0 && (int)(idx) <= 26) return bodyPartLabels[(int)(idx)]; else return "Invalid"; } -std::string meshPartLabel(char idx) +std::string meshPartLabel(signed char idx) { const char *meshPartLabels[] = { "Head", @@ -73,25 +73,25 @@ std::string meshPartLabel(char idx) "Clavicle", "Tail" }; - + if ((int)(idx) >= 0 && (int)(idx) <= ESM::BodyPart::MP_Tail) return meshPartLabels[(int)(idx)]; else return "Invalid"; } -std::string meshTypeLabel(char idx) +std::string meshTypeLabel(signed char idx) { const char *meshTypeLabels[] = { "Skin", "Clothing", "Armor" }; - + if ((int)(idx) >= 0 && (int)(idx) <= ESM::BodyPart::MT_Armor) return meshTypeLabels[(int)(idx)]; else - return "Invalid"; + return "Invalid"; } std::string clothingTypeLabel(int idx) @@ -108,7 +108,7 @@ std::string clothingTypeLabel(int idx) "Ring", "Amulet" }; - + if (idx >= 0 && idx <= 9) return clothingTypeLabels[idx]; else diff --git a/apps/esmtool/labels.hpp b/apps/esmtool/labels.hpp index 7f1ff7986..bf3958037 100644 --- a/apps/esmtool/labels.hpp +++ b/apps/esmtool/labels.hpp @@ -3,9 +3,9 @@ #include -std::string bodyPartLabel(char idx); -std::string meshPartLabel(char idx); -std::string meshTypeLabel(char idx); +std::string bodyPartLabel(signed char idx); +std::string meshPartLabel(signed char idx); +std::string meshTypeLabel(signed char idx); std::string clothingTypeLabel(int idx); std::string armorTypeLabel(int idx); std::string dialogTypeLabel(int idx); diff --git a/components/esm/loadcell.hpp b/components/esm/loadcell.hpp index 27bdd77ce..de467666e 100644 --- a/components/esm/loadcell.hpp +++ b/components/esm/loadcell.hpp @@ -77,8 +77,8 @@ public: std::string mKey, mTrap; // Key and trap ID names, if any // No idea - occurs ONCE in Morrowind.esm, for an activator - char mUnam; - + signed char mUnam; + // Track deleted references. 0 - not deleted, 1 - deleted, but respawns, 2 - deleted and does not respawn. int mDeleted; @@ -164,14 +164,14 @@ struct Cell bool mWaterInt; int mMapColor; int mNAM0; - + // References "leased" from another cell (i.e. a different cell // introduced this ref, and it has been moved here by a plugin) CellRefTracker mLeasedRefs; MovedCellRefTracker mMovedRefs; - + void load(ESMReader &esm, MWWorld::ESMStore &store); - + // This method is left in for compatibility with esmtool. Parsing moved references currently requires // passing ESMStore, bit it does not know about this parameter, so we do it this way. void load(ESMReader &esm) {}; @@ -209,7 +209,7 @@ struct Cell reuse one memory location without blanking it between calls. */ static bool getNextRef(ESMReader &esm, CellRef &ref); - + /* This fetches an MVRF record, which is used to track moved references. * Since they are comparably rare, we use a separate method for this. */ diff --git a/components/esm/loaddial.hpp b/components/esm/loaddial.hpp index 078c78811..61f3f763d 100644 --- a/components/esm/loaddial.hpp +++ b/components/esm/loaddial.hpp @@ -30,7 +30,7 @@ struct Dialogue }; std::string mId; - char mType; + signed char mType; std::vector mInfo; void load(ESMReader &esm); diff --git a/components/to_utf8/tables_gen.hpp b/components/to_utf8/tables_gen.hpp index 9c32f0427..a1d4b6d80 100644 --- a/components/to_utf8/tables_gen.hpp +++ b/components/to_utf8/tables_gen.hpp @@ -8,7 +8,7 @@ namespace ToUTF8 /// Central European and Eastern European languages that use Latin script, /// such as Polish, Czech, Slovak, Hungarian, Slovene, Bosnian, Croatian, /// Serbian (Latin script), Romanian and Albanian. -static char windows_1250[] = +static signed char windows_1250[] = { 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, @@ -270,7 +270,7 @@ static char windows_1250[] = /// Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic /// and other languages -static char windows_1251[] = +static signed char windows_1251[] = { 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, @@ -531,7 +531,7 @@ static char windows_1251[] = }; /// Latin alphabet used by English and some other Western languages -static char windows_1252[] = +static signed char windows_1252[] = { 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, diff --git a/components/to_utf8/to_utf8.cpp b/components/to_utf8/to_utf8.cpp index 275f5483f..e2a1b1220 100644 --- a/components/to_utf8/to_utf8.cpp +++ b/components/to_utf8/to_utf8.cpp @@ -216,7 +216,7 @@ void Utf8Encoder::copyFromArray(unsigned char ch, char* &out) return; } - const char *in = translationArray + ch*6; + const signed char *in = translationArray + ch*6; int len = *(in++); for (int i=0; i mOutput; - char* translationArray; + signed char* translationArray; }; }