diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-20 21:19:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-20 21:19:35 +0300 |
commit | 3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9 (patch) | |
tree | 2053748aba4fd1e01020effe9322757426354d28 /src/gui/windows | |
parent | 2577a25f8a4acf587526809fda2ded95875e1222 (diff) | |
download | manaverse-3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9.tar.gz manaverse-3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9.tar.bz2 manaverse-3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9.tar.xz manaverse-3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9.zip |
Add missing const in gui directory.
Diffstat (limited to 'src/gui/windows')
34 files changed, 103 insertions, 83 deletions
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index 82f49421b..47ec11db2 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -566,7 +566,8 @@ void BuyDialog::action(const ActionEvent &event) #ifdef EATHENA_SUPPORT if (serverFeatures->haveVending()) { - Being *const being = actorManager->findBeingByName(mNick); + const Being *const being = actorManager->findBeingByName( + mNick); if (being) { vendingHandler->buy(being, diff --git a/src/gui/windows/buyingstoreselldialog.cpp b/src/gui/windows/buyingstoreselldialog.cpp index 205734248..7cb6f975a 100644 --- a/src/gui/windows/buyingstoreselldialog.cpp +++ b/src/gui/windows/buyingstoreselldialog.cpp @@ -52,13 +52,13 @@ void BuyingStoreSellDialog::sellAction(const ActionEvent &event A_UNUSED) return; const int selectedItem = mShopItemList->getSelected(); - ShopItem *const item1 = mShopItems->at(selectedItem); + const ShopItem *const item1 = mShopItems->at(selectedItem); if (!item1 || PlayerInfo::isItemProtected(item1->getId())) return; - Being *const being = actorManager->findBeing(mAccountId); + const Being *const being = actorManager->findBeing(mAccountId); if (!being) return; - Item *const item2 = PlayerInfo::getInventory()->findItem( + const Item *const item2 = PlayerInfo::getInventory()->findItem( item1->getId(), item1->getColor()); if (!item2) diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 420d20c1c..f9500465d 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -150,8 +150,9 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, const std::vector<int> &items = CharDB::getDefaultItems(); int i = 1; for (std::vector<int>::const_iterator it = items.begin(), - it_end = items.end(); - it != it_end; ++ it, i ++) + it_fend = items.end(); + it != it_fend; + ++ it, i ++) { mPlayer->setSprite(i, *it); } diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index 57cc7ceb5..19a61cc10 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -183,8 +183,10 @@ void CharSelectDialog::action(const ActionEvent &event) // Check if a button of a character was pressed const Widget *const sourceParent = event.getSource()->getParent(); int selected = -1; - for (unsigned int i = 0, sz = CAST_U32( - mCharacterEntries.size()); i < sz; ++i) + for (unsigned int i = 0, fsz = CAST_U32( + mCharacterEntries.size()); + i < fsz; + ++i) { if (mCharacterEntries[i] == sourceParent) { @@ -616,8 +618,10 @@ void CharSelectDialog::updateState() void CharSelectDialog::setName(const BeingId id, const std::string &newName) { - for (unsigned int i = 0, sz = CAST_U32( - mCharacterEntries.size()); i < sz; ++i) + for (unsigned int i = 0, fsz = CAST_U32( + mCharacterEntries.size()); + i < fsz; + ++i) { if (!mCharacterEntries[i]) continue; diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 5be54a6f9..d5c2677ac 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -2087,7 +2087,7 @@ void ChatWindow::mouseExited(MouseEvent& event) Window::mouseExited(event); } -void ChatWindow::draw(Graphics* graphics) +void ChatWindow::draw(Graphics *const graphics) { BLOCK_START("ChatWindow::draw") if (!mAutoHide || mHaveMouse) @@ -2099,7 +2099,7 @@ void ChatWindow::draw(Graphics* graphics) BLOCK_END("ChatWindow::draw") } -void ChatWindow::safeDraw(Graphics* graphics) +void ChatWindow::safeDraw(Graphics *const graphics) { BLOCK_START("ChatWindow::draw") if (!mAutoHide || mHaveMouse) diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h index 644134158..aec0846ad 100644 --- a/src/gui/windows/chatwindow.h +++ b/src/gui/windows/chatwindow.h @@ -279,9 +279,9 @@ class ChatWindow final : public Window, void mouseExited(MouseEvent& event A_UNUSED) override final; - void draw(Graphics* graphics) override final A_NONNULL(2); + void draw(Graphics *const graphics) override final A_NONNULL(2); - void safeDraw(Graphics* graphics) override final A_NONNULL(2); + void safeDraw(Graphics *const graphics) override final A_NONNULL(2); void updateVisibility(); diff --git a/src/gui/windows/connectiondialog.cpp b/src/gui/windows/connectiondialog.cpp index ccefa59ba..290a1cefe 100644 --- a/src/gui/windows/connectiondialog.cpp +++ b/src/gui/windows/connectiondialog.cpp @@ -73,7 +73,7 @@ void ConnectionDialog::action(const ActionEvent &) client->setState(mCancelState); } -void ConnectionDialog::draw(Graphics *graphics) +void ConnectionDialog::draw(Graphics *const graphics) { BLOCK_START("ConnectionDialog::draw") // Don't draw the window background, only draw the children @@ -81,7 +81,7 @@ void ConnectionDialog::draw(Graphics *graphics) BLOCK_END("ConnectionDialog::draw") } -void ConnectionDialog::safeDraw(Graphics *graphics) +void ConnectionDialog::safeDraw(Graphics *const graphics) { BLOCK_START("ConnectionDialog::draw") // Don't draw the window background, only draw the children diff --git a/src/gui/windows/connectiondialog.h b/src/gui/windows/connectiondialog.h index a53a84151..5630ee121 100644 --- a/src/gui/windows/connectiondialog.h +++ b/src/gui/windows/connectiondialog.h @@ -58,9 +58,9 @@ class ConnectionDialog final : public Window, */ void action(const ActionEvent &) override final; - void draw(Graphics *graphics) override final A_NONNULL(2); + void draw(Graphics *const graphics) override final A_NONNULL(2); - void safeDraw(Graphics *graphics) override final A_NONNULL(2); + void safeDraw(Graphics *const graphics) override final A_NONNULL(2); private: StateT mCancelState; diff --git a/src/gui/windows/cutinwindow.cpp b/src/gui/windows/cutinwindow.cpp index 571030407..184695260 100644 --- a/src/gui/windows/cutinwindow.cpp +++ b/src/gui/windows/cutinwindow.cpp @@ -55,13 +55,13 @@ CutInWindow::~CutInWindow() delete2(mImage); } -void CutInWindow::draw(Graphics *graphics) +void CutInWindow::draw(Graphics *const graphics) { Window::draw(graphics); draw2(graphics); } -void CutInWindow::safeDraw(Graphics *graphics) +void CutInWindow::safeDraw(Graphics *const graphics) { Window::safeDraw(graphics); draw2(graphics); diff --git a/src/gui/windows/cutinwindow.h b/src/gui/windows/cutinwindow.h index f6e48624c..fd6e63390 100644 --- a/src/gui/windows/cutinwindow.h +++ b/src/gui/windows/cutinwindow.h @@ -38,9 +38,9 @@ class CutInWindow final : public Window ~CutInWindow(); - void draw(Graphics *graphics) override final A_NONNULL(2); + void draw(Graphics *const graphics) override final A_NONNULL(2); - void safeDraw(Graphics *graphics) override final A_NONNULL(2); + void safeDraw(Graphics *const graphics) override final A_NONNULL(2); void draw2(Graphics *const graphics) A_NONNULL(2); diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp index add7d2e4d..3c0c60b0f 100644 --- a/src/gui/windows/debugwindow.cpp +++ b/src/gui/windows/debugwindow.cpp @@ -116,7 +116,7 @@ void DebugWindow::slowLogic() BLOCK_END("DebugWindow::slowLogic") } -void DebugWindow::draw(Graphics *g) +void DebugWindow::draw(Graphics *const g) { BLOCK_START("DebugWindow::draw") Window::draw(g); @@ -134,7 +134,7 @@ void DebugWindow::draw(Graphics *g) BLOCK_END("DebugWindow::draw") } -void DebugWindow::safeDraw(Graphics *g) +void DebugWindow::safeDraw(Graphics *const g) { BLOCK_START("DebugWindow::draw") Window::safeDraw(g); diff --git a/src/gui/windows/debugwindow.h b/src/gui/windows/debugwindow.h index 00ed46e48..12bb97f13 100644 --- a/src/gui/windows/debugwindow.h +++ b/src/gui/windows/debugwindow.h @@ -54,9 +54,9 @@ class DebugWindow final : public Window */ void slowLogic(); - void draw(Graphics *g) override final A_NONNULL(2); + void draw(Graphics *const g) override final A_NONNULL(2); - void safeDraw(Graphics *g) override final A_NONNULL(2); + void safeDraw(Graphics *const g) override final A_NONNULL(2); void setPing(int pingTime); diff --git a/src/gui/windows/didyouknowwindow.cpp b/src/gui/windows/didyouknowwindow.cpp index 21216f2ae..1737010cc 100644 --- a/src/gui/windows/didyouknowwindow.cpp +++ b/src/gui/windows/didyouknowwindow.cpp @@ -134,7 +134,7 @@ void DidYouKnowWindow::action(const ActionEvent &event) } void DidYouKnowWindow::handleLink(const std::string &link, - MouseEvent *event A_UNUSED) + MouseEvent *const event A_UNUSED) { if (strStartWith(link, "http://") || strStartWith(link, "https://")) openBrowser(link); diff --git a/src/gui/windows/didyouknowwindow.h b/src/gui/windows/didyouknowwindow.h index 1b015acb3..c63b2d421 100644 --- a/src/gui/windows/didyouknowwindow.h +++ b/src/gui/windows/didyouknowwindow.h @@ -59,7 +59,7 @@ class DidYouKnowWindow final : public Window, * Handles link action. */ void handleLink(const std::string &link, - MouseEvent *event) override final; + MouseEvent *const event) override final; void loadData(int num = 0); diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index ddde610eb..62feb6e7d 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -174,7 +174,7 @@ EquipmentWindow::~EquipmentWindow() delete2(mVertexes); } -void EquipmentWindow::draw(Graphics *graphics) +void EquipmentWindow::draw(Graphics *const graphics) { BLOCK_START("EquipmentWindow::draw") // Draw window graphics @@ -261,7 +261,7 @@ void EquipmentWindow::draw(Graphics *graphics) BLOCK_END("EquipmentWindow::draw") } -void EquipmentWindow::safeDraw(Graphics *graphics) +void EquipmentWindow::safeDraw(Graphics *const graphics) { BLOCK_START("EquipmentWindow::draw") // Draw window graphics diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h index 4463c770c..985208e03 100644 --- a/src/gui/windows/equipmentwindow.h +++ b/src/gui/windows/equipmentwindow.h @@ -70,9 +70,9 @@ class EquipmentWindow final : public Window, /** * Draws the equipment window. */ - void draw(Graphics *graphics) override final A_NONNULL(2); + void draw(Graphics *const graphics) override final A_NONNULL(2); - void safeDraw(Graphics *graphics) override final A_NONNULL(2); + void safeDraw(Graphics *const graphics) override final A_NONNULL(2); void action(const ActionEvent &event) override final; diff --git a/src/gui/windows/helpwindow.cpp b/src/gui/windows/helpwindow.cpp index 50e5423ac..63123d56b 100644 --- a/src/gui/windows/helpwindow.cpp +++ b/src/gui/windows/helpwindow.cpp @@ -102,7 +102,7 @@ void HelpWindow::action(const ActionEvent &event) } void HelpWindow::handleLink(const std::string &link, - MouseEvent *event A_UNUSED) + MouseEvent *const event A_UNUSED) { if (!strStartWith(link, "http://") && !strStartWith(link, "https://")) { diff --git a/src/gui/windows/helpwindow.h b/src/gui/windows/helpwindow.h index a636b8b0f..ec0b88d93 100644 --- a/src/gui/windows/helpwindow.h +++ b/src/gui/windows/helpwindow.h @@ -62,7 +62,7 @@ class HelpWindow final : public Window, * Handles link action. */ void handleLink(const std::string &link, - MouseEvent *event A_UNUSED) override final; + MouseEvent *const event A_UNUSED) override final; /** * Loads help in the dialog. diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index 2d7b8ba65..371d98414 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -237,7 +237,7 @@ void Minimap::toggle() mShow = isWindowVisible(); } -void Minimap::draw(Graphics *graphics) +void Minimap::draw(Graphics *const graphics) { BLOCK_START("Minimap::draw") @@ -245,7 +245,7 @@ void Minimap::draw(Graphics *graphics) draw2(graphics); } -void Minimap::safeDraw(Graphics *graphics) +void Minimap::safeDraw(Graphics *const graphics) { BLOCK_START("Minimap::draw") diff --git a/src/gui/windows/minimap.h b/src/gui/windows/minimap.h index 60486e692..7d6f8bfc4 100644 --- a/src/gui/windows/minimap.h +++ b/src/gui/windows/minimap.h @@ -59,9 +59,9 @@ class Minimap final : public Window, public ConfigListener /** * Draws the minimap. */ - void draw(Graphics *graphics) override final A_NONNULL(2); + void draw(Graphics *const graphics) override final A_NONNULL(2); - void safeDraw(Graphics *graphics) override final A_NONNULL(2); + void safeDraw(Graphics *const graphics) override final A_NONNULL(2); void draw2(Graphics *const graphics) A_NONNULL(2); diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index e0fe46bb3..b8e321dcf 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -317,14 +317,14 @@ void MiniStatusWindow::logic() BLOCK_END("MiniStatusWindow::logic") } -void MiniStatusWindow::draw(Graphics *graphics) +void MiniStatusWindow::draw(Graphics *const graphics) { BLOCK_START("MiniStatusWindow::draw") drawChildren(graphics); BLOCK_END("MiniStatusWindow::draw") } -void MiniStatusWindow::safeDraw(Graphics *graphics) +void MiniStatusWindow::safeDraw(Graphics *const graphics) { BLOCK_START("MiniStatusWindow::draw") safeDrawChildren(graphics); diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h index bdf4dcd29..82fa059c7 100644 --- a/src/gui/windows/ministatuswindow.h +++ b/src/gui/windows/ministatuswindow.h @@ -69,9 +69,9 @@ class MiniStatusWindow final : public Window, void logic() override final; - void draw(Graphics *graphics) override final A_NONNULL(2); + void draw(Graphics *const graphics) override final A_NONNULL(2); - void safeDraw(Graphics *graphics) override final A_NONNULL(2); + void safeDraw(Graphics *const graphics) override final A_NONNULL(2); void mouseMoved(MouseEvent &event) override final; diff --git a/src/gui/windows/npcselldialog.cpp b/src/gui/windows/npcselldialog.cpp index 6822c3ed6..453126382 100644 --- a/src/gui/windows/npcselldialog.cpp +++ b/src/gui/windows/npcselldialog.cpp @@ -56,7 +56,7 @@ void NpcSellDialog::sellAction(const ActionEvent &event) { const std::string &eventId = event.getId(); const int selectedItem = mShopItemList->getSelected(); - ShopItem *const item = mShopItems->at(selectedItem); + const ShopItem *const item = mShopItems->at(selectedItem); if (!item || PlayerInfo::isItemProtected(item->getId())) return; diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index 83874f4c3..0e5885089 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -324,7 +324,7 @@ void OutfitWindow::copyOutfit(const int src, const int dst) save(); } -void OutfitWindow::draw(Graphics *graphics) +void OutfitWindow::draw(Graphics *const graphics) { BLOCK_START("OutfitWindow::draw") Window::draw(graphics); @@ -380,7 +380,7 @@ void OutfitWindow::draw(Graphics *graphics) BLOCK_END("OutfitWindow::draw") } -void OutfitWindow::safeDraw(Graphics *graphics) +void OutfitWindow::safeDraw(Graphics *const graphics) { BLOCK_START("OutfitWindow::draw") Window::safeDraw(graphics); diff --git a/src/gui/windows/outfitwindow.h b/src/gui/windows/outfitwindow.h index 1dc30955b..b10388005 100644 --- a/src/gui/windows/outfitwindow.h +++ b/src/gui/windows/outfitwindow.h @@ -54,9 +54,9 @@ class OutfitWindow final : public Window, void action(const ActionEvent &event) override final; - void draw(Graphics *graphics) override final A_NONNULL(2); + void draw(Graphics *const graphics) override final A_NONNULL(2); - void safeDraw(Graphics *graphics) override final A_NONNULL(2); + void safeDraw(Graphics *const graphics) override final A_NONNULL(2); void mousePressed(MouseEvent &event) override final; diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index f4cd045c3..b52793f05 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -570,8 +570,8 @@ void ServerDialog::loadServers(const bool addNew) MutexLocker tempLock(&mMutex); // Add the server to the local list if it's not already present bool found = false; - for (unsigned int i = 0, sz = CAST_U32( - mServers.size()); i < sz; i++) + for (unsigned int i = 0, fsz = CAST_U32( + mServers.size()); i < fsz; i++) { if (mServers[i] == server) { @@ -660,8 +660,8 @@ void ServerDialog::saveCustomServers(const ServerInfo ¤tServer, int savedServerCount = 0; - for (unsigned i = 0, sz = CAST_U32(mServers.size()); - i < sz && savedServerCount < MAX_SERVERLIST; ++ i) + for (unsigned i = 0, fsz = CAST_U32(mServers.size()); + i < fsz && savedServerCount < MAX_SERVERLIST; ++ i) { const ServerInfo &server = mServers.at(i); @@ -695,9 +695,9 @@ void ServerDialog::saveCustomServers(const ServerInfo ¤tServer, } int ServerDialog::downloadUpdate(void *ptr, - DownloadStatusT status, + const DownloadStatusT status, size_t total, - size_t remaining) + const size_t remaining) { if (!ptr || status == DownloadStatus::Cancelled) return -1; diff --git a/src/gui/windows/serverdialog.h b/src/gui/windows/serverdialog.h index 6ef3e1cf0..348f1f1f0 100644 --- a/src/gui/windows/serverdialog.h +++ b/src/gui/windows/serverdialog.h @@ -119,9 +119,9 @@ class ServerDialog final : public Window, bool needUpdateServers() const; static int downloadUpdate(void *ptr, - DownloadStatusT status, + const DownloadStatusT status, size_t total, - size_t remaining); + const size_t remaining); Mutex mMutex; ServerInfos mServers; diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp index b1fabc86f..353e228c2 100644 --- a/src/gui/windows/setupwindow.cpp +++ b/src/gui/windows/setupwindow.cpp @@ -106,7 +106,7 @@ void SetupWindow::postInit() }; int x = width; mButtonPadding = getOption("buttonPadding", 5); - for (const char ** curBtn = buttonNames; *curBtn; ++ curBtn) + for (const char *const * curBtn = buttonNames; *curBtn; ++ curBtn) { Button *const btn = new Button(this, gettext(*curBtn), *curBtn, this); mButtons.push_back(btn); @@ -226,7 +226,7 @@ void SetupWindow::externalUpdate() } } -void SetupWindow::unloadTab(SetupTab *page) +void SetupWindow::unloadTab(SetupTab *const page) { if (page) { diff --git a/src/gui/windows/setupwindow.h b/src/gui/windows/setupwindow.h index 8568b1bfe..4e6d6b15c 100644 --- a/src/gui/windows/setupwindow.h +++ b/src/gui/windows/setupwindow.h @@ -78,7 +78,7 @@ class SetupWindow final : public Window, private: void unloadAdditionalTabs(); - void unloadTab(SetupTab *page); + void unloadTab(SetupTab *const page); std::list<SetupTab*> mTabs; std::list<Window*> mWindowsToReset; diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index b927273ef..679bbc47f 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -341,7 +341,7 @@ void ShopWindow::action(const ActionEvent &event) { std::vector<ShopItem*> &oldItems = mSellShopItems->items(); std::vector<ShopItem*> items; - Inventory *const inv = PlayerInfo::getCartInventory(); + const Inventory *const inv = PlayerInfo::getCartInventory(); if (!inv) return; FOR_EACH (std::vector<ShopItem*>::iterator, it, oldItems) @@ -349,7 +349,7 @@ void ShopWindow::action(const ActionEvent &event) ShopItem *const item = *it; if (!item) continue; - Item *const cartItem = inv->findItem(item->getId(), + const Item *const cartItem = inv->findItem(item->getId(), item->getColor()); if (!cartItem) continue; @@ -623,7 +623,9 @@ void ShopWindow::saveList() const } for (std::map<int, ShopItem*>::const_iterator mapIt = mapItems.begin(), - mapIt_end = mapItems.end(); mapIt != mapIt_end; ++mapIt) + mapIt_fend = mapItems.end(); + mapIt != mapIt_fend; + ++mapIt) { const ShopItem *const buyItem = (*mapIt).second; if (buyItem) diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index 8498b6316..fe8aaacbf 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -660,7 +660,7 @@ void SocialWindow::updateParty() Party *const party = localPlayer->getParty(); if (party) { - PartyMap::iterator it = mParties.find(party); + const PartyMap::iterator it = mParties.find(party); if (it != mParties.end()) { SocialTab *const tab = (*it).second; @@ -694,7 +694,7 @@ void SocialWindow::updateGuildCounter(const int online, const int total) Guild *const guild = localPlayer->getGuild(); if (guild) { - GuildMap::iterator it = mGuilds.find(guild); + const GuildMap::iterator it = mGuilds.find(guild); if (it != mGuilds.end()) { SocialTab *const tab = (*it).second; diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index fcc2cc8ec..27a8c658e 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -203,7 +203,7 @@ void TradeWindow::addItem(const int id, const Damaged damaged, const Favorite favorite) const { - Inventory *inv = own ? mMyInventory : mPartnerInventory; + Inventory *const inv = own ? mMyInventory : mPartnerInventory; inv->addItem(id, type, quantity, @@ -229,7 +229,7 @@ void TradeWindow::addItem2(const int id, const Favorite favorite, const Equipm equipment) const { - Inventory *inv = own ? mMyInventory : mPartnerInventory; + Inventory *const inv = own ? mMyInventory : mPartnerInventory; const int slot = inv->addItem(id, type, quantity, diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 09f529259..242e32911 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -487,9 +487,9 @@ void UpdaterWindow::loadPatch() } int UpdaterWindow::updateProgress(void *ptr, - DownloadStatusT status, + const DownloadStatusT status, size_t dt, - size_t dn) + const size_t dn) { UpdaterWindow *const uw = reinterpret_cast<UpdaterWindow *>(ptr); if (!uw) @@ -685,8 +685,10 @@ void UpdaterWindow::loadLocalUpdates(const std::string &dir) } const std::string fixPath = dir + "/fix"; - for (unsigned int updateIndex = 0, sz = CAST_U32( - updateFiles.size()); updateIndex < sz; updateIndex ++) + for (unsigned int updateIndex = 0, + fsz = CAST_U32(updateFiles.size()); + updateIndex < fsz; + updateIndex++) { const UpdateFile &file = updateFiles[updateIndex]; if (!file.group.empty()) @@ -712,8 +714,10 @@ void UpdaterWindow::unloadUpdates(const std::string &dir) } const std::string fixPath = dir + "/fix"; - for (unsigned int updateIndex = 0, sz = CAST_U32( - updateFiles.size()); updateIndex < sz; updateIndex ++) + for (unsigned int updateIndex = 0, + fsz = CAST_U32(updateFiles.size()); + updateIndex < fsz; + updateIndex++) { UpdaterWindow::removeUpdateFile(dir, fixPath, @@ -728,8 +732,10 @@ void UpdaterWindow::loadManaPlusUpdates(const std::string &dir) std::vector<UpdateFile> updateFiles = loadXMLFile( std::string(fixPath).append("/").append(xmlUpdateFile), false); - for (unsigned int updateIndex = 0, sz = CAST_U32( - updateFiles.size()); updateIndex < sz; updateIndex ++) + for (unsigned int updateIndex = 0, + fsz = CAST_U32(updateFiles.size()); + updateIndex < fsz; + updateIndex++) { const UpdateFile &file = updateFiles[updateIndex]; if (!file.group.empty()) @@ -752,8 +758,10 @@ void UpdaterWindow::unloadManaPlusUpdates(const std::string &dir) const std::vector<UpdateFile> updateFiles = loadXMLFile( std::string(fixPath).append("/").append(xmlUpdateFile), true); - for (unsigned int updateIndex = 0, sz = CAST_U32( - updateFiles.size()); updateIndex < sz; updateIndex ++) + for (unsigned int updateIndex = 0, + fsz = CAST_U32(updateFiles.size()); + updateIndex < fsz; + updateIndex++) { std::string name = updateFiles[updateIndex].name; if (strStartWith(name, "manaplus_")) @@ -1056,7 +1064,7 @@ unsigned long UpdaterWindow::getFileHash(const std::string &filePath) } void UpdaterWindow::handleLink(const std::string &link, - MouseEvent *event A_UNUSED) + MouseEvent *const event A_UNUSED) { if (strStartWith(link, "http://") || strStartWith(link, "https://")) openBrowser(link); @@ -1085,8 +1093,10 @@ void UpdaterWindow::loadMods(const std::string &dir, splitToStringSet(modsList, modsString, '|'); const std::string fixPath = dir + "/fix"; - for (unsigned int updateIndex = 0, sz = CAST_U32( - updateFiles.size()); updateIndex < sz; updateIndex ++) + for (unsigned int updateIndex = 0, + fsz = CAST_U32(updateFiles.size()); + updateIndex < fsz; + updateIndex ++) { const UpdateFile &file = updateFiles[updateIndex]; if (file.group.empty()) @@ -1105,8 +1115,10 @@ void UpdaterWindow::loadMods(const std::string &dir, std::vector<UpdateFile> updateFiles2 = loadXMLFile( std::string(fixPath).append("/").append(xmlUpdateFile), true); - for (unsigned int updateIndex = 0, sz = CAST_U32( - updateFiles2.size()); updateIndex < sz; updateIndex ++) + for (unsigned int updateIndex = 0, + fsz = CAST_U32(updateFiles2.size()); + updateIndex < fsz; + updateIndex++) { const UpdateFile &file = updateFiles2[updateIndex]; if (file.group.empty()) diff --git a/src/gui/windows/updaterwindow.h b/src/gui/windows/updaterwindow.h index 2af2bb665..3bd8a5a6f 100644 --- a/src/gui/windows/updaterwindow.h +++ b/src/gui/windows/updaterwindow.h @@ -113,7 +113,7 @@ class UpdaterWindow final : public Window, void logic() override final; void handleLink(const std::string &link, - MouseEvent *event A_UNUSED) override final; + MouseEvent *const event A_UNUSED) override final; void loadFile(std::string file); @@ -157,9 +157,9 @@ class UpdaterWindow final : public Window, * A download callback for progress updates. */ static int updateProgress(void *ptr, - DownloadStatusT status, + const DownloadStatusT status, size_t dt, - size_t dn); + const size_t dn); /** * A libcurl callback for writing to memory. |