From 93666ef53c284c2aae282949729bcd9ff53b5c2a Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Wed, 25 Feb 2009 08:53:58 +0000 Subject: Updated all for(;;) loops to use prefix increment on iterators. svn-id: r38876 --- engines/parallaction/exec_ns.cpp | 6 +++--- engines/parallaction/graphics.cpp | 4 ++-- engines/parallaction/parallaction.cpp | 14 +++++++------- engines/parallaction/parallaction_br.cpp | 2 +- engines/parallaction/parallaction_ns.cpp | 2 +- engines/parallaction/parser_br.cpp | 2 +- engines/parallaction/walk.cpp | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp index 0c802f3249..bc3cc261ef 100644 --- a/engines/parallaction/exec_ns.cpp +++ b/engines/parallaction/exec_ns.cpp @@ -309,7 +309,7 @@ void ProgramExec::runScript(ProgramPtr script, AnimationPtr a) { inst = _ctxt.ip; _ctxt.inst = inst; - _ctxt.ip++; + ++_ctxt.ip; debugC(9, kDebugExec, "inst [%02i] %s\n", (*inst)->_index, _instructionNames[(*inst)->_index - 1]); @@ -330,7 +330,7 @@ void ProgramExec::runScripts(ProgramList::iterator first, ProgramList::iterator return; } - for (ProgramList::iterator it = first; it != last; it++) { + for (ProgramList::iterator it = first; it != last; ++it) { AnimationPtr a = (*it)->_anim; @@ -359,7 +359,7 @@ void CommandExec::runList(CommandList::iterator first, CommandList::iterator las _suspend = false; _running = true; - for ( ; first != last; first++) { + for ( ; first != last; ++first) { if (_vm->shouldQuit()) break; diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index b9821bb4b3..921aa7e913 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -844,7 +844,7 @@ bool BackgroundInfo::hasMask() { void BackgroundInfo::clearMaskData() { // free mask data MaskPatches::iterator it = _maskPatches.begin(); - for ( ; it != _maskPatches.end(); it++) { + for ( ; it != _maskPatches.end(); ++it) { delete *it; } _maskPatches.clear(); @@ -905,7 +905,7 @@ bool BackgroundInfo::hasPath() { void BackgroundInfo::clearPathData() { // free mask data PathPatches::iterator it = _pathPatches.begin(); - for ( ; it != _pathPatches.end(); it++) { + for ( ; it != _pathPatches.end(); ++it) { delete *it; } _pathPatches.clear(); diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 5193433eea..85321237ac 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -205,14 +205,14 @@ void Parallaction::resumeJobs() { AnimationPtr Location::findAnimation(const char *name) { - for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) + for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); ++it) if (!scumm_stricmp((*it)->_name, name)) return *it; return nullAnimationPtr; } void Location::freeAnimations() { - for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) { + for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); ++it) { (*it)->_commands.clear(); // See comment for freeZones(), about circular references. } _animations.clear(); @@ -492,7 +492,7 @@ void Parallaction::updateZones() { debugC(9, kDebugExec, "Parallaction::updateZones()\n"); // go through all animations and mark/unmark each of them for display - for (AnimationList::iterator ait = _location._animations.begin(); ait != _location._animations.end(); ait++) { + for (AnimationList::iterator ait = _location._animations.begin(); ait != _location._animations.end(); ++ait) { AnimationPtr anim = *ait; if ((anim->_flags & kFlagsRemove) != 0) { // marks the animation as invisible for this frame @@ -505,7 +505,7 @@ void Parallaction::updateZones() { } // examine the list of get zones to update - for (ZoneList::iterator zit = _zonesToUpdate.begin(); zit != _zonesToUpdate.end(); zit++) { + for (ZoneList::iterator zit = _zonesToUpdate.begin(); zit != _zonesToUpdate.end(); ++zit) { ZonePtr z = *zit; if (ACTIONTYPE(z) == kZoneGet) { GfxObj *obj = z->u.get->gfxobj; @@ -762,7 +762,7 @@ ZonePtr Parallaction::hitZone(uint32 type, uint16 x, uint16 y) { uint16 _di = y; uint16 _si = x; - for (ZoneList::iterator it = _location._zones.begin(); it != _location._zones.end(); it++) { + for (ZoneList::iterator it = _location._zones.begin(); it != _location._zones.end(); ++it) { if (checkLinkedAnimBox(*it, type, x, y)) { return *it; } @@ -774,7 +774,7 @@ ZonePtr Parallaction::hitZone(uint32 type, uint16 x, uint16 y) { int16 _a, _b, _c, _d; bool _ef; - for (AnimationList::iterator ait = _location._animations.begin(); ait != _location._animations.end(); ait++) { + for (AnimationList::iterator ait = _location._animations.begin(); ait != _location._animations.end(); ++ait) { AnimationPtr a = *ait; @@ -795,7 +795,7 @@ ZonePtr Parallaction::hitZone(uint32 type, uint16 x, uint16 y) { ZonePtr Location::findZone(const char *name) { - for (ZoneList::iterator it = _zones.begin(); it != _zones.end(); it++) { + for (ZoneList::iterator it = _zones.begin(); it != _zones.end(); ++it) { if (!scumm_stricmp((*it)->_name, name)) return *it; } return findAnimation(name); diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index cb81bf1646..7d71a72666 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -308,7 +308,7 @@ void Parallaction_br::parseLocation(const char *filename) { // this loads animation scripts AnimationList::iterator it = _location._animations.begin(); - for ( ; it != _location._animations.end(); it++) { + for ( ; it != _location._animations.end(); ++it) { if ((*it)->_scriptName) { loadProgram(*it, (*it)->_scriptName); } diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index bacc67577d..dfe5cf4e69 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -390,7 +390,7 @@ void Parallaction_ns::parseLocation(const char *filename) { // this loads animation scripts AnimationList::iterator it = _location._animations.begin(); - for ( ; it != _location._animations.end(); it++) { + for ( ; it != _location._animations.end(); ++it) { if ((*it)->_scriptName) { loadProgram(*it, (*it)->_scriptName); } diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index eeaf132b9e..71a50ad5fa 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -1258,7 +1258,7 @@ void LocationParser_br::parse(Script *script) { _vm->_gfx->setBackground(kBackgroundLocation, ctxt.info); ZoneList::iterator it = _vm->_location._zones.begin(); - for ( ; it != _vm->_location._zones.end(); it++) { + for ( ; it != _vm->_location._zones.end(); ++it) { bool visible = ((*it)->_flags & kFlagsRemove) == 0; if (visible) _vm->showZone((*it), visible); diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index fccc9def4f..f6ba1c2615 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -429,7 +429,7 @@ void PathWalker_BR::buildPath(State &s, uint16 x, uint16 y) { PointList::iterator b = z1->u.path->_lists[id].begin(); PointList::iterator e = z1->u.path->_lists[id].end(); - for ( ; b != e; b++) { + for ( ; b != e; ++b) { s._walkPath.push_front(*b); } s._walkPath.push_back(dest); -- cgit v1.2.3