diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
commit | 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch) | |
tree | 798117abd4dc7e610997d59d530a96ddc1509f53 /src/net/eathena/mailhandler.cpp | |
parent | 4429cb14e9e187edef27aba692a4266733f79c17 (diff) | |
download | plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2 plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip |
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/net/eathena/mailhandler.cpp')
-rw-r--r-- | src/net/eathena/mailhandler.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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<int16_t>(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<int16_t>(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<int16_t>(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<int>(message.size()); + const int sz = CAST_S32(message.size()); createOutPacket(CMSG_MAIL_SEND); - outMsg.writeInt16(static_cast<int16_t>(69 + sz), "len"); + outMsg.writeInt16(CAST_S16(69 + sz), "len"); outMsg.writeString(name, 24, "name"); outMsg.writeString(title, 40, "title"); - outMsg.writeInt8(static_cast<int8_t>(sz), "message size"); + outMsg.writeInt8(CAST_S8(sz), "message size"); outMsg.writeString(message, sz, "message"); } |