diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-08 00:07:56 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-08 00:07:56 +0300 |
commit | b3f70d8d46199524edc590269a73c262899763c7 (patch) | |
tree | af8e20371f2cc825c0b2dbe0c0e5c392a926c46d /src/resources | |
parent | 3f84fc198131ff706e18c56f612e38ff147b0005 (diff) | |
download | manaplus-b3f70d8d46199524edc590269a73c262899763c7.tar.gz manaplus-b3f70d8d46199524edc590269a73c262899763c7.tar.bz2 manaplus-b3f70d8d46199524edc590269a73c262899763c7.tar.xz manaplus-b3f70d8d46199524edc590269a73c262899763c7.zip |
Replace most iterator to const_iterator.
Some other minor changes.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/image.cpp | 4 | ||||
-rw-r--r-- | src/resources/itemdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/iteminfo.cpp | 6 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 2 | ||||
-rw-r--r-- | src/resources/specialdb.cpp | 2 | ||||
-rw-r--r-- | src/resources/spritedef.cpp | 2 | ||||
-rw-r--r-- | src/resources/wallpaper.cpp | 2 |
7 files changed, 11 insertions, 9 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 802f2ee12..e28cb2bc5 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -336,7 +336,7 @@ bool Image::hasAlphaChannel() SDL_Surface *Image::getByAlpha(float alpha) { - std::map<float, SDL_Surface*>::iterator it = mAlphaCache.find(alpha); + std::map<float, SDL_Surface*>::const_iterator it = mAlphaCache.find(alpha); if (it != mAlphaCache.end()) return (*it).second; return 0; @@ -361,7 +361,7 @@ void Image::setAlpha(float alpha) { #ifdef DEBUG_ALPHA_CACHE logger->log("cleanCache"); - for (std::map<float, SDL_Surface*>::iterator + for (std::map<float, SDL_Surface*>::const_iterator i = mAlphaCache.begin(), i_end = mAlphaCache.end(); i != i_end; ++i) { diff --git a/src/resources/itemdb.cpp b/src/resources/itemdb.cpp index 733c12958..89df407a6 100644 --- a/src/resources/itemdb.cpp +++ b/src/resources/itemdb.cpp @@ -308,7 +308,7 @@ void ItemDB::load() effect += " / "; effect += strprintf(gettext(fields[i][1]), value); } - for (std::vector<Stat>::iterator it = extraStats.begin(); + for (std::vector<Stat>::const_iterator it = extraStats.begin(); it != extraStats.end(); ++it) { int value = XML::getProperty(node, it->tag.c_str(), 0); diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index fb4b8ed5e..75e6e1d8c 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -185,7 +185,8 @@ std::string ItemInfo::getDyeColorsString(int color) const if (!mColors || mColorList.empty()) return ""; - std::map <int, ColorDB::ItemColor>::iterator it = mColors->find(color); + std::map <int, ColorDB::ItemColor>::const_iterator + it = mColors->find(color); if (it == mColors->end()) return ""; @@ -208,7 +209,8 @@ const std::string ItemInfo::replaceColors(std::string str, std::string name; if (mColors && !mColorList.empty()) { - std::map <int, ColorDB::ItemColor>::iterator it = mColors->find(color); + std::map <int, ColorDB::ItemColor>::const_iterator + it = mColors->find(color); if (it == mColors->end()) name = "unknown"; else diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 685d415ff..f702864ea 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -734,7 +734,7 @@ Tileset *MapReader::readTileset(xmlNodePtr node, const std::string &path, Animation *ani = new Animation; for (int i = 0; ; i++) { - std::map<std::string, int>::iterator iFrame, iDelay; + std::map<std::string, int>::const_iterator iFrame, iDelay; iFrame = tileProperties.find( "animation-frame" + toString(i)); iDelay = tileProperties.find( diff --git a/src/resources/specialdb.cpp b/src/resources/specialdb.cpp index 573ffb2a3..2463da06a 100644 --- a/src/resources/specialdb.cpp +++ b/src/resources/specialdb.cpp @@ -123,7 +123,7 @@ void SpecialDB::unload() SpecialInfo *SpecialDB::get(int id) { - SpecialInfos::iterator i = mSpecialInfos.find(id); + SpecialInfos::const_iterator i = mSpecialInfos.find(id); if (i == mSpecialInfos.end()) return NULL; diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index dee93e1e7..2e32f6c5f 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -86,7 +86,7 @@ void SpriteDef::substituteAction(std::string complete, std::string with) { if (mActions.find(complete) == mActions.end()) { - Actions::iterator i = mActions.find(with); + Actions::const_iterator i = mActions.find(with); if (i != mActions.end()) mActions[complete] = i->second; } diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp index 09c9f2a04..5cfec3b84 100644 --- a/src/resources/wallpaper.cpp +++ b/src/resources/wallpaper.cpp @@ -137,7 +137,7 @@ void Wallpaper::loadWallpapers() std::string Wallpaper::getWallpaper(int width, int height) { - std::vector<WallpaperData>::iterator iter; + std::vector<WallpaperData>::const_iterator iter; WallpaperData wp; // Wallpaper filename container |