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/mailhandler.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/net/eathena/mailhandler.cpp') diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp index d1ab80005..7bcc53088 100644 --- a/src/net/eathena/mailhandler.cpp +++ b/src/net/eathena/mailhandler.cpp @@ -70,21 +70,21 @@ void MailHandler::returnMessage(const int msgId) const void MailHandler::setAttach(const int index, const int amount) const { createOutPacket(CMSG_MAIL_SET_ATTACH); - outMsg.writeInt16(static_cast(index + INVENTORY_OFFSET), "index"); + outMsg.writeInt16(CAST_S16(index + INVENTORY_OFFSET), "index"); outMsg.writeInt32(amount, "amount"); } void MailHandler::setAttachMoney(const int money) const { createOutPacket(CMSG_MAIL_SET_ATTACH); - outMsg.writeInt16(static_cast(0), "index"); + outMsg.writeInt16(CAST_S16(0), "index"); outMsg.writeInt32(money, "money"); } void MailHandler::resetAttach(const int flag) const { createOutPacket(CMSG_MAIL_RESET_ATTACH); - outMsg.writeInt16(static_cast(flag), "flag"); + outMsg.writeInt16(CAST_S16(flag), "flag"); } void MailHandler::send(const std::string &name, @@ -93,13 +93,13 @@ void MailHandler::send(const std::string &name, { if (message.size() > 255) message = message.substr(0, 255); - const int sz = static_cast(message.size()); + const int sz = CAST_S32(message.size()); createOutPacket(CMSG_MAIL_SEND); - outMsg.writeInt16(static_cast(69 + sz), "len"); + outMsg.writeInt16(CAST_S16(69 + sz), "len"); outMsg.writeString(name, 24, "name"); outMsg.writeString(title, 40, "title"); - outMsg.writeInt8(static_cast(sz), "message size"); + outMsg.writeInt8(CAST_S8(sz), "message size"); outMsg.writeString(message, sz, "message"); } -- cgit v1.2.3-60-g2f50