From 311c175f3184103950c72bc5c775174597430b83 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 14 Jul 2017 01:31:22 +0300 Subject: Replace std::vector into macro STD_VECTOR. In most case it equal to std::vector except debug modes. Now it can be also mse::mstd::vector, but sadly this class not support all required features. --- src/gui/popups/beingpopup.cpp | 6 +++--- src/gui/popups/beingpopup.h | 2 +- src/gui/popups/itempopup.cpp | 4 ++-- src/gui/popups/popupmenu.cpp | 22 +++++++++++----------- src/gui/popups/popupmenu.h | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/gui/popups') diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp index 251848ed8..299683f6d 100644 --- a/src/gui/popups/beingpopup.cpp +++ b/src/gui/popups/beingpopup.cpp @@ -67,7 +67,7 @@ void BeingPopup::postInit() { Popup::postInit(); add(mBeingName); - FOR_EACH (std::vector::iterator, it, mLabels) + FOR_EACH (STD_VECTOR::iterator, it, mLabels) { add(*it); } @@ -124,7 +124,7 @@ void BeingPopup::show(const int x, const int y, Being *const b) } mBeingName->adjustSize(); - FOR_EACH (std::vector::iterator, it, mLabels) + FOR_EACH (STD_VECTOR::iterator, it, mLabels) { (*it)->setCaption(std::string()); } @@ -311,7 +311,7 @@ void BeingPopup::show(const int x, const int y, Being *const b) int minWidth = mBeingName->getWidth(); const int height1 = getFont()->getHeight(); int height = height1; - FOR_EACH (std::vector::iterator, it, mLabels) + FOR_EACH (STD_VECTOR::iterator, it, mLabels) { const Label *const label = *it; if (label != nullptr) diff --git a/src/gui/popups/beingpopup.h b/src/gui/popups/beingpopup.h index 8c218da2a..a14f44568 100644 --- a/src/gui/popups/beingpopup.h +++ b/src/gui/popups/beingpopup.h @@ -60,7 +60,7 @@ class BeingPopup final : public Popup void addLabels(const int fontHeight); Label *mBeingName A_NONNULLPOINTER; - std::vector mLabels; + STD_VECTOR mLabels; }; extern BeingPopup *beingPopup; diff --git a/src/gui/popups/itempopup.cpp b/src/gui/popups/itempopup.cpp index 5179627e1..eedead83d 100644 --- a/src/gui/popups/itempopup.cpp +++ b/src/gui/popups/itempopup.cpp @@ -382,12 +382,12 @@ std::string ItemPopup::getOptionsString(const ItemOptionsList *const options) const ItemOption &option = options->get(f); if (option.index == 0) continue; - const std::vector &fields = ItemOptionDb::getFields( + const STD_VECTOR &fields = ItemOptionDb::getFields( option.index); if (fields.empty()) continue; const std::string valueStr = toString(option.value); - FOR_EACH (std::vector::const_iterator, it, fields) + FOR_EACH (STD_VECTOR::const_iterator, it, fields) { const ItemFieldType *const field = *it; std::string value = valueStr; diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index 2f2df70c3..8b11b0c2f 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -460,8 +460,8 @@ bool PopupMenu::addBeingMenu() if (info == nullptr) return false; - const std::vector &menu = info->getMenu(); - FOR_EACH (std::vector::const_iterator, it, menu) + const STD_VECTOR &menu = info->getMenu(); + FOR_EACH (STD_VECTOR::const_iterator, it, menu) { const BeingMenuItem &item = *it; mBrowserBox->addRow("/" + item.command, item.name.c_str()); @@ -499,14 +499,14 @@ void PopupMenu::setMousePos2() } void PopupMenu::showPopup(const int x, const int y, - const std::vector &beings) + const STD_VECTOR &beings) { mX = x; mY = y; mBrowserBox->clearRows(); // TRANSLATORS: popup menu header mBrowserBox->addRow(_("Players")); - FOR_EACH (std::vector::const_iterator, it, beings) + FOR_EACH (STD_VECTOR::const_iterator, it, beings) { const Being *const being = dynamic_cast(*it); const ActorSprite *const actor = *it; @@ -1806,8 +1806,8 @@ void PopupMenu::showPopup(const int x, const int y, Button *const button) mY = y; mBrowserBox->clearRows(); - std::vector