Skip to content

Commit

Permalink
Fix "comparison between signed and unsigned integer expressions"
Browse files Browse the repository at this point in the history
  • Loading branch information
Koncord committed Dec 21, 2016
1 parent af7b232 commit 6e62375
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions apps/openmw-mp/Player.cpp
Expand Up @@ -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)
{
Expand All @@ -63,7 +63,7 @@ TPlayers *Players::getPlayers()
Player::Player(RakNet::RakNetGUID guid) : BasePlayer(guid)
{
handshakeState = false;
loadState = false;
loadState = NOTLOADED;
lastAttacker = 0;
}

Expand Down
2 changes: 1 addition & 1 deletion apps/openmw-mp/Script/Functions/Spells.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion apps/openmw/mwmp/GUIDialogList.cpp
Expand Up @@ -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]);

}
Expand Down
8 changes: 4 additions & 4 deletions apps/openmw/mwworld/cellstore.cpp
Expand Up @@ -450,7 +450,7 @@ namespace MWWorld
{
PtrType mFound;
std::string mIdToFind;
int mRefNumIndexToFind;
unsigned int mRefNumIndexToFind;

bool operator()(const PtrType& ptr)
{
Expand All @@ -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;
Expand All @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions apps/openmw/mwworld/cellstore.hpp
Expand Up @@ -76,7 +76,7 @@ namespace MWWorld
float mWaterLevel;

// Added by tes3mp
int lastRefNumIndex;
unsigned int lastRefNumIndex;

MWWorld::TimeStamp mLastRespawn;

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion components/openmw-mp/Packets/Player/PacketSpellbook.cpp
Expand Up @@ -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;

Expand Down

0 comments on commit 6e62375

Please sign in to comment.