Fix "comparison between signed and unsigned integer expressions"

coverity_scan^2 tes3mp-0.4.0
Koncord 8 years ago
parent af7b232789
commit 6e6237541a

@ -36,7 +36,7 @@ void Players::newPlayer(RakNet::RakNetGUID guid)
players[guid]->CreatureStats()->blank();
players[guid]->charClass.blank();
for (int i = 0; i < mwmp::Networking::get().maxConnections(); i++)
for (unsigned int i = 0; i < mwmp::Networking::get().maxConnections(); i++)
{
if (slots[i] == 0)
{
@ -63,7 +63,7 @@ TPlayers *Players::getPlayers()
Player::Player(RakNet::RakNetGUID guid) : BasePlayer(guid)
{
handshakeState = false;
loadState = false;
loadState = NOTLOADED;
lastAttacker = 0;
}

@ -52,7 +52,7 @@ bool SpellFunctions::HasSpell(unsigned short pid, const char* spellId)
Player *player;
GET_PLAYER(pid, player, false);
for (int i = 0; i < player->spellbook.count; i++)
for (unsigned int i = 0; i < player->spellbook.count; i++)
if (Misc::StringUtils::ciEqual(player->spellbook.spells.at(i).id, spellId))
return true;
return false;

@ -28,7 +28,7 @@ GUIDialogList::GUIDialogList(const std::string &message, const std::vector<std::
mButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GUIDialogList::mousePressed);
mMessage->setCaptionWithReplacing(message);
for(int i = 0; i < list.size(); i++)
for(size_t i = 0; i < list.size(); i++)
mListBox->addItem(list[i]);
}

@ -450,7 +450,7 @@ namespace MWWorld
{
PtrType mFound;
std::string mIdToFind;
int mRefNumIndexToFind;
unsigned int mRefNumIndexToFind;
bool operator()(const PtrType& ptr)
{
@ -467,7 +467,7 @@ namespace MWWorld
};
///< Added by tes3mp and used to find an object by both its ID and its reference number
Ptr CellStore::searchExact (const std::string& id, int numIndex)
Ptr CellStore::searchExact (const std::string& id, unsigned int numIndex)
{
SearchExactVisitor<MWWorld::Ptr> searchVisitor;
searchVisitor.mIdToFind = id;
@ -477,13 +477,13 @@ namespace MWWorld
}
// Added by tes3mp and used to get the last reference number in the cell
int CellStore::getLastRefNumIndex() const
unsigned int CellStore::getLastRefNumIndex() const
{
return lastRefNumIndex;
}
// Added by tes3mp and used to record the last reference number in the cell
void CellStore::setLastRefNumIndex(int value)
void CellStore::setLastRefNumIndex(unsigned int value)
{
lastRefNumIndex = value;
}

@ -76,7 +76,7 @@ namespace MWWorld
float mWaterLevel;
// Added by tes3mp
int lastRefNumIndex;
unsigned int lastRefNumIndex;
MWWorld::TimeStamp mLastRespawn;
@ -234,13 +234,13 @@ namespace MWWorld
Ptr searchViaActorId (int id);
///< Will return an empty Ptr if cell is not loaded.
Ptr searchExact (const std::string& id, int numIndex);
Ptr searchExact (const std::string& id, unsigned int numIndex);
///< Added by tes3mp and used to find an object by both its ID and its reference number
int getLastRefNumIndex() const;
unsigned int getLastRefNumIndex() const;
// Added by tes3mp and used to get the last reference number in the cell
void setLastRefNumIndex(int value);
void setLastRefNumIndex(unsigned int value);
// Added by tes3mp and used to record the last reference number in the cell
float getWaterLevel() const;

@ -22,7 +22,7 @@ void PacketSpellbook::Packet(RakNet::BitStream *bs, BasePlayer *player, bool sen
RW(player->spellbook.count, send);
for (int i = 0; i < player->spellbook.count; i++)
for (unsigned int i = 0; i < player->spellbook.count; i++)
{
Spell spell;

Loading…
Cancel
Save