]> git.mxchange.org Git - simgear.git/commitdiff
Fix cppcheck performance warning : Prefer prefix ++/-- operators for non-primitive...
authorFrederic Bouvier <fredfgfs01@free.fr>
Fri, 28 Jan 2011 12:47:26 +0000 (13:47 +0100)
committerFrederic Bouvier <fredfgfs01@free.fr>
Sun, 30 Jan 2011 20:22:06 +0000 (21:22 +0100)
simgear/environment/visual_enviro.cxx
simgear/scene/model/animation.cxx
simgear/scene/model/shadowvolume.cxx
simgear/structure/commands.cxx
simgear/structure/subsystem_mgr.cxx

index b77cefcbab44eec15016bfbe6331135d7418bcd5..e36ad253063a69e296a2dcb691253fa2fb221e59 100644 (file)
@@ -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();
index dae46ea283f2ff8947aad812f0cd7095685900ea..3511334288121913255408f918fbf564906b0b96 100644 (file)
@@ -2090,7 +2090,7 @@ public:
   virtual bool buttonPressed(int button, const Info&)
   {
     bool found = false;
-    for( std::vector<int>::iterator it = _buttons.begin(); it != _buttons.end(); it++ ) {
+    for( std::vector<int>::iterator it = _buttons.begin(); it != _buttons.end(); ++it ) {
       if( *it == button ) {
         found = true;
         break;
index 3a164a16509772653f7cc529af31c355fbe92ade..88c652d5ebc1ce586d9114e1c848dc5128a6b917 100644 (file)
@@ -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();
index 6f6db1c661bad0544adb28150c0e946b22684a0c..fd67ae4fc3edebac035ca0f5cf02ea86a48853fd 100644 (file)
@@ -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;
 }
index 387d097a091bd855ebfe189aeb38b092135ded59..6e5b42411ff4de7acbf75a176a25b45ea93f049e 100644 (file)
@@ -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 {