Fix unsigned comparison warnings (-Werror + GCC5) from CS:GO fixes.

This commit is contained in:
Kyle Sanderson 2017-10-09 13:00:52 -07:00
parent 22e3d2d198
commit 30f061e818

View File

@ -321,7 +321,7 @@ const char *GetTranslatedWeaponAlias(const char *weapon)
"nvgs", "nightvision" "nvgs", "nightvision"
}; };
for (int i = 0; i < SM_ARRAYSIZE(szAliases)/2; i++) for (size_t i = 0; i < SM_ARRAYSIZE(szAliases)/2; i++)
{ {
if (stricmp(weapon, szAliases[i * 2]) == 0) if (stricmp(weapon, szAliases[i * 2]) == 0)
return szAliases[i * 2 + 1]; return szAliases[i * 2 + 1];
@ -402,7 +402,7 @@ const char *WeaponIDToAlias(int weaponID)
#else #else
int realID = GetRealWeaponID(weaponID); int realID = GetRealWeaponID(weaponID);
if (realID < SM_ARRAYSIZE(szWeaponInfo) && realID > 0) if (static_cast<size_t>(realID) < SM_ARRAYSIZE(szWeaponInfo) && realID > 0)
return szWeaponInfo[realID]; return szWeaponInfo[realID];
return NULL; return NULL;