From a3e421167b3703e9943d82fb804073c99ac55651 Mon Sep 17 00:00:00 2001 From: Douglas Mencken Date: Sat, 9 Feb 2013 15:11:09 -0500 Subject: [PATCH] esmtool/labels: bodyPartLabel, meshPartLabel, meshTypeLabel Signed chars, unsigned chars... Just use int for index everywhere. --- apps/esmtool/labels.cpp | 18 +++++++++--------- apps/esmtool/labels.hpp | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/esmtool/labels.cpp b/apps/esmtool/labels.cpp index d7d3cf9ce..f08c31003 100644 --- a/apps/esmtool/labels.cpp +++ b/apps/esmtool/labels.cpp @@ -16,7 +16,7 @@ #include #include -std::string bodyPartLabel(signed char idx) +std::string bodyPartLabel(int idx) { const char *bodyPartLabels[] = { "Head", @@ -48,13 +48,13 @@ std::string bodyPartLabel(signed char idx) "Tail" }; - if ((int)idx >= 0 && (int)(idx) <= 26) - return bodyPartLabels[(int)(idx)]; + if (idx >= 0 && idx <= 26) + return bodyPartLabels[idx]; else return "Invalid"; } -std::string meshPartLabel(signed char idx) +std::string meshPartLabel(int idx) { const char *meshPartLabels[] = { "Head", @@ -74,13 +74,13 @@ std::string meshPartLabel(signed char idx) "Tail" }; - if ((int)(idx) >= 0 && (int)(idx) <= ESM::BodyPart::MP_Tail) - return meshPartLabels[(int)(idx)]; + if (idx >= 0 && idx <= ESM::BodyPart::MP_Tail) + return meshPartLabels[idx]; else return "Invalid"; } -std::string meshTypeLabel(signed char idx) +std::string meshTypeLabel(int idx) { const char *meshTypeLabels[] = { "Skin", @@ -88,8 +88,8 @@ std::string meshTypeLabel(signed char idx) "Armor" }; - if ((int)(idx) >= 0 && (int)(idx) <= ESM::BodyPart::MT_Armor) - return meshTypeLabels[(int)(idx)]; + if (idx >= 0 && idx <= ESM::BodyPart::MT_Armor) + return meshTypeLabels[idx]; else return "Invalid"; } diff --git a/apps/esmtool/labels.hpp b/apps/esmtool/labels.hpp index bf3958037..48d7b249b 100644 --- a/apps/esmtool/labels.hpp +++ b/apps/esmtool/labels.hpp @@ -3,9 +3,9 @@ #include -std::string bodyPartLabel(signed char idx); -std::string meshPartLabel(signed char idx); -std::string meshTypeLabel(signed char idx); +std::string bodyPartLabel(int idx); +std::string meshPartLabel(int idx); +std::string meshTypeLabel(int idx); std::string clothingTypeLabel(int idx); std::string armorTypeLabel(int idx); std::string dialogTypeLabel(int idx);