From f96919885dd0e5ae0de4a8517e76419304ca8d36 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 20 Jun 2015 00:15:42 +0300 Subject: Fix code style. --- src/being/being.cpp | 2 +- src/being/being.h | 2 +- src/being/localplayer.cpp | 2 -- src/being/playerrelations.h | 3 ++- src/gui/widgets/tabs/setup_colors.cpp | 3 ++- src/net/ea/inventoryhandler.cpp | 1 + src/net/ea/inventoryhandler.h | 5 ++++- src/net/ea/loginhandler.cpp | 2 ++ src/net/ea/loginhandler.h | 4 ++-- src/net/eathena/charserverhandler.cpp | 2 ++ src/net/eathena/gamehandler.cpp | 2 ++ src/net/eathena/inventoryhandler.cpp | 3 +++ src/net/eathena/network.cpp | 2 +- src/net/eathena/playerhandler.cpp | 1 + src/net/tmwa/beinghandler.cpp | 2 +- src/net/tmwa/charserverhandler.cpp | 2 ++ src/net/tmwa/gamehandler.cpp | 2 ++ src/net/tmwa/inventoryhandler.cpp | 4 ++++ src/net/tmwa/network.cpp | 2 +- src/net/tmwa/playerhandler.cpp | 1 + src/net/tmwa/tradehandler.cpp | 7 ++----- src/utils/delete2.h | 6 ++++++ 22 files changed, 43 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/being/being.cpp b/src/being/being.cpp index 7688a300d..27544496d 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2130,7 +2130,7 @@ void Being::updateColors() } else if (player_relations.getRelation(mName) == Relation::IGNORED || - player_relations.getRelation(mName)== Relation::ENEMY2) + player_relations.getRelation(mName) == Relation::ENEMY2) { mNameColor = &userPalette->getColor(UserColorId::IGNORED); } diff --git a/src/being/being.h b/src/being/being.h index 521a554cf..e957228c2 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -1075,7 +1075,7 @@ class Being notfinal : public ActorSprite, int mHP; int mMaxHP; int mDistance; - ReachableT mReachable; /**< 0 - unknown, 1 - reachable, 2 - not reachable*/ + ReachableT mReachable; int mGoodStatus; static int mUpdateConfigTime; diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 52201e7fb..1e75865a6 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -46,7 +46,6 @@ #include "input/keyboardconfig.h" -#include "gui/chatconsts.h" #include "gui/gui.h" #include "gui/userpalette.h" #include "gui/popupmanager.h" @@ -60,7 +59,6 @@ #include "gui/windows/statuswindow.h" #include "gui/windows/updaterwindow.h" -#include "gui/widgets/tabs/chat/gmtab.h" #include "gui/widgets/tabs/chat/whispertab.h" #include "net/beinghandler.h" diff --git a/src/being/playerrelations.h b/src/being/playerrelations.h index 62244c5ea..7ead62777 100644 --- a/src/being/playerrelations.h +++ b/src/being/playerrelations.h @@ -34,9 +34,10 @@ class Being; class PlayerIgnoreStrategy; -class PlayerRelation; class PlayerRelationsListener; +struct PlayerRelation; + /** * Player relations class, represents any particular relations and/or * preferences the user of the local client has wrt other players (identified diff --git a/src/gui/widgets/tabs/setup_colors.cpp b/src/gui/widgets/tabs/setup_colors.cpp index 2ae5db874..7ba177f98 100644 --- a/src/gui/widgets/tabs/setup_colors.cpp +++ b/src/gui/widgets/tabs/setup_colors.cpp @@ -252,7 +252,8 @@ void Setup_Colors::valueChanged(const SelectionEvent &event A_UNUSED) const Color *col = &userPalette->getColor(type); const GradientTypeT grad = userPalette->getGradientType(type); const int delay = userPalette->getGradientDelay(type); - const Visible showControls = fromBool(grad != GradientType::LABEL, Visible); + const Visible showControls = fromBool(grad != GradientType::LABEL, + Visible); mPreview->setVisible(showControls); mPreviewBox->setVisible(showControls); mTextPreview->setVisible(showControls); diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index 44b73928f..2a9d56ae2 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -33,6 +33,7 @@ #include "net/messagein.h" #include "net/ea/eaprotocol.h" +#include "net/ea/equipbackend.h" #include "utils/delete2.h" diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h index 6050baaff..fa2f2d0b2 100644 --- a/src/net/ea/inventoryhandler.h +++ b/src/net/ea/inventoryhandler.h @@ -25,9 +25,10 @@ #include "localconsts.h" +#include "enums/simpletypes/beingid.h" + #include "net/inventoryhandler.h" -#include "net/ea/equipbackend.h" #include "net/ea/inventoryitem.h" #include @@ -40,6 +41,8 @@ namespace Net namespace Ea { +class EquipBackend; + typedef std::vector InventoryItems; typedef std::queue PickupQueue; diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index 396eb1480..0ad5a91af 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -37,6 +37,8 @@ #include "net/logindata.h" #include "net/messagein.h" +#include "net/ea/token.h" + #include "debug.h" namespace Ea diff --git a/src/net/ea/loginhandler.h b/src/net/ea/loginhandler.h index 1dbf97b1c..9bb41ec18 100644 --- a/src/net/ea/loginhandler.h +++ b/src/net/ea/loginhandler.h @@ -27,10 +27,10 @@ #include "net/registrationoptions.h" -#include "net/ea/token.h" - class LoginData; +struct Token; + namespace Net { class MessageIn; diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index 58e302c8a..a898d3162 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -36,6 +36,8 @@ #include "net/playerhandler.h" #include "net/serverfeatures.h" +#include "net/ea/token.h" + #include "net/eathena/gamehandler.h" #include "net/eathena/loginhandler.h" #include "net/eathena/messageout.h" diff --git a/src/net/eathena/gamehandler.cpp b/src/net/eathena/gamehandler.cpp index 4902b959f..ea8342ae3 100644 --- a/src/net/eathena/gamehandler.cpp +++ b/src/net/eathena/gamehandler.cpp @@ -29,6 +29,8 @@ #include "net/serverfeatures.h" +#include "net/ea/token.h" + #include "net/eathena/loginhandler.h" #include "net/eathena/messageout.h" #include "net/eathena/network.h" diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 54204234e..8406575bd 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -22,11 +22,13 @@ #include "net/eathena/inventoryhandler.h" +#include "item.h" #include "notifymanager.h" #include "enums/equipslot.h" #include "being/localplayer.h" +#include "being/playerinfo.h" #include "listeners/arrowslistener.h" @@ -36,6 +38,7 @@ #include "net/eathena/protocol.h" #include "net/ea/eaprotocol.h" +#include "net/ea/equipbackend.h" #include "resources/notifytypes.h" diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp index 1eed8b439..80f0f579b 100644 --- a/src/net/eathena/network.cpp +++ b/src/net/eathena/network.cpp @@ -52,7 +52,7 @@ Network::Network() : Network::~Network() { clearHandlers(); - delete2(mMessageHandlers); + delete2Arr(mMessageHandlers); mInstance = nullptr; } diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index 83f0a44b6..b7f83ead1 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -23,6 +23,7 @@ #include "net/eathena/playerhandler.h" #include "being/localplayer.h" +#include "being/playerinfo.h" #include "gui/windows/statuswindow.h" diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index 80fda81be..8f482047f 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -1624,7 +1624,7 @@ void BeingHandler::processPvpSet(Net::MessageIn &msg) if (dstBeing) { dstBeing->setPvpRank(rank); - dstBeing->setTeamId(teamId); + dstBeing->setTeamId(static_cast(teamId)); dstBeing->addToCache(); } } diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index 859be0bed..959e51289 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -34,6 +34,8 @@ #include "net/character.h" #include "net/serverfeatures.h" +#include "net/ea/token.h" + #include "net/tmwa/gamehandler.h" #include "net/tmwa/loginhandler.h" #include "net/tmwa/messageout.h" diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index f1d7cd748..75fffc77a 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -27,6 +27,8 @@ #include "being/localplayer.h" +#include "net/ea/token.h" + #include "net/tmwa/loginhandler.h" #include "net/tmwa/messageout.h" #include "net/tmwa/network.h" diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index 7f81ac461..40bb9a70f 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -22,11 +22,14 @@ #include "net/tmwa/inventoryhandler.h" +#include "item.h" + #include "notifymanager.h" #include "enums/equipslot.h" #include "being/localplayer.h" +#include "being/playerinfo.h" #include "listeners/arrowslistener.h" @@ -36,6 +39,7 @@ #include "net/tmwa/protocol.h" #include "net/ea/eaprotocol.h" +#include "net/ea/equipbackend.h" #include "resources/notifytypes.h" diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index edaabcc4d..28760d2cc 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -52,7 +52,7 @@ Network::Network() : Network::~Network() { clearHandlers(); - delete2(mMessageHandlers); + delete2Arr(mMessageHandlers); mInstance = nullptr; } diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 8707c5212..6e638687a 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -23,6 +23,7 @@ #include "net/tmwa/playerhandler.h" #include "being/localplayer.h" +#include "being/playerinfo.h" #include "gui/windows/statuswindow.h" diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp index f43c5b266..e48536874 100644 --- a/src/net/tmwa/tradehandler.cpp +++ b/src/net/tmwa/tradehandler.cpp @@ -30,7 +30,6 @@ #include "being/playerrelation.h" #include "being/playerrelations.h" -#include "gui/windows/confirmdialog.h" #include "gui/windows/tradewindow.h" #include "net/serverfeatures.h" @@ -49,7 +48,6 @@ extern Net::TradeHandler *tradeHandler; extern std::string tradePartnerName; -extern ConfirmDialog *confirmDlg; namespace TmwAthena { @@ -277,9 +275,8 @@ void TradeHandler::processTradeItemAddResponse(Net::MessageIn &msg) void TradeHandler::processTradeResponse(Net::MessageIn &msg) { - if (confirmDlg || tradePartnerName.empty() - || !player_relations.hasPermission(tradePartnerName, - PlayerRelation::TRADE)) + if (tradePartnerName.empty() || + !player_relations.hasPermission(tradePartnerName, PlayerRelation::TRADE)) { tradeHandler->respond(false); return; diff --git a/src/utils/delete2.h b/src/utils/delete2.h index 0bccaf2c3..f9fbb7f02 100644 --- a/src/utils/delete2.h +++ b/src/utils/delete2.h @@ -27,4 +27,10 @@ var = nullptr;\ } +#define delete2Arr(var) \ + {\ + delete []var;\ + var = nullptr;\ + } + #endif // UTILS_DELETE2_H -- cgit v1.2.3-60-g2f50