diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-07-04 03:07:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-07-04 03:41:46 +0300 |
commit | 4b2cb3433c82ba4ba28be8de82e0a49df7f3e388 (patch) | |
tree | 60f063d56d0aa316cfee4c1e1340b69cc992ede1 /src | |
parent | d5eb424dcd214b4646a960e04b9271e70b096856 (diff) | |
download | manaplus-4b2cb3433c82ba4ba28be8de82e0a49df7f3e388.tar.gz manaplus-4b2cb3433c82ba4ba28be8de82e0a49df7f3e388.tar.bz2 manaplus-4b2cb3433c82ba4ba28be8de82e0a49df7f3e388.tar.xz manaplus-4b2cb3433c82ba4ba28be8de82e0a49df7f3e388.zip |
Replace some lists to vectors.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/chatwindow.h | 2 | ||||
-rw-r--r-- | src/gui/gui.cpp | 3 | ||||
-rw-r--r-- | src/gui/ministatus.cpp | 6 | ||||
-rw-r--r-- | src/gui/ministatus.h | 4 | ||||
-rw-r--r-- | src/gui/popupmenu.cpp | 8 | ||||
-rw-r--r-- | src/gui/windowmenu.cpp | 6 | ||||
-rw-r--r-- | src/gui/windowmenu.h | 5 | ||||
-rw-r--r-- | src/net/manaserv/attributes.cpp | 2 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.cpp | 2 | ||||
-rw-r--r-- | src/particleemitter.cpp | 4 | ||||
-rw-r--r-- | src/particleemitter.h | 2 | ||||
-rw-r--r-- | src/resources/itemdb.cpp | 6 | ||||
-rw-r--r-- | src/resources/itemdb.h | 2 | ||||
-rw-r--r-- | src/utils/stringutils.cpp | 4 | ||||
-rw-r--r-- | src/utils/stringutils.h | 2 |
15 files changed, 30 insertions, 28 deletions
diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h index d68fa7671..0c43dcd8e 100644 --- a/src/gui/chatwindow.h +++ b/src/gui/chatwindow.h @@ -317,7 +317,7 @@ class ChatWindow : public Window, bool mReturnToggles; /**< Marks whether <Return> toggles the chat log or not */ - std::list<std::string> mTradeFilter; + std::vector<std::string> mTradeFilter; gcn::DropDown *mColorPicker; ColorListModel *mColorListModel; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 05b168b5e..0bea1d0d7 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -419,7 +419,8 @@ void Gui::distributeMouseEvent(gcn::Widget* source, int type, int button, (*it)->mouseClicked(mouseEvent); break; default: - throw GCN_EXCEPTION("Unknown mouse event type."); + break; +// throw GCN_EXCEPTION("Unknown mouse event type."); } } diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp index 4c57812d5..feaf5e0ca 100644 --- a/src/gui/ministatus.cpp +++ b/src/gui/ministatus.cpp @@ -134,7 +134,7 @@ MiniStatusWindow::~MiniStatusWindow() if (inv) inv->removeInventoyListener(this); - std::list <ProgressBar*>::iterator it, it_end; + std::vector <ProgressBar*>::iterator it, it_end; for (it = mBars.begin(), it_end = mBars.end(); it != it_end; ++it) { ProgressBar *bar = *it; @@ -160,7 +160,7 @@ ProgressBar *MiniStatusWindow::createBar(float progress, int width, int height, void MiniStatusWindow::updateBars() { int x = 0; - std::list <ProgressBar*>::iterator it, it_end; + std::vector <ProgressBar*>::iterator it, it_end; ProgressBar* lastBar = 0; for (it = mBars.begin(), it_end = mBars.end(); it != it_end; ++it) safeRemove(*it); @@ -439,7 +439,7 @@ void MiniStatusWindow::loadBars() void MiniStatusWindow::saveBars() { - std::list <ProgressBar*>::iterator it, it_end; + std::vector <ProgressBar*>::iterator it, it_end; int i = 0; for (it = mBars.begin(), it_end = mBars.end(); it != it_end; ++it) diff --git a/src/gui/ministatus.h b/src/gui/ministatus.h index a2648d44b..0915ba8d4 100644 --- a/src/gui/ministatus.h +++ b/src/gui/ministatus.h @@ -88,7 +88,7 @@ class MiniStatusWindow : public Popup, void slotsChanged(Inventory* inventory); - std::list <ProgressBar*> &getBars() + std::vector <ProgressBar*> &getBars() { return mBars; } private: @@ -116,7 +116,7 @@ class MiniStatusWindow : public Popup, ProgressBar *mStatusBar; TextPopup *mTextPopup; StatusPopup *mStatusPopup; - std::list <ProgressBar*> mBars; + std::vector <ProgressBar*> mBars; std::map <std::string, ProgressBar*> mBarNames; std::vector<AnimatedSprite *> mIcons; diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 33d0425e1..0ede3d122 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -1755,8 +1755,8 @@ void PopupMenu::showPopup(int x, int y, Button *button) mButton = button; mBrowserBox->clearRows(); - std::list <gcn::Button*> names = windowMenu->getButtons(); - std::list <gcn::Button*>::iterator it, it_end; + std::vector <gcn::Button*> names = windowMenu->getButtons(); + std::vector <gcn::Button*>::iterator it, it_end; for (it = names.begin(), it_end = names.end(); it != it_end; ++ it) { Button *btn = dynamic_cast<Button*>(*it); @@ -1790,8 +1790,8 @@ void PopupMenu::showPopup(int x, int y, ProgressBar *b) mNick = b->text(); mBrowserBox->clearRows(); - std::list <ProgressBar*> bars = miniStatusWindow->getBars(); - std::list <ProgressBar*>::iterator it, it_end; + std::vector <ProgressBar*> bars = miniStatusWindow->getBars(); + std::vector <ProgressBar*>::iterator it, it_end; for (it = bars.begin(), it_end = bars.end(); it != it_end; ++it) { ProgressBar *bar = *it; diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index c62ab9bba..e47888a3a 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -117,7 +117,7 @@ WindowMenu::~WindowMenu() delete mTextPopup; mTextPopup = 0; mButtonNames.clear(); - std::list <gcn::Button*>::iterator it, it_end; + std::vector <gcn::Button*>::iterator it, it_end; for (it = mButtons.begin(), it_end = mButtons.end(); it != it_end; ++it) { Button *btn = dynamic_cast<Button*>(*it); @@ -329,7 +329,7 @@ void WindowMenu::showButton(std::string name, bool isVisible) void WindowMenu::updateButtons() { int x = 0, h = 0; - std::list <gcn::Button*>::iterator it, it_end; + std::vector <gcn::Button*>::iterator it, it_end; for (it = mButtons.begin(), it_end = mButtons.end(); it != it_end; ++it) safeRemove(*it); for (it = mButtons.begin(), it_end = mButtons.end(); it != it_end; ++it) @@ -372,7 +372,7 @@ void WindowMenu::loadButtons() void WindowMenu::saveButtons() { - std::list <gcn::Button*>::iterator it, it_end; + std::vector <gcn::Button*>::iterator it, it_end; int i = 0; for (it = mButtons.begin(), it_end = mButtons.end(); it != it_end; ++it) diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h index cebae7c11..503a8c1ad 100644 --- a/src/gui/windowmenu.h +++ b/src/gui/windowmenu.h @@ -30,6 +30,7 @@ #include <guichan/selectionlistener.hpp> #include <map> +#include <vector> #ifdef __GNUC__ #define _UNUSED_ __attribute__ ((unused)) @@ -68,7 +69,7 @@ class WindowMenu : public Container, std::map <std::string, gcn::Button*> &getButtonNames() { return mButtonNames; } - std::list <gcn::Button*> &getButtons() + std::vector <gcn::Button*> &getButtons() { return mButtons; } void showButton(std::string name, bool isVisible); @@ -85,7 +86,7 @@ class WindowMenu : public Container, EmotePopup *mEmotePopup; TextPopup *mTextPopup; - std::list <gcn::Button*> mButtons; + std::vector <gcn::Button*> mButtons; std::map <std::string, gcn::Button*> mButtonNames; }; diff --git a/src/net/manaserv/attributes.cpp b/src/net/manaserv/attributes.cpp index fa95a3d6d..b48cc9eff 100644 --- a/src/net/manaserv/attributes.cpp +++ b/src/net/manaserv/attributes.cpp @@ -380,7 +380,7 @@ namespace Attributes void informItemDB() { - std::list<ItemDB::Stat> dbStats; + std::vector<ItemDB::Stat> dbStats; TagMap::const_iterator it, it_end; for (it = tags.begin(), it_end = tags.end(); it != it_end; ++it) diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index b091267b7..7993c24dc 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -103,7 +103,7 @@ GeneralHandler::GeneralHandler(): handledMessages = _messages; generalHandler = this; - std::list<ItemDB::Stat> stats; + std::vector<ItemDB::Stat> stats; stats.push_back(ItemDB::Stat("str", _("Strength %+d"))); stats.push_back(ItemDB::Stat("agi", _("Agility %+d"))); stats.push_back(ItemDB::Stat("vit", _("Vitality %+d"))); diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index 6b6cca44b..c04b1b36f 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -435,7 +435,7 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter &o) mDeathEffect = o.mDeathEffect; mTempSets = o.mTempSets; - for (std::list<ImageSet*>::iterator + for (std::vector<ImageSet*>::iterator i = mTempSets.begin(); i != mTempSets.end(); ++i) { @@ -453,7 +453,7 @@ ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter &o) ParticleEmitter::~ParticleEmitter() { - for (std::list<ImageSet*>::iterator + for (std::vector<ImageSet*>::iterator i = mTempSets.begin(); i != mTempSets.end(); ++i) { diff --git a/src/particleemitter.h b/src/particleemitter.h index e82483370..49826d0f6 100644 --- a/src/particleemitter.h +++ b/src/particleemitter.h @@ -150,6 +150,6 @@ class ParticleEmitter /** List of emitters the spawned particles are equipped with */ std::list<ParticleEmitter> mParticleChildEmitters; - std::list<ImageSet*> mTempSets; + std::vector<ImageSet*> mTempSets; }; #endif diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index b4e33dfa7..1260fab58 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -65,9 +65,9 @@ static char const *const fields[][2] = { "mp", N_("MP %+d") } }; -static std::list<ItemDB::Stat> extraStats; +static std::vector<ItemDB::Stat> extraStats; -void ItemDB::setStatsList(const std::list<ItemDB::Stat> &stats) +void ItemDB::setStatsList(const std::vector<ItemDB::Stat> &stats) { extraStats = stats; } @@ -307,7 +307,7 @@ void ItemDB::load() effect += " / "; effect += strprintf(gettext(fields[i][1]), value); } - for (std::list<Stat>::iterator it = extraStats.begin(); + for (std::vector<Stat>::iterator it = extraStats.begin(); it != extraStats.end(); ++it) { int value = XML::getProperty(node, it->tag.c_str(), 0); diff --git a/src/resources/itemdb.h b/src/resources/itemdb.h index 8c90e6769..ee16a6355 100644 --- a/src/resources/itemdb.h +++ b/src/resources/itemdb.h @@ -77,7 +77,7 @@ namespace ItemDB std::string format; }; - void setStatsList(const std::list<Stat> &stats); + void setStatsList(const std::vector<Stat> &stats); } diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 953cbf58a..ad2e52965 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -181,11 +181,11 @@ unsigned long findI(std::string str, std::string subStr) return str.find(subStr); } -unsigned long findI(std::string str, std::list<std::string> &list) +unsigned long findI(std::string str, std::vector<std::string> &list) { str = toLower(str); unsigned long idx; - for (std::list<std::string>::iterator i = list.begin(); + for (std::vector<std::string>::iterator i = list.begin(); i != list.end(); ++i) { std::string subStr = toLower(*i); diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h index 140baf944..4693b5425 100644 --- a/src/utils/stringutils.h +++ b/src/utils/stringutils.h @@ -133,7 +133,7 @@ bool isWordSeparator(char chr); unsigned long findI(std::string str, std::string subStr); -unsigned long findI(std::string str, std::list<std::string> &list); +unsigned long findI(std::string str, std::vector<std::string> &list); const std::string encodeStr(unsigned int value, unsigned int size = 0); |