[Bf-blender-cvs] [889321e22b7] master: Cleanup: reaname LINKLIST_FOREACH -> LISTBASE

Campbell Barton noreply at git.blender.org
Fri Jan 19 11:30:33 CET 2018


Commit: 889321e22b70006a550c923c0ace18e75732e106
Author: Campbell Barton
Date:   Fri Jan 19 21:39:18 2018 +1100
Branches: master
https://developer.blender.org/rB889321e22b70006a550c923c0ace18e75732e106

Cleanup: reaname LINKLIST_FOREACH -> LISTBASE

LinkList's are a different API, no need to confuse things.

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

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

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

diff --git a/source/blender/blenlib/BLI_linklist.h b/source/blender/blenlib/BLI_linklist.h
index 367f1bb9de5..7eec54e67e1 100644
--- a/source/blender/blenlib/BLI_linklist.h
+++ b/source/blender/blenlib/BLI_linklist.h
@@ -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"
diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h
index 1e931e6f0d7..2a0f4e6f814 100644
--- a/source/blender/blenlib/BLI_listbase.h
+++ b/source/blender/blenlib/BLI_listbase.h
@@ -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
diff --git a/source/blender/blenlib/intern/BLI_linklist.c b/source/blender/blenlib/intern/BLI_linklist.c
index 1500e23d72e..051792f7f7c 100644
--- a/source/blender/blenlib/intern/BLI_linklist.c
+++ b/source/blender/blenlib/intern/BLI_linklist.c
@@ -28,6 +28,10 @@
 
 /** \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>
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c
index d2cf0cf49a2..96c3972d802 100644
--- a/source/blender/blenlib/intern/listbase.c
+++ b/source/blender/blenlib/intern/listbase.c
@@ -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>
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index b268d311a41..8d20a671202 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -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;
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
index 9868a8d2208..177a0ec4358 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
@@ -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();
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc
index 3c523b1a23c..4a487f13c3a 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc
@@ -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. */
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 3e352539035..81daa8cfb8c 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -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_FORE

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list