diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-26 22:22:22 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-06 00:27:26 +0100 |
commit | c75511fffc77d517fbf854ec8bef791f055de44c (patch) | |
tree | c431846c7d7a6934f103d21129a20a0dc4fd1c8e /src/net/playerhandler.cpp | |
parent | 646cc317351d60e0fefcab789248310662fcbbc8 (diff) | |
download | mana-c75511fffc77d517fbf854ec8bef791f055de44c.tar.gz mana-c75511fffc77d517fbf854ec8bef791f055de44c.tar.bz2 mana-c75511fffc77d517fbf854ec8bef791f055de44c.tar.xz mana-c75511fffc77d517fbf854ec8bef791f055de44c.zip |
Got rid of Sint{8,16,32} and Uint32 for being ID
Using unsigned rarely makes sense, especially when the server doesn't
use it either. Other uses of unsigned should be reviewed.
In all other cases, int is the fastest integer type on any architecture.
Using 8 or 16 bits can basically only be a memory optimization.
Diffstat (limited to 'src/net/playerhandler.cpp')
-rw-r--r-- | src/net/playerhandler.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index 7790cdd0..d99a97a5 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -164,8 +164,8 @@ void PlayerHandler::handleMessage(MessageIn *msg) player_node->mY = y; logger->log("Adjust scrolling by %d:%d", - (int)scrollOffsetX, - (int)scrollOffsetY); + (int) scrollOffsetX, + (int) scrollOffsetY); viewport->scrollBy(scrollOffsetX, scrollOffsetY); } @@ -173,7 +173,7 @@ void PlayerHandler::handleMessage(MessageIn *msg) case SMSG_PLAYER_STAT_UPDATE_1: { - Sint16 type = msg->readInt16(); + int type = msg->readInt16(); Uint32 value = msg->readInt32(); switch (type) @@ -301,10 +301,10 @@ void PlayerHandler::handleMessage(MessageIn *msg) case SMSG_PLAYER_STAT_UPDATE_3: { - Sint32 type = msg->readInt32(); - Sint32 base = msg->readInt32(); - Sint32 bonus = msg->readInt32(); - Sint32 total = base + bonus; + int type = msg->readInt32(); + int base = msg->readInt32(); + int bonus = msg->readInt32(); + int total = base + bonus; switch (type) { case 0x000d: player_node->mAttr[LocalPlayer::STR] = total; @@ -325,9 +325,9 @@ void PlayerHandler::handleMessage(MessageIn *msg) case SMSG_PLAYER_STAT_UPDATE_4: { - Sint16 type = msg->readInt16(); - Sint8 fail = msg->readInt8(); - Sint8 value = msg->readInt8(); + int type = msg->readInt16(); + int fail = msg->readInt8(); + int value = msg->readInt8(); if (fail != 1) break; @@ -404,7 +404,7 @@ void PlayerHandler::handleMessage(MessageIn *msg) case SMSG_PLAYER_ARROW_MESSAGE: { - Sint16 type = msg->readInt16(); + int type = msg->readInt16(); switch (type) { case 0: |