Commit: 7952ece01b0d040b87b1452ef2d19bd4674ae600
Author: Gaia Clary
Date:   Sun Mar 11 20:12:55 2018 +0100
Branches: master
https://developer.blender.org/rB7952ece01b0d040b87b1452ef2d19bd4674ae600

Cleanup: avoid redeclaration of iterator in same function

The iterator was redeclared 3 times. I fixed this to avoid future issues.
I commit separately because so the changes are less cluttered all over
the place.

===================================================================

M       source/blender/collada/DocumentImporter.cpp

===================================================================

diff --git a/source/blender/collada/DocumentImporter.cpp 
b/source/blender/collada/DocumentImporter.cpp
index f7fdfb06a40..19825afc758 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -190,8 +190,8 @@ void DocumentImporter::finish()
        std::vector<Object *> *objects_to_scale = new std::vector<Object *>();
 
        /** TODO Break up and put into 2-pass parsing of DAE */
-       std::vector<const COLLADAFW::VisualScene *>::iterator it;
-       for (it = vscenes.begin(); it != vscenes.end(); it++) {
+       std::vector<const COLLADAFW::VisualScene *>::iterator sit;
+       for (sit = vscenes.begin(); sit != vscenes.end(); sit++) {
                PointerRNA sceneptr, unit_settings;
                PropertyRNA *system, *scale;
                
@@ -222,7 +222,7 @@ void DocumentImporter::finish()
                }
 
                // Write nodes to scene
-               const COLLADAFW::NodePointerArray& roots = 
(*it)->getRootNodes();
+               const COLLADAFW::NodePointerArray& roots = 
(*sit)->getRootNodes();
                for (unsigned int i = 0; i < roots.getCount(); i++) {
                        std::vector<Object *> *objects_done = 
write_node(roots[i], NULL, sce, NULL, false);
                        objects_to_scale->insert(objects_to_scale->end(), 
objects_done->begin(), objects_done->end());
@@ -247,8 +247,8 @@ void DocumentImporter::finish()
        armature_importer.fix_animation();
 #endif
 
-       for (std::vector<const COLLADAFW::VisualScene *>::iterator it = 
vscenes.begin(); it != vscenes.end(); it++) {
-               const COLLADAFW::NodePointerArray& roots = 
(*it)->getRootNodes();
+       for (std::vector<const COLLADAFW::VisualScene *>::iterator vsit = 
vscenes.begin(); vsit != vscenes.end(); vsit++) {
+               const COLLADAFW::NodePointerArray& roots = 
(*vsit)->getRootNodes();
 
                for (unsigned int i = 0; i < roots.getCount(); i++) {
                        translate_anim_recursive(roots[i], NULL, NULL);
@@ -260,9 +260,9 @@ void DocumentImporter::finish()
 
                fprintf(stderr, "got %d library nodes to free\n", 
(int)libnode_ob.size());
                // free all library_nodes
-               std::vector<Object *>::iterator it;
-               for (it = libnode_ob.begin(); it != libnode_ob.end(); it++) {
-                       Object *ob = *it;
+               std::vector<Object *>::iterator lit;
+               for (lit = libnode_ob.begin(); lit != libnode_ob.end(); lit++) {
+                       Object *ob = *lit;
 
                        Base *base = BKE_scene_base_find(sce, ob);
                        if (base) {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to