Ticket #1064: iterator-fix.patch
File iterator-fix.patch, 10.2 KB (added by , 12 years ago) |
---|
-
source/ps/Profile.cpp
274 274 CProfileNode::~CProfileNode() 275 275 { 276 276 profile_iterator it; 277 for( it = children.begin(); it != children.end(); it++)277 for( it = children.begin(); it != children.end(); ++it ) 278 278 delete( *it ); 279 for( it = script_children.begin(); it != script_children.end(); it++)279 for( it = script_children.begin(); it != script_children.end(); ++it ) 280 280 delete( *it ); 281 281 282 282 delete display_table; … … 323 323 const CProfileNode* CProfileNode::GetChild( const char* childName ) const 324 324 { 325 325 const_profile_iterator it; 326 for( it = children.begin(); it != children.end(); it++)326 for( it = children.begin(); it != children.end(); ++it ) 327 327 if( (*it)->name == childName ) 328 328 return( *it ); 329 329 … … 333 333 const CProfileNode* CProfileNode::GetScriptChild( const char* childName ) const 334 334 { 335 335 const_profile_iterator it; 336 for( it = script_children.begin(); it != script_children.end(); it++)336 for( it = script_children.begin(); it != script_children.end(); ++it ) 337 337 if( (*it)->name == childName ) 338 338 return( *it ); 339 339 -
source/ps/CConsole.cpp
257 257 for (Iter = m_deqMsgHistory.begin(); 258 258 Iter != m_deqMsgHistory.end() 259 259 && (((i - m_iMsgHistPos + 1) * m_iFontHeight) < m_fHeight); 260 Iter++)260 ++Iter) 261 261 { 262 262 if (i >= m_iMsgHistPos){ 263 263 glTranslatef(0.0f, -(float)m_iFontHeight, 0.0f); -
source/ps/Hotkey.cpp
115 115 116 116 std::vector<SKey>::iterator itKey, itKey2; 117 117 118 for( itKey = keyCombination.begin(); itKey != keyCombination.end(); itKey++)118 for( itKey = keyCombination.begin(); itKey != keyCombination.end(); ++itKey ) 119 119 { 120 120 SHotkeyMapping bindCode; 121 121 122 122 bindCode.name = hotkeyName; 123 123 bindCode.negated = itKey->negated; 124 124 125 for( itKey2 = keyCombination.begin(); itKey2 != keyCombination.end(); itKey2++)125 for( itKey2 = keyCombination.begin(); itKey2 != keyCombination.end(); ++itKey2 ) 126 126 { 127 127 // Push any auxiliary keys. 128 128 if( itKey != itKey2 ) … … 149 149 { 150 150 KeyMapping& hotkeyMap = mapIt->second; 151 151 152 for( std::vector<SHotkeyMapping>::iterator it = hotkeyMap.begin(); it != hotkeyMap.end(); it++)152 for( std::vector<SHotkeyMapping>::iterator it = hotkeyMap.begin(); it != hotkeyMap.end(); ++it ) 153 153 { 154 154 if( !it->negated ) 155 155 continue; 156 156 157 157 bool allNegated = true; 158 158 159 for( std::vector<SKey>::iterator j = it->requires.begin(); j != it->requires.end(); j++)159 for( std::vector<SKey>::iterator j = it->requires.begin(); j != it->requires.end(); ++j ) 160 160 if( !j->negated ) 161 161 allNegated = false; 162 162 … … 263 263 std::vector<const char*> closestMapNames; 264 264 size_t closestMapMatch = 0; 265 265 266 for( std::vector<SHotkeyMapping>::iterator it = g_HotkeyMap[keycode].begin(); it < g_HotkeyMap[keycode].end(); it++)266 for( std::vector<SHotkeyMapping>::iterator it = g_HotkeyMap[keycode].begin(); it < g_HotkeyMap[keycode].end(); ++it ) 267 267 { 268 268 // If a key has been pressed, and this event triggers on its release, skip it. 269 269 // Similarly, if the key's been released and the event triggers on a keypress, skip it. … … 274 274 275 275 bool accept = true; 276 276 277 for( std::vector<SKey>::iterator itKey = it->requires.begin(); itKey != it->requires.end(); itKey++)277 for( std::vector<SKey>::iterator itKey = it->requires.begin(); itKey != it->requires.end(); ++itKey ) 278 278 { 279 279 bool rqdState = !itKey->negated; 280 280 … … 326 326 327 327 // -- KEYUP SECTION -- 328 328 329 for( std::vector<SHotkeyMapping>::iterator it = g_HotkeyMap[keycode].begin(); it < g_HotkeyMap[keycode].end(); it++)329 for( std::vector<SHotkeyMapping>::iterator it = g_HotkeyMap[keycode].begin(); it < g_HotkeyMap[keycode].end(); ++it ) 330 330 { 331 331 // If it's a keydown event, won't cause HotKeyUps in anything that doesn't 332 332 // use this key negated => skip them … … 339 339 340 340 bool accept = true; 341 341 342 for( std::vector<SKey>::iterator itKey = it->requires.begin(); itKey != it->requires.end(); itKey++)342 for( std::vector<SKey>::iterator itKey = it->requires.begin(); itKey != it->requires.end(); ++itKey ) 343 343 { 344 344 bool rqdState = !itKey->negated; 345 345 -
source/network/fsm.cpp
126 126 bool eval = true; 127 127 128 128 CallbackList::const_iterator it = m_Conditions.begin(); 129 for( ; it != m_Conditions.end(); it++)129 for( ; it != m_Conditions.end(); ++it ) 130 130 { 131 131 if ( it->pFunction ) 132 132 { … … 149 149 bool result = true; 150 150 151 151 CallbackList::const_iterator it = m_Actions.begin(); 152 for( ; it != m_Actions.end(); it++)152 for( ; it != m_Actions.end(); ++it ) 153 153 { 154 154 if ( it->pFunction ) 155 155 { … … 200 200 { 201 201 // Release transitions 202 202 TransitionList::iterator itTransition = m_Transitions.begin(); 203 for ( ; itTransition < m_Transitions.end(); itTransition++)203 for ( ; itTransition < m_Transitions.end(); ++itTransition ) 204 204 { 205 205 CFsmTransition* pCurrTransition = *itTransition; 206 206 if ( !pCurrTransition ) continue; … … 210 210 211 211 // Release events 212 212 EventMap::iterator itEvent = m_Events.begin(); 213 for( ; itEvent != m_Events.end(); itEvent++)213 for( ; itEvent != m_Events.end(); ++itEvent ) 214 214 { 215 215 CFsmEvent* pCurrEvent = itEvent->second; 216 216 if ( !pCurrEvent ) continue; … … 335 335 336 336 // Loop through the list of transitions 337 337 TransitionList::const_iterator it = m_Transitions.begin(); 338 for ( ; it != m_Transitions.end(); it++)338 for ( ; it != m_Transitions.end(); ++it ) 339 339 { 340 340 CFsmTransition* pCurrTransition = *it; 341 341 if ( !pCurrTransition ) continue; -
source/tools/atlas/GameInterface/Handlers/CinemaHandler.cpp
76 76 const std::map<CStrW, CCinemaPath>& paths = g_Game->GetView()->GetCinema()->GetAllPaths(); 77 77 std::vector<sCinemaPath> atlasPaths; 78 78 79 for ( std::map<CStrW, CCinemaPath>::const_iterator it=paths.begin(); it!=paths.end(); it++)79 for ( std::map<CStrW, CCinemaPath>::const_iterator it=paths.begin(); it!=paths.end(); ++it ) 80 80 { 81 81 sCinemaPath path = ConstructCinemaPath(&it->second); 82 82 path.name = it->first; … … 108 108 { 109 109 std::map<CStrW, CCinemaPath> paths; 110 110 111 for ( std::vector<sCinemaPath>::const_iterator it=atlasPaths.begin(); it!=atlasPaths.end(); it++)111 for ( std::vector<sCinemaPath>::const_iterator it=atlasPaths.begin(); it!=atlasPaths.end(); ++it ) 112 112 { 113 113 CStrW pathName(*it->name); 114 114 paths[pathName] = CCinemaPath(); -
source/graphics/MapWriter.cpp
342 342 { 343 343 XML_Element("Paths"); 344 344 345 for ( ; it != paths.end(); it++)345 for ( ; it != paths.end(); ++it ) 346 346 { 347 347 CStrW name = it->first; 348 348 float timescale = it->second.GetTimescale(); -
source/scripting/ScriptableObject.h
240 240 { 241 241 JSFunctionSpec* JSI_methods = new JSFunctionSpec[ m_Methods.size() + 1 ]; 242 242 size_t MethodID; 243 for( MethodID = 0; MethodID < m_Methods.size(); MethodID++)243 for( MethodID = 0; MethodID < m_Methods.size(); ++MethodID ) 244 244 JSI_methods[MethodID] = m_Methods[MethodID]; 245 245 246 246 JSI_methods[MethodID].name = 0; … … 255 255 static void ScriptingShutdown() 256 256 { 257 257 PropertyTable::iterator it; 258 for( it = m_NativeProperties.begin(); it != m_NativeProperties.end(); it++)258 for( it = m_NativeProperties.begin(); it != m_NativeProperties.end(); ++it ) 259 259 delete( it->second ); 260 260 m_NativeProperties.clear(); 261 261 } … … 451 451 void Shutdown() 452 452 { 453 453 PropertyTable::iterator it; 454 for( it = m_ScriptProperties.begin(); it != m_ScriptProperties.end(); it++)454 for( it = m_ScriptProperties.begin(); it != m_ScriptProperties.end(); ++it ) 455 455 delete( it->second ); 456 456 m_ScriptProperties.clear(); 457 457 ReleaseScriptObject(); 458 458 #ifdef ALLOW_NONSHARED_NATIVES 459 for( it = m_NonsharedProperties.begin(); it != m_NonsharedProperties.end(); it++)459 for( it = m_NonsharedProperties.begin(); it != m_NonsharedProperties.end(); ++it ) 460 460 delete( it->second ); 461 461 m_NonsharedProperties.clear(); 462 462 #endif -
source/renderer/TerrainRenderer.cpp
171 171 bool TerrainRenderer::CullPatches(const CFrustum* frustum) 172 172 { 173 173 m->filteredPatches.clear(); 174 for (std::vector<CPatchRData*>::iterator it = m->visiblePatches.begin(); it != m->visiblePatches.end(); it++)174 for (std::vector<CPatchRData*>::iterator it = m->visiblePatches.begin(); it != m->visiblePatches.end(); ++it) 175 175 { 176 176 if (frustum->IsBoxVisible(CVector3D(0, 0, 0), (*it)->GetPatch()->GetWorldBounds())) 177 177 m->filteredPatches.push_back(*it); 178 178 } 179 179 180 180 m->filteredDecals.clear(); 181 for (std::vector<CDecalRData*>::iterator it = m->visibleDecals.begin(); it != m->visibleDecals.end(); it++)181 for (std::vector<CDecalRData*>::iterator it = m->visibleDecals.begin(); it != m->visibleDecals.end(); ++it) 182 182 { 183 183 if (frustum->IsBoxVisible(CVector3D(0, 0, 0), (*it)->GetDecal()->GetWorldBounds())) 184 184 m->filteredDecals.push_back(*it); -
source/simulation2/components/CCmpRallyPointRenderer.cpp
841 841 } 842 842 else 843 843 { 844 it++;844 ++it; 845 845 } 846 846 } 847 847 }