From 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Feb 2016 16:18:13 +0300 Subject: Replace most static_cast to shorter versions from defines. --- src/net/eathena/markethandler.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/net/eathena/markethandler.cpp') diff --git a/src/net/eathena/markethandler.cpp b/src/net/eathena/markethandler.cpp index de0e31345..b055d574a 100644 --- a/src/net/eathena/markethandler.cpp +++ b/src/net/eathena/markethandler.cpp @@ -56,11 +56,11 @@ void MarketHandler::buyItem(const int itemId, cnt = 100; createOutPacket(CMSG_NPC_MARKET_BUY); - outMsg.writeInt16(static_cast(4 + 6 * cnt), "len"); + outMsg.writeInt16(CAST_S16(4 + 6 * cnt), "len"); for (int f = 0; f < cnt; f ++) { - outMsg.writeInt16(static_cast(itemId), "item id"); - outMsg.writeInt32(static_cast(amount2), "amount"); + outMsg.writeInt16(CAST_S16(itemId), "item id"); + outMsg.writeInt32(CAST_S16(amount2), "amount"); } } @@ -86,7 +86,7 @@ void MarketHandler::buyItems(std::vector &items) const return; createOutPacket(CMSG_NPC_MARKET_BUY); - outMsg.writeInt16(static_cast(4 + pairSize * cnt), "len"); + outMsg.writeInt16(CAST_S16(4 + pairSize * cnt), "len"); FOR_EACH (std::vector::iterator, it, items) { ShopItem *const item = *it; @@ -101,15 +101,15 @@ void MarketHandler::buyItems(std::vector &items) const { for (int f = 0; f < usedQuantity; f ++) { - outMsg.writeInt16(static_cast(item->getId()), + outMsg.writeInt16(CAST_S16(item->getId()), "item id"); - outMsg.writeInt32(static_cast(1), "amount"); + outMsg.writeInt32(CAST_S16(1), "amount"); } } else { - outMsg.writeInt16(static_cast(item->getId()), "item id"); - outMsg.writeInt32(static_cast(usedQuantity), "amount"); + outMsg.writeInt16(CAST_S16(item->getId()), "item id"); + outMsg.writeInt32(CAST_S16(usedQuantity), "amount"); } } } -- cgit v1.2.3-70-g09d2