diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-20 23:58:09 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-20 23:58:09 +0300 |
commit | 954d4527558bbf797fd0389b0400fb05963ff96b (patch) | |
tree | ec90371d34f88b3e22e9d65ad71d349ee53f62fe | |
parent | 7d606d7dd9708c9c382d1f8eba5fed9becdfd3d5 (diff) | |
download | mv-954d4527558bbf797fd0389b0400fb05963ff96b.tar.gz mv-954d4527558bbf797fd0389b0400fb05963ff96b.tar.bz2 mv-954d4527558bbf797fd0389b0400fb05963ff96b.tar.xz mv-954d4527558bbf797fd0389b0400fb05963ff96b.zip |
Add some more missing consts.
-rw-r--r-- | src/actions/target.cpp | 6 | ||||
-rw-r--r-- | src/actormanager.cpp | 4 | ||||
-rw-r--r-- | src/gui/windows/setupwindow.cpp | 2 | ||||
-rw-r--r-- | src/net/charserverhandler.h | 2 | ||||
-rw-r--r-- | src/net/chathandler.h | 2 | ||||
-rw-r--r-- | src/net/ea/charserverhandler.cpp | 2 | ||||
-rw-r--r-- | src/net/ea/charserverhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/charserverrecv.cpp | 4 | ||||
-rw-r--r-- | src/net/eathena/chathandler.cpp | 2 | ||||
-rw-r--r-- | src/net/eathena/chathandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/generalhandler.cpp | 8 | ||||
-rw-r--r-- | src/net/eathena/generalhandler.h | 4 | ||||
-rw-r--r-- | src/net/generalhandler.h | 4 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/chathandler.h | 3 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.cpp | 8 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.h | 4 |
17 files changed, 32 insertions, 29 deletions
diff --git a/src/actions/target.cpp b/src/actions/target.cpp index f4a177b5d..4e0b46cd3 100644 --- a/src/actions/target.cpp +++ b/src/actions/target.cpp @@ -89,11 +89,13 @@ impHandler0(contextMenu) { if (!localPlayer) return false; - Being *const target = localPlayer->getTarget(); + const Being *const target = localPlayer->getTarget(); if (!target) return true; - popupMenu->showPopup(target->getPixelX(), target->getPixelY(), target); + popupMenu->showPopup(target->getPixelX(), + target->getPixelY(), + target); return true; } diff --git a/src/actormanager.cpp b/src/actormanager.cpp index c9fb63ac8..fb5d2a7b1 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -2104,10 +2104,10 @@ void ActorManager::updateRoom(const ChatObject *const newChat) for_actors { - ActorSprite *const actor = *it; + const ActorSprite *const actor = *it; if (actor->getType() == ActorType::Npc) { - const Being *const being = static_cast<Being*>(actor); + const Being *const being = static_cast<const Being*>(actor); ChatObject *const chat = being->getChat(); if (chat && chat->chatId == newChat->chatId) { diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp index 353e228c2..9deb27f65 100644 --- a/src/gui/windows/setupwindow.cpp +++ b/src/gui/windows/setupwindow.cpp @@ -92,7 +92,7 @@ void SetupWindow::postInit() setMinWidth(310); setMinHeight(210); - static const char *buttonNames[] = + static const char *const buttonNames[] = { // TRANSLATORS: setup button N_("Apply"), diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h index c053eff81..26bfb4ba3 100644 --- a/src/net/charserverhandler.h +++ b/src/net/charserverhandler.h @@ -49,7 +49,7 @@ class CharServerHandler notfinal virtual void setCharCreateDialog(CharCreateDialog *const window) const = 0; - virtual void requestCharacters() = 0; + virtual void requestCharacters() const = 0; virtual void chooseCharacter(Net::Character *const character) const = 0; diff --git a/src/net/chathandler.h b/src/net/chathandler.h index c619b353a..1595cd37a 100644 --- a/src/net/chathandler.h +++ b/src/net/chathandler.h @@ -57,7 +57,7 @@ class ChatHandler notfinal const std::string &restrict text) const = 0; - virtual void joinChannel(const std::string &channel) = 0; + virtual void joinChannel(const std::string &channel) const = 0; virtual void partChannel(const std::string &channel) const = 0; diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index 28ed96bab..d58a1fc3e 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -50,7 +50,7 @@ void CharServerHandler::setCharSelectDialog(CharSelectDialog *const window) updateCharSelectDialog(); } -void CharServerHandler::requestCharacters() +void CharServerHandler::requestCharacters() const { connect(); } diff --git a/src/net/ea/charserverhandler.h b/src/net/ea/charserverhandler.h index c16328a82..09899cd0c 100644 --- a/src/net/ea/charserverhandler.h +++ b/src/net/ea/charserverhandler.h @@ -39,7 +39,7 @@ class CharServerHandler notfinal : public Net::CharServerHandler void setCharSelectDialog(CharSelectDialog *const window) const override final; - void requestCharacters() override final; + void requestCharacters() const override final; unsigned int baseSprite() const override final A_CONST A_WARN_UNUSED; diff --git a/src/net/eathena/charserverrecv.cpp b/src/net/eathena/charserverrecv.cpp index 03ca40aaa..e82a8c144 100644 --- a/src/net/eathena/charserverrecv.cpp +++ b/src/net/eathena/charserverrecv.cpp @@ -221,7 +221,7 @@ void CharServerRecv::processCharMapInfo(Net::MessageIn &restrict msg) ServerInfo &server = mapServer; BLOCK_START("CharServerRecv::processCharMapInfo") PlayerInfo::setCharId(msg.readInt32("char id")); - GameHandler *const gh = static_cast<GameHandler*>(gameHandler); + const GameHandler *const gh = static_cast<GameHandler*>(gameHandler); gh->setMap(msg.readString(16, "map name")); if (config.getBoolValue("usePersistentIP") || settings.persistentIp) { @@ -256,7 +256,7 @@ void CharServerRecv::processChangeMapServer(Net::MessageIn &msg) Network *const network = Network::mInstance; ServerInfo &server = mapServer; BLOCK_START("CharServerRecv::processChangeMapServer") - GameHandler *const gh = static_cast<GameHandler*>(gameHandler); + const GameHandler *const gh = static_cast<GameHandler*>(gameHandler); if (!gh || !network) { BLOCK_END("CharServerRecv::processChangeMapServer") diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index 9653384c3..3c4ab0040 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -235,7 +235,7 @@ void ChatHandler::joinChat(const ChatObject *const chat, outMsg.writeString(password, 8, "password"); } -void ChatHandler::joinChannel(const std::string &channel) +void ChatHandler::joinChannel(const std::string &channel) const { if (serverFeatures->haveJoinChannel()) { diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h index ed9183465..f8356a84d 100644 --- a/src/net/eathena/chathandler.h +++ b/src/net/eathena/chathandler.h @@ -49,7 +49,7 @@ class ChatHandler final : public Ea::ChatHandler const std::string &restrict text) const override final; - void joinChannel(const std::string &channel) override final; + void joinChannel(const std::string &channel) const override final; void who() const override final; diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp index 5d9bb790b..0cc91b297 100644 --- a/src/net/eathena/generalhandler.cpp +++ b/src/net/eathena/generalhandler.cpp @@ -146,14 +146,14 @@ void GeneralHandler::load() const Network::mInstance->registerHandlers(); } -void GeneralHandler::reload() +void GeneralHandler::reload() const { if (Network::mInstance) Network::mInstance->disconnect(); static_cast<LoginHandler*>(mLoginHandler)->clearWorlds(); - CharServerHandler *const charHandler = static_cast<CharServerHandler*>( - mCharServerHandler); + const CharServerHandler *const charHandler = + static_cast<CharServerHandler*>(mCharServerHandler); charHandler->setCharCreateDialog(nullptr); charHandler->setCharSelectDialog(nullptr); static_cast<PartyHandler*>(mPartyHandler)->reload(); @@ -164,7 +164,7 @@ void GeneralHandler::reloadPartially() const static_cast<PartyHandler*>(mPartyHandler)->reload(); } -void GeneralHandler::unload() +void GeneralHandler::unload() const { clearHandlers(); } diff --git a/src/net/eathena/generalhandler.h b/src/net/eathena/generalhandler.h index 42080f3a9..7ff2ea34a 100644 --- a/src/net/eathena/generalhandler.h +++ b/src/net/eathena/generalhandler.h @@ -74,9 +74,9 @@ class GeneralHandler final : public Net::GeneralHandler void load() const override final; - void reload() override final; + void reload() const override final; - void unload() override final; + void unload() const override final; void flushNetwork() const override final; diff --git a/src/net/generalhandler.h b/src/net/generalhandler.h index 9e6a20ff3..fa3de5da2 100644 --- a/src/net/generalhandler.h +++ b/src/net/generalhandler.h @@ -36,9 +36,9 @@ class GeneralHandler notfinal virtual void load() const = 0; - virtual void reload() = 0; + virtual void reload() const = 0; - virtual void unload() = 0; + virtual void unload() const = 0; virtual void flushNetwork() const = 0; diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 998a3eba1..da25c83cf 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -213,7 +213,7 @@ void ChatHandler::joinChat(const ChatObject *const chat A_UNUSED, { } -void ChatHandler::joinChannel(const std::string &channel A_UNUSED) +void ChatHandler::joinChannel(const std::string &channel A_UNUSED) const { } diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h index 7e5ce94a5..d03c609f8 100644 --- a/src/net/tmwa/chathandler.h +++ b/src/net/tmwa/chathandler.h @@ -49,7 +49,8 @@ class ChatHandler final : public Ea::ChatHandler const std::string &restrict text) const override final; - void joinChannel(const std::string &channel) override final A_CONST; + void joinChannel(const std::string &channel) const override final + A_CONST; void who() const override final; diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index bc6029a94..10b5cf5f2 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -153,14 +153,14 @@ void GeneralHandler::load() const Network::mInstance->registerHandlers(); } -void GeneralHandler::reload() +void GeneralHandler::reload() const { if (Network::mInstance) Network::mInstance->disconnect(); static_cast<LoginHandler*>(mLoginHandler)->clearWorlds(); - CharServerHandler *const charHandler = static_cast<CharServerHandler*>( - mCharServerHandler); + const CharServerHandler *const charHandler = + static_cast<CharServerHandler*>(mCharServerHandler); charHandler->setCharCreateDialog(nullptr); charHandler->setCharSelectDialog(nullptr); static_cast<PartyHandler*>(mPartyHandler)->reload(); @@ -171,7 +171,7 @@ void GeneralHandler::reloadPartially() const static_cast<PartyHandler*>(mPartyHandler)->reload(); } -void GeneralHandler::unload() +void GeneralHandler::unload() const { clearHandlers(); } diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index 45efe3345..18273d093 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -75,9 +75,9 @@ class GeneralHandler final : public Net::GeneralHandler void load() const override final; - void reload() override final; + void reload() const override final; - void unload() override final; + void unload() const override final; void flushNetwork() const override final; |