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/charserverhandler.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/net/eathena/charserverhandler.cpp') diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index 37e2e72ea..ce84840ca 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -66,7 +66,7 @@ void CharServerHandler::chooseCharacter(Net::Character *const character) mCharSelectDialog = nullptr; createOutPacket(CMSG_CHAR_SELECT); - outMsg.writeInt8(static_cast( + outMsg.writeInt8(CAST_U8( mSelectedCharacter->slot), "slot"); } @@ -81,11 +81,11 @@ void CharServerHandler::newCharacter(const std::string &name, const int slot, createOutPacket(CMSG_CHAR_CREATE); outMsg.writeString(name, 24, "login"); - outMsg.writeInt8(static_cast(slot), "slot"); - outMsg.writeInt16(static_cast(hairColor), "hair color"); - outMsg.writeInt16(static_cast(hairstyle), "hair style"); + outMsg.writeInt8(CAST_U8(slot), "slot"); + outMsg.writeInt16(CAST_S16(hairColor), "hair color"); + outMsg.writeInt16(CAST_S16(hairstyle), "hair style"); if (serverFeatures->haveRaceSelection()) - outMsg.writeInt16(static_cast(race), "race"); + outMsg.writeInt16(CAST_S16(race), "race"); if (serverFeatures->haveCreateCharGender()) { uint8_t sex = 0; @@ -96,7 +96,7 @@ void CharServerHandler::newCharacter(const std::string &name, const int slot, outMsg.writeInt8(sex, "gender"); } if (serverFeatures->haveLookSelection()) - outMsg.writeInt16(static_cast(look), "look"); + outMsg.writeInt16(CAST_S16(look), "look"); } void CharServerHandler::deleteCharacter(Net::Character *const character, @@ -180,8 +180,8 @@ void CharServerHandler::renameCharacter(const BeingId id, void CharServerHandler::changeSlot(const int oldSlot, const int newSlot) { createOutPacket(CMSG_CHAR_CHANGE_SLOT); - outMsg.writeInt16(static_cast(oldSlot), "old slot"); - outMsg.writeInt16(static_cast(newSlot), "new slot"); + outMsg.writeInt16(CAST_S16(oldSlot), "old slot"); + outMsg.writeInt16(CAST_S16(newSlot), "new slot"); outMsg.writeInt16(0, "unused"); } -- cgit v1.2.3-60-g2f50