From: Frederic Bouvier Date: Fri, 28 Jan 2011 12:47:26 +0000 (+0100) Subject: Fix cppcheck performance warning : Prefer prefix ++/-- operators for non-primitive... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=29c8c9f989ed1201de106b9f42801e60ea1a07d5;p=simgear.git Fix cppcheck performance warning : Prefer prefix ++/-- operators for non-primitive types. --- diff --git a/simgear/environment/visual_enviro.cxx b/simgear/environment/visual_enviro.cxx index b77cefcb..e36ad253 100644 --- a/simgear/environment/visual_enviro.cxx +++ b/simgear/environment/visual_enviro.cxx @@ -192,7 +192,7 @@ SGEnviro::~SGEnviro(void) { // OSGFIXME return; list_of_lightning::iterator iLightning; - for( iLightning = lightnings.begin() ; iLightning != lightnings.end() ; iLightning++ ) { + for( iLightning = lightnings.begin() ; iLightning != lightnings.end() ; ++iLightning ) { delete (*iLightning); } lightnings.clear(); diff --git a/simgear/scene/model/animation.cxx b/simgear/scene/model/animation.cxx index dae46ea2..35113342 100644 --- a/simgear/scene/model/animation.cxx +++ b/simgear/scene/model/animation.cxx @@ -2090,7 +2090,7 @@ public: virtual bool buttonPressed(int button, const Info&) { bool found = false; - for( std::vector::iterator it = _buttons.begin(); it != _buttons.end(); it++ ) { + for( std::vector::iterator it = _buttons.begin(); it != _buttons.end(); ++it ) { if( *it == button ) { found = true; break; diff --git a/simgear/scene/model/shadowvolume.cxx b/simgear/scene/model/shadowvolume.cxx index 3a164a16..88c652d5 100644 --- a/simgear/scene/model/shadowvolume.cxx +++ b/simgear/scene/model/shadowvolume.cxx @@ -546,7 +546,7 @@ void SGShadowVolume::SceneryObject::computeShadows(void) { sgSetVec4( rotation[3], 0, 0, 0, 1); ShadowCaster_list::iterator iShadowCaster; - for(iShadowCaster = parts.begin() ; iShadowCaster != parts.end() ; iShadowCaster ++ ) { + for(iShadowCaster = parts.begin() ; iShadowCaster != parts.end() ; ++iShadowCaster ) { (*iShadowCaster)->computeShadows(rotation, rotation_translation, occluder_type); } } @@ -720,7 +720,7 @@ SGShadowVolume::SceneryObject::SceneryObject(ssgBranch *_scenery_object, Occlude SGShadowVolume::SceneryObject::~SceneryObject() { ShadowCaster_list::iterator iParts; - for(iParts = parts.begin() ; iParts != parts.end(); iParts++ ) { + for(iParts = parts.begin() ; iParts != parts.end(); ++iParts ) { delete *iParts; } parts.clear(); @@ -864,7 +864,7 @@ SGShadowVolume::SGShadowVolume( ssgBranch *root ) : SGShadowVolume::~SGShadowVolume() { SceneryObject_map::iterator iSceneryObject; - for(iSceneryObject = sceneryObjects.begin() ; iSceneryObject != sceneryObjects.end(); iSceneryObject++ ) { + for(iSceneryObject = sceneryObjects.begin() ; iSceneryObject != sceneryObjects.end(); ++iSceneryObject ) { delete iSceneryObject->second; } sceneryObjects.clear(); diff --git a/simgear/structure/commands.cxx b/simgear/structure/commands.cxx index 6f6db1c6..fd67ae4f 100644 --- a/simgear/structure/commands.cxx +++ b/simgear/structure/commands.cxx @@ -74,7 +74,7 @@ SGCommandMgr::getCommandNames () const command_map::const_iterator last = _commands.end(); while (it != last) { names.push_back(it->first); - it++; + ++it; } return names; } diff --git a/simgear/structure/subsystem_mgr.cxx b/simgear/structure/subsystem_mgr.cxx index 387d097a..6e5b4241 100644 --- a/simgear/structure/subsystem_mgr.cxx +++ b/simgear/structure/subsystem_mgr.cxx @@ -84,7 +84,7 @@ SGSubsystem::printTimingInformation () SGTimeStamp startTime; for ( eventTimeVecIterator i = timingInfo.begin(); i != timingInfo.end(); - i++) { + ++i) { if (i == timingInfo.begin()) { startTime = i->getTime(); } else {