From f15bf324a709ce312a5e59a8055ec3e3d9d98204 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Tue, 1 May 2012 17:39:58 +0200 Subject: [PATCH] STL fixes needed to link from StartUp to Personal with MSVC10 The meat comes from the following H-uru/Plasma commits by Branan and Zrax, but I?m not going to replicate that spaghetti history here: commit 3522f7069a4183ccd87e80c0e7e46a01f5b14de6 Author: Michael Hansen Date: Mon Apr 11 13:42:22 2011 -0700 Merge branch 'stlfixups' into numlockfix commit 094cb11bb328b326695cdc75f1f18ca72d135b49 Author: Michael Hansen Date: Mon Apr 11 11:53:11 2011 -0700 Don't need to de-iteratorize this one commit 498dead64dc0b46bf24055980ba997ff2dfa05b4 Author: Michael Hansen Date: Mon Apr 11 01:44:53 2011 -0700 Don't change the iteration order commit e004491eab00edc312cef5ba08653745695f277e Author: Branan Purvine-Riley Date: Sun Apr 10 23:20:08 2011 -0700 STL fixes needed to link from StartUp to Personal --- .../PubUtilLib/plAvatar/plAGAnimInstance.cpp | 4 ++-- .../Plasma/PubUtilLib/plAvatar/plAGModifier.cpp | 14 ++++++-------- .../PubUtilLib/plPhysical/plCollisionDetector.cpp | 4 ++-- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp index c348ea53..ccb5e04a 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp @@ -258,10 +258,10 @@ void plAGAnimInstance::DetachChannels() do { plAGChannel *channel = (*i).second; channelMod->DetachChannel(channel); - } while (i != fManualDetachChannels.end() && (*++i).first == channelName); + } while (++i != fManualDetachChannels.end() && i->first == channelName); } else { do { - } while (i != fManualDetachChannels.end() && (*++i).first == channelName); + } while (++i != fManualDetachChannels.end() && i->first == channelName); } } diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp index c510f33b..e838bf20 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp @@ -244,9 +244,8 @@ plAGChannel * plAGModifier::MergeChannel(plAGApplicator *app, hsBool plAGModifier::DetachChannel(plAGChannel * channel) { plAppTable::iterator i = fApps.begin(); - hsBool done = false; - for( ; i != fApps.end(); i++) + while( i != fApps.end() ) { plAGApplicator *app = *i; plAGChannel *existingChannel = app->GetChannel(); @@ -259,17 +258,16 @@ hsBool plAGModifier::DetachChannel(plAGChannel * channel) app->SetChannel(replacementChannel); if( ! replacementChannel && app->AutoDelete()) { - plAppTable::iterator old = i; - i--; - fApps.erase(old); + // Don't need to adjust the iterator since we're about to exit the loop + fApps.erase(i); delete app; } - done = true; - break; + return true; } } + ++i; } - return done; + return false; } // READ diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp index 1c8e623e..a2ea1df0 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp @@ -640,7 +640,7 @@ void plObjectInVolumeDetector::IHandleEval(plEvalMsg* pEval) { plgDispatch::Dispatch()->UnRegisterForExactType(plEvalMsg::Index(), GetKey()); fWaitingForEval = false; - for(bookKeepingList::iterator it= (--fCollisionList.end());it!=(--fCollisionList.begin()); it--) + for(bookKeepingList::reverse_iterator it= fCollisionList.rbegin();it!=fCollisionList.rend(); it++) { bool alreadyInside; ResidentSet::iterator HitIt; @@ -1168,4 +1168,4 @@ hsBool plRidingAnimatedPhysicalDetector::MsgReceive(plMessage *msg) return true; } return plSimpleRegionSensor::MsgReceive(msg); -} \ No newline at end of file +}