Cleanup: reaname LINKLIST_FOREACH -> LISTBASE
authorCampbell Barton <ideasman42@gmail.com>
Fri, 19 Jan 2018 10:39:18 +0000 (21:39 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 19 Jan 2018 10:39:18 +0000 (21:39 +1100)
LinkList's are a different API, no need to confuse things.

12 files changed:
source/blender/blenlib/BLI_linklist.h
source/blender/blenlib/BLI_listbase.h
source/blender/blenlib/intern/BLI_linklist.c
source/blender/blenlib/intern/listbase.c
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc
source/blender/depsgraph/intern/depsgraph.cc
source/blender/depsgraph/intern/depsgraph_tag.cc

index 367f1bb9de50fdf87315e6b45628408b90972995..7eec54e67e172050c46ae71b7ff668f31c4e940c 100644 (file)
@@ -30,9 +30,6 @@
 
 /** \file BLI_linklist.h
  *  \ingroup bli
- *  \brief Routines for working with singly linked lists
- *   of 'links' - pointers to other data.
- * 
  */
 
 #include "BLI_compiler_attrs.h"
index 1e931e6f0d7cc0999efd0df80d9de7c1b4c65c5b..2a0f4e6f81438a57962ddeb357ce5163eb997085 100644 (file)
@@ -128,9 +128,9 @@ if ((lb)->last && (lb_init || (lb_init = (lb)->last))) { \
                 (lb_iter != lb_init)); \
 }
 
-#define LINKLIST_FOREACH(type, var, list)          \
-       for (type var = (type)((list)->first);     \
-            var != NULL;                          \
+#define BLI_LISTBASE_FOREACH(type, var, list) \
+       for (type var = (type)((list)->first); \
+            var != NULL; \
             var = (type)(((Link*)(var))->next))
 
 #ifdef __cplusplus
index 1500e23d72e983bafab946840612756843126c13..051792f7f7c230b6c45d5c03254f52f98a3f8529 100644 (file)
 
 /** \file blender/blenlib/intern/BLI_linklist.c
  *  \ingroup bli
+ *
+ * Routines for working with single linked lists of 'links' - pointers to other data.
+ *
+ * For double linked lists see 'BLI_listbase.h'.
  */
 
 #include <stdlib.h>
index d2cf0cf49a2f705da36e3ff5057b778bdb489d6c..96c3972d80214586e125c7e499d133a02ec1ef7a 100644 (file)
@@ -29,7 +29,9 @@
 /** \file blender/blenlib/intern/listbase.c
  *  \ingroup bli
  *
- * Manipulations on ListBase structs
+ * Manipulations on double-linked list (#ListBase structs).
+ *
+ * For single linked lists see 'BLI_linklist.h'
  */
 
 #include <string.h>
index b268d311a4194a87cb6e5e2c754e0f818a4bf07d..8d20a671202f3e5205e20711f4897cb764a51f62 100644 (file)
@@ -305,7 +305,7 @@ void DepsgraphNodeBuilder::build_group(Base *base, Group *group)
        }
        group_id->tag |= LIB_TAG_DOIT;
 
-       LINKLIST_FOREACH (GroupObject *, go, &group->gobject) {
+       BLI_LISTBASE_FOREACH (GroupObject *, go, &group->gobject) {
                build_object(base, go->ob);
        }
 }
@@ -524,7 +524,7 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
                }
 
                /* drivers */
-               LINKLIST_FOREACH (FCurve *, fcu, &adt->drivers) {
+               BLI_LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
                        /* create driver */
                        build_driver(id, fcu);
                }
@@ -630,7 +630,7 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene)
 
        /* objects - simulation participants */
        if (rbw->group) {
-               LINKLIST_FOREACH (GroupObject *, go, &rbw->group->gobject) {
+               BLI_LISTBASE_FOREACH (GroupObject *, go, &rbw->group->gobject) {
                        Object *object = go->ob;
 
                        if (!object || (object->type != OB_MESH))
@@ -674,7 +674,7 @@ void DepsgraphNodeBuilder::build_particles(Object *object)
                           DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT);
 
        /* particle systems */
-       LINKLIST_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
+       BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
                ParticleSettings *part = psys->part;
 
                /* particle settings */
@@ -758,7 +758,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Object *object)
        // TODO: "Done" operation
 
        /* Cloth modifier. */
-       LINKLIST_FOREACH (ModifierData *, md, &object->modifiers) {
+       BLI_LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
                if (md->type == eModifierType_Cloth) {
                        build_cloth(object);
                }
@@ -962,7 +962,7 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree)
        op_node->set_as_exit();
 
        /* nodetree's nodes... */
-       LINKLIST_FOREACH (bNode *, bnode, &ntree->nodes) {
+       BLI_LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) {
                ID *id = bnode->id;
                if (id == NULL) {
                        continue;
index 9868a8d2208838b25179f1960640b8b60d5dd7b3..177a0ec4358f6fa3c6f88ba7f895efefbfb4cb31 100644 (file)
@@ -195,7 +195,7 @@ void DepsgraphNodeBuilder::build_rig(Object *object)
        op_node->set_as_exit();
 
        /* bones */
-       LINKLIST_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
+       BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
                /* Node for bone evaluation. */
                op_node = add_operation_node(&object->id, DEG_NODE_TYPE_BONE, pchan->name, NULL,
                                             DEG_OPCODE_BONE_LOCAL);
@@ -236,7 +236,7 @@ void DepsgraphNodeBuilder::build_rig(Object *object)
                 * - Care is needed to ensure that multi-headed trees work out the same as in ik-tree building
                 * - Animated chain-lengths are a problem...
                 */
-               LINKLIST_FOREACH (bConstraint *, con, &pchan->constraints) {
+               BLI_LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) {
                        switch (con->type) {
                                case CONSTRAINT_TYPE_KINEMATIC:
                                        build_ik_pose(object, pchan, con);
@@ -274,7 +274,7 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *object)
                                     DEG_OPCODE_POSE_INIT);
        op_node->set_as_entry();
 
-       LINKLIST_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
+       BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
                op_node = add_operation_node(&object->id, DEG_NODE_TYPE_BONE, pchan->name,
                                             NULL, DEG_OPCODE_BONE_LOCAL);
                op_node->set_as_entry();
index 3c523b1a23c336504a87a703a5fa0d9074801dc0..4a487f13c3adf743079eebc78ea984938a901aa4 100644 (file)
@@ -78,7 +78,7 @@ void DepsgraphNodeBuilder::build_scene(Scene *scene)
        /* Setup currently building context. */
        scene_ = scene;
        /* scene objects */
-       LINKLIST_FOREACH (Base *, base, &scene->base) {
+       BLI_LISTBASE_FOREACH (Base *, base, &scene->base) {
                Object *object = base->object;
                build_object(base, object);
        }
@@ -103,15 +103,15 @@ void DepsgraphNodeBuilder::build_scene(Scene *scene)
                build_gpencil(scene->gpd);
        }
        /* Cache file. */
-       LINKLIST_FOREACH (CacheFile *, cachefile, &bmain_->cachefiles) {
+       BLI_LISTBASE_FOREACH (CacheFile *, cachefile, &bmain_->cachefiles) {
                build_cachefile(cachefile);
        }
        /* Masks. */
-       LINKLIST_FOREACH (Mask *, mask, &bmain_->mask) {
+       BLI_LISTBASE_FOREACH (Mask *, mask, &bmain_->mask) {
                build_mask(mask);
        }
        /* Movie clips. */
-       LINKLIST_FOREACH (MovieClip *, clip, &bmain_->movieclip) {
+       BLI_LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) {
                build_movieclip(clip);
        }
        /* Parameters evaluation for scene relations mainly. */
index 3e3525390356dfcb5dd8f07b12c0213593a9fb29..81daa8cfb8cd209571be7a974d7ae291f590f108 100644 (file)
@@ -193,7 +193,7 @@ static bool particle_system_depends_on_time(ParticleSystem *psys)
 
 static bool object_particles_depends_on_time(Object *object)
 {
-       LINKLIST_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
+       BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
                if (particle_system_depends_on_time(psys)) {
                        return true;
                }
@@ -349,7 +349,7 @@ void DepsgraphRelationBuilder::add_forcefield_relations(
 {
        ListBase *effectors = pdInitEffectors(scene, object, psys, eff, false);
        if (effectors != NULL) {
-               LINKLIST_FOREACH(EffectorCache *, eff, effectors) {
+               BLI_LISTBASE_FOREACH(EffectorCache *, eff, effectors) {
                        if (eff->ob != object) {
                                ComponentKey eff_key(&eff->ob->id, DEG_NODE_TYPE_TRANSFORM);
                                add_relation(eff_key, key, name);
@@ -429,7 +429,7 @@ void DepsgraphRelationBuilder::build_group(Object *object, Group *group)
        OperationKey object_local_transform_key(&object->id,
                                                DEG_NODE_TYPE_TRANSFORM,
                                                DEG_OPCODE_TRANSFORM_LOCAL);
-       LINKLIST_FOREACH (GroupObject *, go, &group->gobject) {
+       BLI_LISTBASE_FOREACH (GroupObject *, go, &group->gobject) {
                if (!group_done) {
                        build_object(go->ob);
                }
@@ -753,7 +753,7 @@ void DepsgraphRelationBuilder::build_constraints(ID *id,
                else if (cti->get_constraint_targets) {
                        ListBase targets = {NULL, NULL};
                        cti->get_constraint_targets(con, &targets);
-                       LINKLIST_FOREACH (bConstraintTarget *, ct, &targets) {
+                       BLI_LISTBASE_FOREACH (bConstraintTarget *, ct, &targets) {
                                if (ct->tar == NULL) {
                                        continue;
                                }
@@ -938,7 +938,7 @@ void DepsgraphRelationBuilder::build_animdata_curves_targets(ID *id)
        /* Iterate over all curves and build relations. */
        PointerRNA id_ptr;
        RNA_id_pointer_create(id, &id_ptr);
-       LINKLIST_FOREACH(FCurve *, fcu, &adt->action->curves) {
+       BLI_LISTBASE_FOREACH(FCurve *, fcu, &adt->action->curves) {
                PointerRNA ptr;
                PropertyRNA *prop;
                int index;
@@ -976,7 +976,7 @@ void DepsgraphRelationBuilder::build_animdata_drivers(ID *id)
                return;
        }
        ComponentKey adt_key(id, DEG_NODE_TYPE_ANIMATION);
-       LINKLIST_FOREACH (FCurve *, fcu, &adt->drivers) {
+       BLI_LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
                OperationKey driver_key(id,
                                        DEG_NODE_TYPE_PARAMETERS,
                                        DEG_OPCODE_DRIVER,
@@ -1000,7 +1000,7 @@ void DepsgraphRelationBuilder::build_animdata_drivers(ID *id)
                 */
                if (fcu->array_index > 0) {
                        FCurve *fcu_prev = NULL;
-                       LINKLIST_FOREACH (FCurve *, fcu_candidate, &adt->drivers) {
+                       BLI_LISTBASE_FOREACH (FCurve *, fcu_candidate, &adt->drivers) {
                                /* Writing to different RNA paths is  */
                                const char *rna_path = fcu->rna_path ? fcu->rna_path : "";
                                if (!STREQ(fcu_candidate->rna_path, rna_path)) {
@@ -1130,7 +1130,7 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu)
        const char *rna_path = fcu->rna_path ? fcu->rna_path : "";
        const RNAPathKey self_key(id, rna_path);
 
-       LINKLIST_FOREACH (DriverVar *, dvar, &driver->variables) {
+       BLI_LISTBASE_FOREACH (DriverVar *, dvar, &driver->variables) {
                /* Only used targets. */
                DRIVER_TARGETS_USED_LOOPER(dvar)
                {
@@ -1245,7 +1245,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene)
 
        /* objects - simulation participants */
        if (rbw->group) {
-               LINKLIST_FOREACH (GroupObject *, go, &rbw->group->gobject) {
+               BLI_LISTBASE_FOREACH (GroupObject *, go, &rbw->group->gobject) {
                        Object *object = go->ob;
                        if (object == NULL || object->type != OB_MESH) {
                                continue;
@@ -1299,7 +1299,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene)
 
        /* constraints */
        if (rbw->constraints) {
-               LINKLIST_FOREACH (GroupObject *, go, &rbw->constraints->gobject) {
+               BLI_LISTBASE_FOREACH (GroupObject *, go, &rbw->constraints->gobject) {
                        Object *object = go->ob;
                        if (object == NULL || !object->rigidbody_constraint) {
                                continue;
@@ -1335,7 +1335,7 @@ void DepsgraphRelationBuilder::build_particles(Object *object)
                                   DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT);
 
        /* particle systems */
-       LINKLIST_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
+       BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
                ParticleSettings *part = psys->part;
 
                /* particle settings */
@@ -1369,8 +1369,8 @@ void DepsgraphRelationBuilder::build_particles(Object *object)
 
                /* boids */
                if (part->boids) {
-                       LINKLIST_FOREACH (BoidState *, state, &part->boids->states) {
-                               LINKLIST_FOREACH (BoidRule *, rule, &state->rules) {
+                       BLI_LISTBASE_FOREACH (BoidState *, state, &part->boids->states) {
+                               BLI_LISTBASE_FOREACH (BoidRule *, rule, &state->rules) {
                                        Object *ruleob = NULL;
                                        if (rule->type == eBoidRuleType_Avoid)
                                                ruleob = ((BoidRuleGoalAvoid *)rule)->ob;
@@ -1488,7 +1488,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Object *object)
                                                 DEG_NODE_TYPE_GEOMETRY,
                                                 DEG_OPCODE_GEOMETRY_UBEREVAL);
 
-               LINKLIST_FOREACH (ModifierData *, md, &object->modifiers) {
+               BLI_LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
                        const ModifierTypeInfo *mti = modifierType_getInfo((ModifierType)md->type);
                        if (mti->updateDepsgraph) {
                                DepsNodeHandle handle = create_node_handle(obdata_ubereval_key);
@@ -1681,7 +1681,7 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree)
                                    DEG_OPCODE_PARAMETERS_EVAL);
 
        /* nodetree's nodes... */
-       LINKLIST_FOREACH (bNode *, bnode, &ntree->nodes) {
+       BLI_LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) {
                ID *id = bnode->id;
                if (id == NULL) {
                        continue;
index dc88d80fed9ba4f6ccc3328b016740f13dfe2fd2..b23a6112fce75bd8e5e7e3b20e2e6af37776bfa6 100644 (file)
@@ -341,8 +341,8 @@ void DepsgraphRelationBuilder::build_rig(Object *object)
         */
        RootPChanMap root_map;
        bool pose_depends_on_local_transform = false;
-       LINKLIST_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
-               LINKLIST_FOREACH (bConstraint *, con, &pchan->constraints) {
+       BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
+               BLI_LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) {
                        switch (con->type) {
                                case CONSTRAINT_TYPE_KINEMATIC:
                                        build_ik_pose(object, pchan, con, &root_map);
@@ -382,7 +382,7 @@ void DepsgraphRelationBuilder::build_rig(Object *object)
        }
 
        /* links between operations for each bone */
-       LINKLIST_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
+       BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
                OperationKey bone_local_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL);
                OperationKey bone_pose_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_POSE_PARENT);
                OperationKey bone_ready_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY);
@@ -446,7 +446,7 @@ void DepsgraphRelationBuilder::build_proxy_rig(Object *object)
 {
        OperationKey pose_init_key(&object->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT);
        OperationKey pose_done_key(&object->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE);
-       LINKLIST_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
+       BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
                OperationKey bone_local_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL);
                OperationKey bone_ready_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY);
                OperationKey bone_done_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE);
index 29c739bf784ff504797e4dede8357c05a1d5042c..93b4f77bb6e9f6adb17780a7f8b8b6db938fcb1d 100644 (file)
@@ -76,7 +76,7 @@ void DepsgraphRelationBuilder::build_scene(Scene *scene)
        /* Setup currently building context. */
        scene_ = scene;
        /* Scene objects. */
-       LINKLIST_FOREACH (Base *, base, &scene->base) {
+       BLI_LISTBASE_FOREACH (Base *, base, &scene->base) {
                Object *object = base->object;
                build_object(object);
        }
@@ -101,11 +101,11 @@ void DepsgraphRelationBuilder::build_scene(Scene *scene)
                build_gpencil(scene->gpd);
        }
        /* Masks. */
-       LINKLIST_FOREACH (Mask *, mask, &bmain_->mask) {
+       BLI_LISTBASE_FOREACH (Mask *, mask, &bmain_->mask) {
                build_mask(mask);
        }
        /* Movie clips. */
-       LINKLIST_FOREACH (MovieClip *, clip, &bmain_->movieclip) {
+       BLI_LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) {
                build_movieclip(clip);
        }
        for (Depsgraph::OperationNodes::const_iterator it_op = graph_->operations.begin();
index 757af7cc3fc6b58b48c51c6987f8274e515870ae..a016d623ea9cd399e03cd8db6a81641bf0203921 100644 (file)
@@ -155,7 +155,7 @@ static bool pointer_to_component_node_criteria(
                        return true;
                }
                else if (object->pose != NULL) {
-                       LINKLIST_FOREACH(bPoseChannel *, pchan, &object->pose->chanbase) {
+                       BLI_LISTBASE_FOREACH(bPoseChannel *, pchan, &object->pose->chanbase) {
                                if (BLI_findindex(&pchan->constraints, con) != -1) {
                                        /* bone transforms */
                                        *type = DEG_NODE_TYPE_BONE;
index 7f08f3f805226c8d7edb83f4baa1be26c82e8c75..a66c61e4c0f995d3bb6bb9e8054b85e18ee7a845 100644 (file)
@@ -328,12 +328,12 @@ void DEG_graph_on_visible_update(Main *bmain, Scene *scene)
                return;
        }
        /* Special trick to get local view to work.  */
-       LINKLIST_FOREACH (Base *, base, &scene->base) {
+       BLI_LISTBASE_FOREACH (Base *, base, &scene->base) {
                Object *object = base->object;
                DEG::IDDepsNode *id_node = graph->find_id_node(&object->id);
                id_node->layers = 0;
        }
-       LINKLIST_FOREACH (Base *, base, &scene->base) {
+       BLI_LISTBASE_FOREACH (Base *, base, &scene->base) {
                Object *object = base->object;
                DEG::IDDepsNode *id_node = graph->find_id_node(&object->id);
                id_node->layers |= base->lay;
@@ -343,7 +343,7 @@ void DEG_graph_on_visible_update(Main *bmain, Scene *scene)
                }
        }
        DEG::deg_graph_build_flush_layers(graph);
-       LINKLIST_FOREACH (Base *, base, &scene->base) {
+       BLI_LISTBASE_FOREACH (Base *, base, &scene->base) {
                Object *object = base->object;
                DEG::IDDepsNode *id_node = graph->find_id_node(&object->id);
                GHASH_FOREACH_BEGIN(DEG::ComponentDepsNode *, comp, id_node->components)