WINTERMUTE: Use ++it instead of it++

This commit is contained in:
Einar Johan Trøan Sømåen 2012-08-31 19:42:53 +02:00
parent 8cf7d765c0
commit 158a206086
8 changed files with 20 additions and 20 deletions

View File

@ -165,7 +165,7 @@ bool BaseFileManager::initPaths() {
}
bool BaseFileManager::registerPackages(const Common::FSList &fslist) {
for (Common::FSList::const_iterator it = fslist.begin(); it != fslist.end(); it++) {
for (Common::FSList::const_iterator it = fslist.begin(); it != fslist.end(); ++it) {
debugC(kWintermuteDebugFileAccess, "Adding %s", (*it).getName().c_str());
if ((*it).getName().contains(".dcp")) {
if (registerPackage((*it))) {
@ -183,10 +183,10 @@ bool BaseFileManager::registerPackages() {
// Register without using SearchMan, as otherwise the FSNode-based lookup in openPackage will fail
// and that has to be like that to support the detection-scheme.
Common::FSList files;
for (Common::FSList::iterator it = _packagePaths.begin(); it != _packagePaths.end(); it++) {
for (Common::FSList::iterator it = _packagePaths.begin(); it != _packagePaths.end(); ++it) {
debugC(kWintermuteDebugFileAccess, "Should register folder: %s %s", (*it).getPath().c_str(), (*it).getName().c_str());
(*it).getChildren(files, Common::FSNode::kListFilesOnly);
for (Common::FSList::iterator fileIt = files.begin(); fileIt != files.end(); fileIt++) {
for (Common::FSList::iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
if (!fileIt->getName().hasSuffix(".dcp")) {
continue;
}

View File

@ -169,7 +169,7 @@ uint32 BasePersistenceManager::getMaxUsedSlot() {
Common::StringArray saves = g_system->getSavefileManager()->listSavefiles(saveMask);
Common::StringArray::iterator it = saves.begin();
int ret = -1;
for (; it != saves.end(); it++) {
for (; it != saves.end(); ++it) {
int num = -1;
sscanf(it->c_str(), "save%d", &num);
ret = MAX(ret, num);

View File

@ -94,7 +94,7 @@ bool diskFileExists(const Common::String &filename) {
Common::ArchiveMemberList files;
SearchMan.listMatchingMembers(files, filename);
for (Common::ArchiveMemberList::iterator it = files.begin(); it != files.end(); it++) {
for (Common::ArchiveMemberList::iterator it = files.begin(); it != files.end(); ++it) {
if ((*it)->getName() == filename) {
return true;
}
@ -124,7 +124,7 @@ Common::SeekableReadStream *openDiskFile(const Common::String &filename) {
Common::ArchiveMemberList files;
SearchMan.listMatchingMembers(files, fixedFilename);
for (Common::ArchiveMemberList::iterator it = files.begin(); it != files.end(); it++) {
for (Common::ArchiveMemberList::iterator it = files.begin(); it != files.end(); ++it) {
if ((*it)->getName() == filename) {
file = (*it)->createReadStream();
break;

View File

@ -228,7 +228,7 @@ PackageSet::PackageSet(Common::FSNode file, const Common::String &filename, bool
}
PackageSet::~PackageSet() {
for (Common::Array<BasePackage *>::iterator it = _packages.begin(); it != _packages.end(); it++) {
for (Common::Array<BasePackage *>::iterator it = _packages.begin(); it != _packages.end(); ++it) {
delete *it;
}
_packages.clear();

View File

@ -275,7 +275,7 @@ BaseSurface *BaseFontTT::renderTextToTexture(const WideString &text, int width,
uint32 useColor = 0xffffffff;
Common::Array<Common::String>::iterator it;
int heightOffset = 0;
for (it = lines.begin(); it != lines.end(); it++) {
for (it = lines.begin(); it != lines.end(); ++it) {
_font->drawString(surface, *it, 0, heightOffset, width, useColor, alignment);
heightOffset += (int)_lineHeight;
}
@ -581,7 +581,7 @@ void BaseFontTT::measureText(const WideString &text, int maxWidth, int maxHeight
_font->wordWrapText(text, maxWidth, lines);
Common::Array<Common::String>::iterator it;
textWidth = 0;
for (it = lines.begin(); it != lines.end(); it++) {
for (it = lines.begin(); it != lines.end(); ++it) {
textWidth = MAX(textWidth, _font->getStringWidth(*it));
}

View File

@ -210,7 +210,7 @@ bool BaseRenderOSystem::flip() {
delete ticket;
} else {
(*it)->_wantsDraw = false;
it++;
++it;
}
}
}
@ -316,7 +316,7 @@ void BaseRenderOSystem::drawSurface(BaseSurfaceOSystem *owner, const Graphics::S
RenderTicket compare(owner, NULL, srcRect, dstRect, mirrorX, mirrorY, disableAlpha);
compare._colorMod = _colorMod;
RenderQueueIterator it;
for (it = _renderQueue.begin(); it != _renderQueue.end(); it++) {
for (it = _renderQueue.begin(); it != _renderQueue.end(); ++it) {
if ((*it)->_owner == owner && *(*it) == compare && (*it)->_isValid) {
(*it)->_colorMod = _colorMod;
if (_disableDirtyRects) {
@ -347,7 +347,7 @@ void BaseRenderOSystem::invalidateTicket(RenderTicket *renderTicket) {
void BaseRenderOSystem::invalidateTicketsFromSurface(BaseSurfaceOSystem *surf) {
RenderQueueIterator it;
for (it = _renderQueue.begin(); it != _renderQueue.end(); it++) {
for (it = _renderQueue.begin(); it != _renderQueue.end(); ++it) {
if ((*it)->_owner == surf) {
invalidateTicket(*it);
}
@ -375,7 +375,7 @@ void BaseRenderOSystem::drawFromTicket(RenderTicket *renderTicket) {
Common::List<RenderTicket *>::iterator it;
renderTicket->_drawNum = _drawNum++;
// Increment the following tickets, so they still are in line
for (it = pos; it != _renderQueue.end(); it++) {
for (it = pos; it != _renderQueue.end(); ++it) {
(*it)->_drawNum++;
(*it)->_wantsDraw = false;
}
@ -393,12 +393,12 @@ void BaseRenderOSystem::drawFromTicket(RenderTicket *renderTicket) {
it = _renderQueue.erase(it);
break;
} else {
it++;
++it;
}
}
if (it != _renderQueue.end()) {
// Decreement the following tickets.
for (; it != _renderQueue.end(); it++) {
for (; it != _renderQueue.end(); ++it) {
(*it)->_drawNum--;
}
}
@ -431,7 +431,7 @@ void BaseRenderOSystem::drawTickets() {
decrement++;
} else {
(*it)->_drawNum -= decrement;
it++;
++it;
}
}
if (!_dirtyRect || _dirtyRect->width() == 0 || _dirtyRect->height() == 0) {
@ -444,7 +444,7 @@ void BaseRenderOSystem::drawTickets() {
// Apply the clear-color to the dirty rect.
_renderSurface->fillRect(*_dirtyRect, _clearColor);
_drawNum = 1;
for (it = _renderQueue.begin(); it != _renderQueue.end(); it++) {
for (it = _renderQueue.begin(); it != _renderQueue.end(); ++it) {
RenderTicket *ticket = *it;
assert(ticket->_drawNum == _drawNum++);
if (ticket->_isValid && ticket->_dstRect.intersects(*_dirtyRect)) {

View File

@ -591,7 +591,7 @@ void ScEngine::dumpStats() {
TimeVector times;
ScriptTimes::iterator it;
for (it = _scriptTimes.begin(); it != _scriptTimes.end(); it++) {
for (it = _scriptTimes.begin(); it != _scriptTimes.end(); ++it) {
times.push_back(std::pair<uint32, std::string> (it->_value, it->_key));
}
std::sort(times.begin(), times.end());
@ -602,7 +602,7 @@ void ScEngine::dumpStats() {
_gameRef->LOG(0, "***** Script profiling information: *****");
_gameRef->LOG(0, " %-40s %fs", "Total execution time", (float)totalTime / 1000);
for (tit = times.rbegin(); tit != times.rend(); tit++) {
for (tit = times.rbegin(); tit != times.rend(); ++tit) {
_gameRef->LOG(0, " %-40s %fs (%f%%)", tit->second.c_str(), (float)tit->first / 1000, (float)tit->first / (float)totalTime * 100);
}*/
}

View File

@ -45,7 +45,7 @@ public:
j = Common::Array<TYPE>::size();
persistMgr->transfer("ArraySize", &j);
typename Common::Array<TYPE>::const_iterator it = Common::Array<TYPE>::begin();
for (; it != Common::Array<TYPE>::end(); it++) {
for (; it != Common::Array<TYPE>::end(); ++it) {
TYPE obj = *it;
persistMgr->transfer("", &obj);
}