From 3ed2e647a7ec634a91a32e7ac493c9f2b6d693b0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 26 Sep 2014 23:25:32 +0300 Subject: Fix code style. --- src/net/eathena/auctionhandler.cpp | 7 ------- src/net/eathena/auctionhandler.h | 2 -- src/net/eathena/bankhandler.cpp | 4 ---- src/net/eathena/bankhandler.h | 2 -- src/net/eathena/buyingstorehandler.cpp | 5 ----- src/net/eathena/buyingstorehandler.h | 2 -- src/net/eathena/cashshophandler.cpp | 7 ------- src/net/eathena/cashshophandler.h | 2 -- src/net/eathena/charserverhandler.cpp | 3 --- src/net/eathena/chathandler.cpp | 2 -- src/net/eathena/familyhandler.cpp | 4 ---- src/net/eathena/familyhandler.h | 2 -- src/net/eathena/gamehandler.cpp | 2 -- src/net/eathena/guildhandler.cpp | 2 +- src/net/eathena/homunculushandler.cpp | 9 ++++----- src/net/eathena/homunculushandler.h | 2 -- src/net/eathena/inventoryhandler.cpp | 1 - src/net/eathena/loginhandler.cpp | 1 - src/net/eathena/mailhandler.cpp | 6 +++--- src/net/eathena/menutype.h | 2 +- src/net/eathena/mercenaryhandler.cpp | 9 ++++----- src/net/eathena/mercenaryhandler.h | 2 -- src/net/eathena/messagein.cpp | 2 -- src/net/eathena/network.cpp | 1 - src/net/eathena/partyhandler.cpp | 2 +- src/net/eathena/pethandler.cpp | 2 +- src/net/eathena/playerhandler.cpp | 2 -- src/net/eathena/questhandler.cpp | 2 +- src/net/eathena/skillhandler.cpp | 4 ++-- 29 files changed, 18 insertions(+), 75 deletions(-) (limited to 'src/net/eathena') diff --git a/src/net/eathena/auctionhandler.cpp b/src/net/eathena/auctionhandler.cpp index bf544f822..343ce08c3 100644 --- a/src/net/eathena/auctionhandler.cpp +++ b/src/net/eathena/auctionhandler.cpp @@ -20,13 +20,6 @@ #include "net/eathena/auctionhandler.h" -#include "logger.h" - -#include "net/ea/eaprotocol.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocol.h" - #include "debug.h" extern Net::AuctionHandler *auctionHandler; diff --git a/src/net/eathena/auctionhandler.h b/src/net/eathena/auctionhandler.h index e4a20d77a..b7e797cc6 100644 --- a/src/net/eathena/auctionhandler.h +++ b/src/net/eathena/auctionhandler.h @@ -27,8 +27,6 @@ namespace EAthena { -class MessageOut; - class AuctionHandler final : public MessageHandler, public Net::AuctionHandler { public: diff --git a/src/net/eathena/bankhandler.cpp b/src/net/eathena/bankhandler.cpp index 352aca54e..79562c515 100644 --- a/src/net/eathena/bankhandler.cpp +++ b/src/net/eathena/bankhandler.cpp @@ -20,10 +20,6 @@ #include "net/eathena/bankhandler.h" -#include "logger.h" - -#include "net/ea/eaprotocol.h" - #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" diff --git a/src/net/eathena/bankhandler.h b/src/net/eathena/bankhandler.h index 025b5209c..2957caf9c 100644 --- a/src/net/eathena/bankhandler.h +++ b/src/net/eathena/bankhandler.h @@ -27,8 +27,6 @@ namespace EAthena { -class MessageOut; - class BankHandler final : public MessageHandler, public Net::BankHandler { diff --git a/src/net/eathena/buyingstorehandler.cpp b/src/net/eathena/buyingstorehandler.cpp index 346f81b07..6206ead4e 100644 --- a/src/net/eathena/buyingstorehandler.cpp +++ b/src/net/eathena/buyingstorehandler.cpp @@ -20,11 +20,6 @@ #include "net/eathena/buyingstorehandler.h" -#include "logger.h" - -#include "net/ea/eaprotocol.h" - -#include "net/eathena/messageout.h" #include "net/eathena/protocol.h" #include "debug.h" diff --git a/src/net/eathena/buyingstorehandler.h b/src/net/eathena/buyingstorehandler.h index 2b64adf64..3887c77cb 100644 --- a/src/net/eathena/buyingstorehandler.h +++ b/src/net/eathena/buyingstorehandler.h @@ -27,8 +27,6 @@ namespace EAthena { -class MessageOut; - class BuyingStoreHandler final : public MessageHandler, public Net::BuyingStoreHandler { diff --git a/src/net/eathena/cashshophandler.cpp b/src/net/eathena/cashshophandler.cpp index 6c2273d3a..5e105babe 100644 --- a/src/net/eathena/cashshophandler.cpp +++ b/src/net/eathena/cashshophandler.cpp @@ -20,13 +20,6 @@ #include "net/eathena/cashshophandler.h" -#include "logger.h" - -#include "net/ea/eaprotocol.h" - -#include "net/eathena/messageout.h" -#include "net/eathena/protocol.h" - #include "debug.h" extern Net::CashShopHandler *cashShopHandler; diff --git a/src/net/eathena/cashshophandler.h b/src/net/eathena/cashshophandler.h index 7a6f354a8..4b16d99d5 100644 --- a/src/net/eathena/cashshophandler.h +++ b/src/net/eathena/cashshophandler.h @@ -27,8 +27,6 @@ namespace EAthena { -class MessageOut; - class CashShopHandler final : public MessageHandler, public Net::CashShopHandler { diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index d0c0247ca..35d64e70f 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -32,7 +32,6 @@ #include "net/character.h" #include "net/logindata.h" -#include "net/net.h" #include "net/eathena/attrs.h" #include "net/eathena/gamehandler.h" @@ -44,11 +43,9 @@ #include "resources/iteminfo.h" -#include "resources/db/chardb.h" #include "resources/db/itemdb.h" #include "utils/dtor.h" -#include "utils/gettext.h" #include "debug.h" diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index 758bd37d4..cff13879f 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -28,8 +28,6 @@ #include "gui/chatconsts.h" -#include "gui/widgets/tabs/chattab.h" - #include "gui/windows/chatwindow.h" #include "net/mercenaryhandler.h" diff --git a/src/net/eathena/familyhandler.cpp b/src/net/eathena/familyhandler.cpp index 543870328..b222977ff 100644 --- a/src/net/eathena/familyhandler.cpp +++ b/src/net/eathena/familyhandler.cpp @@ -20,12 +20,8 @@ #include "net/eathena/familyhandler.h" -#include "logger.h" - #include "being/being.h" -#include "net/ea/eaprotocol.h" - #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" diff --git a/src/net/eathena/familyhandler.h b/src/net/eathena/familyhandler.h index 5d3062e22..365a129ba 100644 --- a/src/net/eathena/familyhandler.h +++ b/src/net/eathena/familyhandler.h @@ -27,8 +27,6 @@ namespace EAthena { -class MessageOut; - class FamilyHandler final : public MessageHandler, public Net::FamilyHandler { diff --git a/src/net/eathena/gamehandler.cpp b/src/net/eathena/gamehandler.cpp index d8f3f5c0e..d1ff0f955 100644 --- a/src/net/eathena/gamehandler.cpp +++ b/src/net/eathena/gamehandler.cpp @@ -26,8 +26,6 @@ #include "being/localplayer.h" -#include "net/net.h" - #include "net/eathena/loginhandler.h" #include "net/eathena/messageout.h" #include "net/eathena/network.h" diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp index 10fba3be8..5508b13d9 100644 --- a/src/net/eathena/guildhandler.cpp +++ b/src/net/eathena/guildhandler.cpp @@ -200,7 +200,7 @@ void GuildHandler::create(const std::string &name) const } void GuildHandler::invite(const int guildId A_UNUSED, - const std::string &name A_UNUSED) const + const std::string &name) const { if (!actorManager) return; diff --git a/src/net/eathena/homunculushandler.cpp b/src/net/eathena/homunculushandler.cpp index f96ad006b..948da91f2 100644 --- a/src/net/eathena/homunculushandler.cpp +++ b/src/net/eathena/homunculushandler.cpp @@ -21,7 +21,6 @@ #include "net/eathena/homunculushandler.h" #include "actormanager.h" -#include "logger.h" #include "notifymanager.h" #include "being/homunculusinfo.h" @@ -29,8 +28,6 @@ #include "gui/windows/skilldialog.h" -#include "net/ea/eaprotocol.h" - #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" @@ -258,7 +255,9 @@ void HomunculusHandler::move(const int x, const int y) const return; createOutPacket(CMSG_HOMMERC_MOVE_TO); outMsg.writeInt32(id); - outMsg.writeCoordinates(x, y, 0U); + outMsg.writeCoordinates(static_cast(x), + static_cast(y), + 0U); } void HomunculusHandler::attack(const int targetId, const bool keep) const @@ -269,7 +268,7 @@ void HomunculusHandler::attack(const int targetId, const bool keep) const createOutPacket(CMSG_HOMMERC_ATTACK); outMsg.writeInt32(id); outMsg.writeInt32(targetId); - outMsg.writeInt8(keep ? 1 : 0); + outMsg.writeInt8(static_cast(keep ? 1 : 0)); } void HomunculusHandler::feed() const diff --git a/src/net/eathena/homunculushandler.h b/src/net/eathena/homunculushandler.h index 94e3807f0..08acc9e94 100644 --- a/src/net/eathena/homunculushandler.h +++ b/src/net/eathena/homunculushandler.h @@ -27,8 +27,6 @@ namespace EAthena { -class MessageOut; - class HomunculusHandler final : public MessageHandler, public Net::HomunculusHandler { diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index c028a472e..f0b0d7a1d 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -29,7 +29,6 @@ #include "listeners/arrowslistener.h" -#include "net/net.h" #include "net/serverfeatures.h" #include "net/eathena/menu.h" diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp index b5f2ed07d..f25b9a29c 100644 --- a/src/net/eathena/loginhandler.cpp +++ b/src/net/eathena/loginhandler.cpp @@ -32,7 +32,6 @@ #include "net/eathena/protocol.h" #include "utils/gettext.h" -#include "utils/paths.h" #include "debug.h" diff --git a/src/net/eathena/mailhandler.cpp b/src/net/eathena/mailhandler.cpp index 00fa5fac5..24eb24a66 100644 --- a/src/net/eathena/mailhandler.cpp +++ b/src/net/eathena/mailhandler.cpp @@ -71,7 +71,7 @@ void MailHandler::processMailOpen(Net::MessageIn &msg) const break; default: - logger->log("unknown mail window open flag: %u", flag); + logger->log("unknown mail window open flag: %d", flag); break; } } @@ -128,10 +128,10 @@ void MailHandler::send(const std::string &name, const int sz = static_cast(message.size()); createOutPacket(CMSG_MAIL_SEND); - outMsg.writeInt16(69 + sz); + outMsg.writeInt16(static_cast(69 + sz)); outMsg.writeString(name, 24, "name"); outMsg.writeString(title, 40, "title"); - outMsg.writeInt8(sz); + outMsg.writeInt8(static_cast(sz)); outMsg.writeString(message, sz, "message"); } diff --git a/src/net/eathena/menutype.h b/src/net/eathena/menutype.h index 5ca671e1d..1481642fd 100644 --- a/src/net/eathena/menutype.h +++ b/src/net/eathena/menutype.h @@ -43,7 +43,7 @@ namespace EAthena RepairWespon, Teleport, Warp, - WeaponeRefine, + WeaponeRefine }; } // namespace MenuType } // namespace EAthena diff --git a/src/net/eathena/mercenaryhandler.cpp b/src/net/eathena/mercenaryhandler.cpp index 6ac4072c5..aa6152035 100644 --- a/src/net/eathena/mercenaryhandler.cpp +++ b/src/net/eathena/mercenaryhandler.cpp @@ -21,7 +21,6 @@ #include "net/eathena/mercenaryhandler.h" #include "actormanager.h" -#include "logger.h" #include "notifymanager.h" #include "being/being.h" @@ -31,8 +30,6 @@ #include "gui/windows/skilldialog.h" -#include "net/ea/eaprotocol.h" - #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" @@ -202,7 +199,9 @@ void MercenaryHandler::move(const int x, const int y) const return; createOutPacket(CMSG_HOMMERC_MOVE_TO); outMsg.writeInt32(id); - outMsg.writeCoordinates(x, y, 0U); + outMsg.writeCoordinates(static_cast(x), + static_cast(y), + 0U); } void MercenaryHandler::attack(const int targetId, const bool keep) const @@ -213,7 +212,7 @@ void MercenaryHandler::attack(const int targetId, const bool keep) const createOutPacket(CMSG_HOMMERC_ATTACK); outMsg.writeInt32(id); outMsg.writeInt32(targetId); - outMsg.writeInt8(keep ? 1 : 0); + outMsg.writeInt8(static_cast(keep ? 1 : 0)); } } // namespace EAthena diff --git a/src/net/eathena/mercenaryhandler.h b/src/net/eathena/mercenaryhandler.h index 6ef3c02f5..695bb35a7 100644 --- a/src/net/eathena/mercenaryhandler.h +++ b/src/net/eathena/mercenaryhandler.h @@ -27,8 +27,6 @@ namespace EAthena { -class MessageOut; - class MercenaryHandler final : public MessageHandler, public Net::MercenaryHandler { diff --git a/src/net/eathena/messagein.cpp b/src/net/eathena/messagein.cpp index f0715e5cb..fd406a79a 100644 --- a/src/net/eathena/messagein.cpp +++ b/src/net/eathena/messagein.cpp @@ -27,8 +27,6 @@ #include "logger.h" -#include "utils/stringutils.h" - #include #include "debug.h" diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp index 78ff3377e..ff4bfce14 100644 --- a/src/net/eathena/network.cpp +++ b/src/net/eathena/network.cpp @@ -27,7 +27,6 @@ #include "net/eathena/messagehandler.h" #include "net/eathena/messagein.h" #include "net/eathena/packets.h" -#include "net/eathena/protocol.h" #include "utils/delete2.h" diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp index d90b82248..d63aa69cc 100644 --- a/src/net/eathena/partyhandler.cpp +++ b/src/net/eathena/partyhandler.cpp @@ -459,7 +459,7 @@ void PartyHandler::changeLeader(const std::string &name) const void PartyHandler::allowInvite(const bool allow) const { createOutPacket(CMSG_PARTY_ALLOW_INVITES); - outMsg.writeInt8(allow ? 1 : 0); + outMsg.writeInt8(static_cast(allow ? 1 : 0)); } } // namespace EAthena diff --git a/src/net/eathena/pethandler.cpp b/src/net/eathena/pethandler.cpp index 00dc27c07..50fd3d53c 100644 --- a/src/net/eathena/pethandler.cpp +++ b/src/net/eathena/pethandler.cpp @@ -35,7 +35,6 @@ #include "gui/widgets/tabs/chattab.h" #include "net/chathandler.h" -#include "net/net.h" #include "net/ea/eaprotocol.h" @@ -268,6 +267,7 @@ void PetHandler::processPetStatus(Net::MessageIn &msg) PetInfo *const info = PlayerInfo::getPet(); if (!info) return; + info->name = name; info->level = level; info->hungry = hungry; info->intimacy = intimacy; diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index 209284504..3a4f46a2c 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -27,8 +27,6 @@ #include "gui/windows/statuswindow.h" -#include "net/net.h" - #include "net/eathena/attrs.h" #include "net/eathena/messageout.h" #include "net/eathena/protocol.h" diff --git a/src/net/eathena/questhandler.cpp b/src/net/eathena/questhandler.cpp index 87a84d5ee..dcdf726f2 100644 --- a/src/net/eathena/questhandler.cpp +++ b/src/net/eathena/questhandler.cpp @@ -187,7 +187,7 @@ void QuestHandler::setQeustActiveState(const int questId, { createOutPacket(CMSG_QUEST_ACTIVATE); outMsg.writeInt32(questId, "quest id"); - outMsg.writeInt8(active ? 1 : 0, "activate"); + outMsg.writeInt8(static_cast(active ? 1 : 0), "activate"); } } // namespace EAthena diff --git a/src/net/eathena/skillhandler.cpp b/src/net/eathena/skillhandler.cpp index e4e6c8101..b6e2b2cd2 100644 --- a/src/net/eathena/skillhandler.cpp +++ b/src/net/eathena/skillhandler.cpp @@ -202,8 +202,8 @@ void SkillHandler::processSkillFailed(Net::MessageIn &msg) { // Action failed (ex. sit because you have not reached the // right level) - const int skillId = msg.readInt16("skill id"); - const int16_t bskill = msg.readInt32("btype"); + const int skillId = msg.readInt16("skill id"); + const int bskill = msg.readInt32("btype"); const signed char success = msg.readUInt8("success"); const signed char reason = msg.readUInt8("reason"); if (success != static_cast(SKILL_FAILED) -- cgit v1.2.3-60-g2f50