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/models/beingslistmodel.h | 4 ++-- src/gui/models/colormodel.h | 2 +- src/gui/models/extendednamesmodel.cpp | 2 +- src/gui/models/extendednamesmodel.h | 4 ++-- src/gui/models/playertablemodel.h | 2 +- src/gui/models/serverslistmodel.h | 2 +- src/gui/models/shopitems.cpp | 14 +++++++------- src/gui/models/shopitems.h | 10 +++++----- src/gui/models/tablemodel.h | 4 ++-- src/gui/models/touchactionmodel.cpp | 4 ++-- src/gui/models/touchactionmodel.h | 2 +- src/gui/models/updatelistmodel.h | 2 +- 12 files changed, 26 insertions(+), 26 deletions(-) (limited to 'src/gui/models') diff --git a/src/gui/models/beingslistmodel.h b/src/gui/models/beingslistmodel.h index db17f4833..a0a9d2920 100644 --- a/src/gui/models/beingslistmodel.h +++ b/src/gui/models/beingslistmodel.h @@ -45,7 +45,7 @@ class BeingsListModel final : public AvatarListModel mMembers.clear(); } - std::vector *getMembers() RETURNS_NONNULL A_WARN_UNUSED + STD_VECTOR *getMembers() RETURNS_NONNULL A_WARN_UNUSED { return &mMembers; } @@ -60,7 +60,7 @@ class BeingsListModel final : public AvatarListModel return CAST_S32(mMembers.size()); } - std::vector mMembers; + STD_VECTOR mMembers; }; #endif // GUI_MODELS_BEINGSLISTMODEL_H diff --git a/src/gui/models/colormodel.h b/src/gui/models/colormodel.h index 225bc6536..9d621dfbe 100644 --- a/src/gui/models/colormodel.h +++ b/src/gui/models/colormodel.h @@ -63,7 +63,7 @@ class ColorModel final : public ListModel protected: StringVect mNames; - std::vector mColors; + STD_VECTOR mColors; }; #endif // GUI_MODELS_COLORMODEL_H diff --git a/src/gui/models/extendednamesmodel.cpp b/src/gui/models/extendednamesmodel.cpp index 146473a91..76191ae5a 100644 --- a/src/gui/models/extendednamesmodel.cpp +++ b/src/gui/models/extendednamesmodel.cpp @@ -59,7 +59,7 @@ const Image *ExtendedNamesModel::getImageAt(int i) void ExtendedNamesModel::clear() { mNames.clear(); - FOR_EACH (std::vector::iterator, it, mImages) + FOR_EACH (STD_VECTOR::iterator, it, mImages) { if (*it != nullptr) (*it)->decRef(); diff --git a/src/gui/models/extendednamesmodel.h b/src/gui/models/extendednamesmodel.h index cf1d13f6e..2e85a4b2b 100644 --- a/src/gui/models/extendednamesmodel.h +++ b/src/gui/models/extendednamesmodel.h @@ -43,7 +43,7 @@ class ExtendedNamesModel notfinal : public ExtendedListModel StringVect &getNames() A_WARN_UNUSED { return mNames; } - std::vector &getImages() A_WARN_UNUSED + STD_VECTOR &getImages() A_WARN_UNUSED { return mImages; } size_t size() A_WARN_UNUSED @@ -56,7 +56,7 @@ class ExtendedNamesModel notfinal : public ExtendedListModel protected: StringVect mNames; - std::vector mImages; + STD_VECTOR mImages; }; #endif // GUI_MODELS_EXTENDEDNAMESMODEL_H diff --git a/src/gui/models/playertablemodel.h b/src/gui/models/playertablemodel.h index 4c8792bc7..dfb00eeb4 100644 --- a/src/gui/models/playertablemodel.h +++ b/src/gui/models/playertablemodel.h @@ -61,7 +61,7 @@ class PlayerTableModel final : public Widget2, protected: StringVect *mPlayers; - std::vector mWidgets; + STD_VECTOR mWidgets; PlayerRelationListModel *mListModel; }; diff --git a/src/gui/models/serverslistmodel.h b/src/gui/models/serverslistmodel.h index 206daa02a..8e236ebe0 100644 --- a/src/gui/models/serverslistmodel.h +++ b/src/gui/models/serverslistmodel.h @@ -109,7 +109,7 @@ class ServersListModel final : public ListModel } private: - typedef std::vector VersionStrings; + typedef STD_VECTOR VersionStrings; ServerInfos *mServers; VersionStrings mVersionStrings; diff --git a/src/gui/models/shopitems.cpp b/src/gui/models/shopitems.cpp index 763b75390..27e05ff12 100644 --- a/src/gui/models/shopitems.cpp +++ b/src/gui/models/shopitems.cpp @@ -133,10 +133,10 @@ ShopItem *ShopItems::at(const size_t i) const return mShopItems.at(i); } -bool ShopItems::findInAllItems(std::vector::iterator &it, +bool ShopItems::findInAllItems(STD_VECTOR::iterator &it, const ShopItem *const item) { - const std::vector::iterator it_end = mAllShopItems.end(); + const STD_VECTOR::iterator it_end = mAllShopItems.end(); for (it = mAllShopItems.begin(); it != it_end; ++ it) { if (*it == item) @@ -151,7 +151,7 @@ void ShopItems::erase(const unsigned int i) return; const ShopItem *const item = *(mShopItems.begin() + i); - std::vector::iterator it; + STD_VECTOR::iterator it; if (findInAllItems(it, item)) mAllShopItems.erase(it); mShopItems.erase(mShopItems.begin() + i); @@ -163,7 +163,7 @@ void ShopItems::del(const unsigned int i) return; ShopItem *item = *(mShopItems.begin() + i); - std::vector::iterator it; + STD_VECTOR::iterator it; if (findInAllItems(it, item)) mAllShopItems.erase(it); mShopItems.erase(mShopItems.begin() + i); @@ -180,8 +180,8 @@ void ShopItems::clear() ShopItem *ShopItems::findItem(const int id, const ItemColor color) const { - std::vector::const_iterator it = mShopItems.begin(); - const std::vector::const_iterator e = mShopItems.end(); + STD_VECTOR::const_iterator it = mShopItems.begin(); + const STD_VECTOR::const_iterator e = mShopItems.end(); while (it != e) { ShopItem *const item = *it; @@ -197,7 +197,7 @@ ShopItem *ShopItems::findItem(const int id, void ShopItems::updateList() { mShopItems.clear(); - FOR_EACH (std::vector::iterator, it, mAllShopItems) + FOR_EACH (STD_VECTOR::iterator, it, mAllShopItems) { ShopItem *const item = *it; if ((item != nullptr) && item->isVisible()) diff --git a/src/gui/models/shopitems.h b/src/gui/models/shopitems.h index 8bb6719d7..26c5a94e4 100644 --- a/src/gui/models/shopitems.h +++ b/src/gui/models/shopitems.h @@ -132,10 +132,10 @@ class ShopItems final : public ListModel */ void clear(); - std::vector &items() A_WARN_UNUSED + STD_VECTOR &items() A_WARN_UNUSED { return mShopItems; } - std::vector &allItems() A_WARN_UNUSED + STD_VECTOR &allItems() A_WARN_UNUSED { return mAllShopItems; } void setMergeDuplicates(const bool b) @@ -153,13 +153,13 @@ class ShopItems final : public ListModel ShopItem *findItem(const int id, const ItemColor color) const A_WARN_UNUSED; - bool findInAllItems(std::vector::iterator &it, + bool findInAllItems(STD_VECTOR::iterator &it, const ShopItem *const item); /** The list of items in the shop. */ - std::vector mAllShopItems; + STD_VECTOR mAllShopItems; - std::vector mShopItems; + STD_VECTOR mShopItems; std::string mCurrency; diff --git a/src/gui/models/tablemodel.h b/src/gui/models/tablemodel.h index f28a60a6f..23f286c2e 100644 --- a/src/gui/models/tablemodel.h +++ b/src/gui/models/tablemodel.h @@ -146,8 +146,8 @@ class StaticTableModel final : public TableModel int mRows; int mColumns; int mHeight; - std::vector mTableModel; - std::vector mWidths; + STD_VECTOR mTableModel; + STD_VECTOR mWidths; }; #endif // GUI_MODELS_TABLEMODEL_H diff --git a/src/gui/models/touchactionmodel.cpp b/src/gui/models/touchactionmodel.cpp index 7f6b68ef7..1998d2752 100644 --- a/src/gui/models/touchactionmodel.cpp +++ b/src/gui/models/touchactionmodel.cpp @@ -50,7 +50,7 @@ TouchActionsModel::TouchActionsModel() : mActionId(), mActionToSelection() { - std::vector data; + STD_VECTOR data; for (int f = 0, fsz = touchActionDataSize; f < fsz; f ++) { @@ -64,7 +64,7 @@ TouchActionsModel::TouchActionsModel() : std::sort(data.begin(), data.end(), touchActionSorter); int cnt = 0; - FOR_EACH (std::vector::iterator, it, data) + FOR_EACH (STD_VECTOR::iterator, it, data) { const SetupActionData *const data1 = *it; mNames.push_back(data1->name); diff --git a/src/gui/models/touchactionmodel.h b/src/gui/models/touchactionmodel.h index a3ea05c9d..2d8cff02a 100644 --- a/src/gui/models/touchactionmodel.h +++ b/src/gui/models/touchactionmodel.h @@ -42,7 +42,7 @@ class TouchActionsModel final : public NamesModel int getSelectionFromAction(const InputActionT action) const; private: - std::vector mActionId; + STD_VECTOR mActionId; std::map mActionToSelection; }; diff --git a/src/gui/models/updatelistmodel.h b/src/gui/models/updatelistmodel.h index f50072112..cd4ba50c3 100644 --- a/src/gui/models/updatelistmodel.h +++ b/src/gui/models/updatelistmodel.h @@ -40,7 +40,7 @@ class UpdateListModel final : public ListModel mNames(), mServer(server) { - FOR_EACH(std::vector::const_iterator, + FOR_EACH(STD_VECTOR::const_iterator, it, server->updateHosts) { -- cgit v1.2.3-70-g09d2