summaryrefslogtreecommitdiff
path: root/src/net/eathena/network.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-19 23:10:19 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-19 23:10:19 +0300
commitbdd2a88890ea7819371047fa53eeca87209147d0 (patch)
tree95dcb4401bcb29ac0c043ecd278c4f1b8f3308dc /src/net/eathena/network.cpp
parent78982d2707fc8db243cc29448c411a52b5aeeffb (diff)
downloadplus-bdd2a88890ea7819371047fa53eeca87209147d0.tar.gz
plus-bdd2a88890ea7819371047fa53eeca87209147d0.tar.bz2
plus-bdd2a88890ea7819371047fa53eeca87209147d0.tar.xz
plus-bdd2a88890ea7819371047fa53eeca87209147d0.zip
Fix compilation warnings.
Diffstat (limited to 'src/net/eathena/network.cpp')
-rw-r--r--src/net/eathena/network.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp
index 5cfe0af1a..67018e7b5 100644
--- a/src/net/eathena/network.cpp
+++ b/src/net/eathena/network.cpp
@@ -218,7 +218,7 @@ MessageIn Network::getNextMessage()
SDL_mutexP(mMutex);
int msgId = readWord(0);
- int len;
+ int len = -1;
if (msgId == SMSG_SERVER_VERSION_RESPONSE)
{
len = 10;
@@ -229,8 +229,11 @@ MessageIn Network::getNextMessage()
}
else
{
- if (msgId >= 0 && msgId < sizeof(packet_lengths) / sizeof (short))
+ if (msgId >= 0 && msgId < static_cast<signed>(
+ sizeof(packet_lengths) / sizeof (short)))
+ {
len = packet_lengths[msgId];
+ }
}
if (len == -1)