diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-31 17:01:38 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-31 17:01:38 +0300 |
commit | 5a60cfd0ef0c2f8b78397d05a50ab9b939309ea5 (patch) | |
tree | aeafccf4632262393b23e52afc9facc5ec9f1b3f /src/net | |
parent | 84f2cad3897d0dacb60cfef4e1860ffb8ec268e1 (diff) | |
download | plus-5a60cfd0ef0c2f8b78397d05a50ab9b939309ea5.tar.gz plus-5a60cfd0ef0c2f8b78397d05a50ab9b939309ea5.tar.bz2 plus-5a60cfd0ef0c2f8b78397d05a50ab9b939309ea5.tar.xz plus-5a60cfd0ef0c2f8b78397d05a50ab9b939309ea5.zip |
Fix sign on some vars.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/network.cpp | 8 | ||||
-rw-r--r-- | src/net/tmwa/network.cpp | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp index 87d5d4b5a..9b3ede389 100644 --- a/src/net/eathena/network.cpp +++ b/src/net/eathena/network.cpp @@ -165,7 +165,7 @@ void Network::dispatchMessages() while (messageReady()) { SDL_mutexP(mMutexIn); - const int msgId = readWord(0); + const unsigned int msgId = readWord(0); int len = -1; if (msgId == SMSG_SERVER_VERSION_RESPONSE) { @@ -177,7 +177,7 @@ void Network::dispatchMessages() } else { - if (msgId >= 0 && msgId < packet_lengths_size) + if (msgId < packet_lengths_size) len = packet_lengths[msgId]; } @@ -191,12 +191,12 @@ void Network::dispatchMessages() if (len == 0) { // need copy data for safty - std::string str = strprintf("Wrong packet %d ""received. Exiting.", + std::string str = strprintf("Wrong packet %u ""received. Exiting.", msgId); logger->safeError(str); } - if (msgId >= 0 && msgId < messagesSize) + if (msgId < messagesSize) { MessageHandler *const handler = mMessageHandlers[msgId]; if (handler) diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index b778d6b31..8f4b2452a 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -145,13 +145,13 @@ void Network::dispatchMessages() { SDL_mutexP(mMutexIn); BLOCK_START("Network::dispatchMessages 2") - const int msgId = readWord(0); + const unsigned int msgId = readWord(0); int len = -1; if (msgId == SMSG_SERVER_VERSION_RESPONSE) len = 10; else if (msgId == SMSG_UPDATE_HOST2) len = -1; - else if (msgId >= 0 && msgId < packet_lengths_size) + else if (msgId < packet_lengths_size) len = packet_lengths[msgId]; if (len == -1) @@ -166,12 +166,12 @@ void Network::dispatchMessages() if (len == 0) { // need copy data for safty - std::string str = strprintf("Wrong packet %d ""received. Exiting.", + std::string str = strprintf("Wrong packet %u ""received. Exiting.", msgId); logger->safeError(str); } - if (msgId >= 0 && msgId < messagesSize) + if (msgId < messagesSize) { MessageHandler *const handler = mMessageHandlers[msgId]; if (handler) |