[Bf-blender-cvs] [c0bbc4abf53] master: Cleanup: Remove BLI_ prefix from listbase macro

Sergey Sharybin noreply at git.blender.org
Thu Feb 15 12:40:19 CET 2018


Commit: c0bbc4abf53b406c947b3a0caa1b6a0898eba9c1
Author: Sergey Sharybin
Date:   Thu Feb 15 12:38:21 2018 +0100
Branches: master
https://developer.blender.org/rBc0bbc4abf53b406c947b3a0caa1b6a0898eba9c1

Cleanup: Remove BLI_ prefix from listbase macro

This is kind of doesn't matter where macro itself is defined.

We should stick to the following:

- If some macro is actually more an inline function, follow regular
  function name conventions.
- If macro is a macro, type it in capitals. Use module prefix if that
  helps readability or it if helps avoiding accidents.

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

M	source/blender/blenlib/BLI_listbase.h
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
M	source/blender/editors/animation/anim_markers.c

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

diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h
index 2a0f4e6f814..92fb18bfe43 100644
--- a/source/blender/blenlib/BLI_listbase.h
+++ b/source/blender/blenlib/BLI_listbase.h
@@ -103,32 +103,32 @@ struct LinkData *BLI_genericNodeN(void *data);
  *
  * \code{.c}
  *
- * BLI_LISTBASE_CIRCULAR_FORWARD_BEGIN (listbase, item, item_init) {
+ * LISTBASE_CIRCULAR_FORWARD_BEGIN (listbase, item, item_init) {
  *     ...operate on marker...
  * }
- * BLI_LISTBASE_CIRCULAR_FORWARD_END (listbase, item, item_init);
+ * LISTBASE_CIRCULAR_FORWARD_END (listbase, item, item_init);
  *
  * \endcode
  */
-#define BLI_LISTBASE_CIRCULAR_FORWARD_BEGIN(lb, lb_iter, lb_init) \
+#define LISTBASE_CIRCULAR_FORWARD_BEGIN(lb, lb_iter, lb_init) \
 if ((lb)->first && (lb_init || (lb_init = (lb)->first))) { \
 	lb_iter = lb_init; \
 	do {
-#define BLI_LISTBASE_CIRCULAR_FORWARD_END(lb, lb_iter, lb_init) \
+#define LISTBASE_CIRCULAR_FORWARD_END(lb, lb_iter, lb_init) \
 	} while ((lb_iter  = (lb_iter)->next ? (lb_iter)->next : (lb)->first), \
 	         (lb_iter != lb_init)); \
 }
 
-#define BLI_LISTBASE_CIRCULAR_BACKWARD_BEGIN(lb, lb_iter, lb_init) \
+#define LISTBASE_CIRCULAR_BACKWARD_BEGIN(lb, lb_iter, lb_init) \
 if ((lb)->last && (lb_init || (lb_init = (lb)->last))) { \
 	lb_iter = lb_init; \
 	do {
-#define BLI_LISTBASE_CIRCULAR_BACKWARD_END(lb, lb_iter, lb_init) \
+#define LISTBASE_CIRCULAR_BACKWARD_END(lb, lb_iter, lb_init) \
 	} while ((lb_iter  = (lb_iter)->prev ? (lb_iter)->prev : (lb)->last), \
 	         (lb_iter != lb_init)); \
 }
 
-#define BLI_LISTBASE_FOREACH(type, var, list) \
+#define LISTBASE_FOREACH(type, var, list) \
 	for (type var = (type)((list)->first); \
 	     var != NULL; \
 	     var = (type)(((Link*)(var))->next))
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 1d18d6def8d..27bcc224ef5 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;
 
-	BLI_LISTBASE_FOREACH (GroupObject *, go, &group->gobject) {
+	LISTBASE_FOREACH (GroupObject *, go, &group->gobject) {
 		build_object(base, go->ob);
 	}
 }
@@ -524,7 +524,7 @@ void DepsgraphNodeBuilder::build_animdata(ID *id)
 		}
 
 		/* drivers */
-		BLI_LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) {
+		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) {
-		BLI_LISTBASE_FOREACH (GroupObject *, go, &rbw->group->gobject) {
+		LISTBASE_FOREACH (GroupObject *, go, &rbw->group->gobject) {
 			Object *object = go->ob;
 
 			if (!object || (object->type != OB_MESH))
@@ -671,7 +671,7 @@ void DepsgraphNodeBuilder::build_particles(Object *object)
 	                                 object),
 	                   DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT);
 	/* Build all particle systems. */
-	BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
+	LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
 		ParticleSettings *part = psys->part;
 		/* Particle settings. */
 		// XXX: what if this is used more than once!
@@ -766,7 +766,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Object *object)
 	// TODO: "Done" operation
 
 	/* Cloth modifier. */
-	BLI_LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
+	LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
 		if (md->type == eModifierType_Cloth) {
 			build_cloth(object);
 		}
@@ -970,7 +970,7 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree)
 	op_node->set_as_exit();
 
 	/* nodetree's nodes... */
-	BLI_LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) {
+	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 29cd72c13fd..1a6b3f89f26 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 */
-	BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
+	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...
 		 */
-		BLI_LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) {
+		LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) {
 			switch (con->type) {
 				case CONSTRAINT_TYPE_KINEMATIC:
 					build_ik_pose(object, pchan, con);
@@ -275,7 +275,7 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *object)
 	op_node->set_as_entry();
 
 
-	BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
+	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 4a487f13c3a..4bb15350f3a 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 */
-	BLI_LISTBASE_FOREACH (Base *, base, &scene->base) {
+	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. */
-	BLI_LISTBASE_FOREACH (CacheFile *, cachefile, &bmain_->cachefiles) {
+	LISTBASE_FOREACH (CacheFile *, cachefile, &bmain_->cachefiles) {
 		build_cachefile(cachefile);
 	}
 	/* Masks. */
-	BLI_LISTBASE_FOREACH (Mask *, mask, &bmain_->mask) {
+	LISTBASE_FOREACH (Mask *, mask, &bmain_->mask) {
 		build_mask(mask);
 	}
 	/* Movie clips. */
-	BLI_LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) {
+	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 65f45186ba4..e01d5e53311 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)
 {
-	BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
+	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) {
-		BLI_LISTBASE_FOREACH(EffectorCache *, eff, effectors) {
+		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 != NULL ? &object->id : NULL,
 	                                        DEG_NODE_TYPE_TRANSFORM,
 	                                        DEG_OPCODE_TRANSFORM_LOCAL);
-	BLI_LISTBASE_FOREACH (GroupObject *, go, &group->gobject) {
+	LISTBASE_FOREACH (GroupObject *, go, &group->gobject) {
 		if (!group_done) {
 			build_object(go->ob);
 		}
@@ -755,7 +755,7 @@ void DepsgraphRelationBuilder::build_constraints(ID *id,
 		else if (cti->get_constraint_targets) {
 			ListBase targets = {NULL, NULL};
 			cti->get_constraint_targets(con, &targets);
-			BLI_LISTBASE_FOREACH (bConstraintTarget *, ct, &targets) {
+			LISTBASE_FOREACH (bConstraintTarget *, ct, &targets) {
 				if (ct->tar == NULL) {
 					continue;
 				}
@@ -932,7 +932,7 @@ void DepsgraphRelationBuilder::build_animdata_curves(ID *id)
 	                              operation_from,
 	                              &adt->action->curves);
 	}
-	BLI_LISTBASE_FOREACH(NlaTrack *, nlt, &adt->nla_tracks) {
+	LISTBASE_FOREACH(NlaTrack *, nlt, &adt->nla_tracks) {
 		build_animdata_nlastrip_targets(id, adt_key,
 		                                operation_from,
 		                                &nlt->strips);
@@ -947,7 +947,7 @@ void DepsgraphRelationBuilder::build_animdata_curves_targets(
 	/* Iterate over all curves and build relations. */
 	PointerRNA id_ptr;
 	RNA_id_pointer_create(id, &id_ptr);
-	BLI_LISTBASE_FOREACH(FCurve *, fcu, curves) {
+	LISTBASE_FOREACH(FCurve *, fcu, curves) {
 		PointerRNA ptr;
 		PropertyRNA *prop;
 		int index;
@@ -983,7 +983,7 @@ void DepsgraphRelationBuilder::build_animdata_nlastrip_targets(
         OperationDepsNode *operation_from,
         ListBase *strips)
 {
-	BLI_LISTBASE_FOREACH(NlaStrip *, strip, strips) {
+	LISTBASE_FOREACH(NlaStrip *, strip, strips) {
 		if (strip->act != NULL) {
 			build_animdata_curves_targets(id, adt_key,
 			                              operatio

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list