diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-26 22:22:22 +0100 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-05 17:22:19 -0700 |
commit | 448d9076137fc5dde666a90820992a34a945cbf7 (patch) | |
tree | ee8d478fbced980a0ea868e9a7810ca56c49fe97 /src/net | |
parent | a79d05b01d4a2dc639e6d3a5b7ddd508e64d3511 (diff) | |
download | mana-448d9076137fc5dde666a90820992a34a945cbf7.tar.gz mana-448d9076137fc5dde666a90820992a34a945cbf7.tar.bz2 mana-448d9076137fc5dde666a90820992a34a945cbf7.tar.xz mana-448d9076137fc5dde666a90820992a34a945cbf7.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')
-rw-r--r-- | src/net/beinghandler.cpp | 6 | ||||
-rw-r--r-- | src/net/buysellhandler.cpp | 8 | ||||
-rw-r--r-- | src/net/chathandler.cpp | 2 | ||||
-rw-r--r-- | src/net/equipmenthandler.cpp | 6 | ||||
-rw-r--r-- | src/net/inventoryhandler.cpp | 6 | ||||
-rw-r--r-- | src/net/itemhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/npchandler.cpp | 2 | ||||
-rw-r--r-- | src/net/playerhandler.cpp | 22 | ||||
-rw-r--r-- | src/net/skillhandler.cpp | 8 | ||||
-rw-r--r-- | src/net/tradehandler.cpp | 6 |
10 files changed, 34 insertions, 34 deletions
diff --git a/src/net/beinghandler.cpp b/src/net/beinghandler.cpp index 71369031..4ff303ab 100644 --- a/src/net/beinghandler.cpp +++ b/src/net/beinghandler.cpp @@ -65,14 +65,14 @@ BeingHandler::BeingHandler(bool enableSync): void BeingHandler::handleMessage(MessageIn *msg) { - Uint32 id; + int id; Uint16 job, speed; Uint16 headTop, headMid, headBottom; Uint16 shoes, gloves, cape, misc1, misc2; Uint16 weapon, shield; Uint16 gmstatus; - Sint16 param1; - Sint8 type; + int param1; + int type; Being *srcBeing, *dstBeing; int hairStyle, hairColor; diff --git a/src/net/buysellhandler.cpp b/src/net/buysellhandler.cpp index e9255540..5b8f0b68 100644 --- a/src/net/buysellhandler.cpp +++ b/src/net/buysellhandler.cpp @@ -78,10 +78,10 @@ void BuySellHandler::handleMessage(MessageIn *msg) for (int k = 0; k < n_items; k++) { - Sint32 value = msg->readInt32(); + int value = msg->readInt32(); msg->readInt32(); // DCvalue msg->readInt8(); // type - Sint16 itemId = msg->readInt16(); + int itemId = msg->readInt16(); buyDialog->addItem(itemId, value); } break; @@ -97,8 +97,8 @@ void BuySellHandler::handleMessage(MessageIn *msg) for (int k = 0; k < n_items; k++) { - Sint16 index = msg->readInt16(); - Sint32 value = msg->readInt32(); + int index = msg->readInt16(); + int value = msg->readInt32(); msg->readInt32(); // OCvalue Item *item = player_node->getInventory()->getItem(index); diff --git a/src/net/chathandler.cpp b/src/net/chathandler.cpp index 6717f515..185ce7d8 100644 --- a/src/net/chathandler.cpp +++ b/src/net/chathandler.cpp @@ -61,7 +61,7 @@ void ChatHandler::handleMessage(MessageIn *msg) Being *being; std::string chatMsg; std::string nick; - Sint16 chatMsgLength; + int chatMsgLength; switch (msg->getId()) { diff --git a/src/net/equipmenthandler.cpp b/src/net/equipmenthandler.cpp index fe158198..9a6f424e 100644 --- a/src/net/equipmenthandler.cpp +++ b/src/net/equipmenthandler.cpp @@ -49,9 +49,9 @@ EquipmentHandler::EquipmentHandler() void EquipmentHandler::handleMessage(MessageIn *msg) { - Sint32 itemCount; - Sint16 index, equipPoint, itemId; - Sint8 type; + int itemCount; + int index, equipPoint, itemId; + int type; int mask, position; Item *item; Inventory *inventory = player_node->getInventory(); diff --git a/src/net/inventoryhandler.cpp b/src/net/inventoryhandler.cpp index be128609..b0511080 100644 --- a/src/net/inventoryhandler.cpp +++ b/src/net/inventoryhandler.cpp @@ -62,9 +62,9 @@ InventoryHandler::InventoryHandler() void InventoryHandler::handleMessage(MessageIn *msg) { - Sint32 number; - Sint16 index, amount, itemId, equipType, arrow; - Sint16 identified, cards[4], itemType; + int number; + int index, amount, itemId, equipType, arrow; + int identified, cards[4], itemType; Inventory *inventory = player_node->getInventory(); Inventory *storage = player_node->getStorage(); diff --git a/src/net/itemhandler.cpp b/src/net/itemhandler.cpp index e38be454..d9d84248 100644 --- a/src/net/itemhandler.cpp +++ b/src/net/itemhandler.cpp @@ -42,7 +42,7 @@ void ItemHandler::handleMessage(MessageIn *msg) { Uint32 id; Uint16 x, y; - Sint16 itemId; + int itemId; switch (msg->getId()) { diff --git a/src/net/npchandler.cpp b/src/net/npchandler.cpp index 1067a57e..1161bc36 100644 --- a/src/net/npchandler.cpp +++ b/src/net/npchandler.cpp @@ -51,7 +51,7 @@ NPCHandler::NPCHandler() void NPCHandler::handleMessage(MessageIn *msg) { - Uint32 id; + int id; switch (msg->getId()) { diff --git a/src/net/playerhandler.cpp b/src/net/playerhandler.cpp index ffeb3fab..232cf075 100644 --- a/src/net/playerhandler.cpp +++ b/src/net/playerhandler.cpp @@ -166,8 +166,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); } @@ -175,7 +175,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) @@ -303,10 +303,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; @@ -327,9 +327,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; @@ -406,7 +406,7 @@ void PlayerHandler::handleMessage(MessageIn *msg) case SMSG_PLAYER_ARROW_MESSAGE: { - Sint16 type = msg->readInt16(); + int type = msg->readInt16(); switch (type) { case 0: diff --git a/src/net/skillhandler.cpp b/src/net/skillhandler.cpp index 8ef37101..be757d7c 100644 --- a/src/net/skillhandler.cpp +++ b/src/net/skillhandler.cpp @@ -52,14 +52,14 @@ void SkillHandler::handleMessage(MessageIn *msg) for (int k = 0; k < skillCount; k++) { - Sint16 skillId = msg->readInt16(); + int skillId = msg->readInt16(); msg->readInt16(); // target type msg->readInt16(); // unknown - Sint16 level = msg->readInt16(); - Sint16 sp = msg->readInt16(); + int level = msg->readInt16(); + int sp = msg->readInt16(); msg->readInt16(); // range std::string skillName = msg->readString(24); - Sint8 up = msg->readInt8(); + int up = msg->readInt8(); if (level != 0 || up != 0) { diff --git a/src/net/tradehandler.cpp b/src/net/tradehandler.cpp index 98f26cbd..fd772d01 100644 --- a/src/net/tradehandler.cpp +++ b/src/net/tradehandler.cpp @@ -141,8 +141,8 @@ void TradeHandler::handleMessage(MessageIn *msg) case SMSG_TRADE_ITEM_ADD: { - Sint32 amount = msg->readInt32(); - Sint16 type = msg->readInt16(); + int amount = msg->readInt32(); + int type = msg->readInt16(); msg->readInt8(); // identified flag msg->readInt8(); // attribute msg->readInt8(); // refine @@ -167,7 +167,7 @@ void TradeHandler::handleMessage(MessageIn *msg) tradeWindow->receivedOk(true); return; } - Sint16 quantity = msg->readInt16(); + int quantity = msg->readInt16(); switch (msg->readInt8()) { |