[Bf-blender-cvs] [7d040d2] master: Cleanup: use BLI_listbase_*** prefix for count, sort, sort_r

Campbell Barton noreply at git.blender.org
Sun Nov 16 14:31:02 CET 2014


Commit: 7d040d2a088ec425550da4242650f1ff75680e0d
Author: Campbell Barton
Date:   Sun Nov 16 13:57:58 2014 +0100
Branches: master
https://developer.blender.org/rB7d040d2a088ec425550da4242650f1ff75680e0d

Cleanup: use BLI_listbase_*** prefix for count,sort,sort_r

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

M	source/blender/blenfont/intern/blf_dir.c
M	source/blender/blenkernel/intern/DerivedMesh.c
M	source/blender/blenkernel/intern/action.c
M	source/blender/blenkernel/intern/armature.c
M	source/blender/blenkernel/intern/boids.c
M	source/blender/blenkernel/intern/context.c
M	source/blender/blenkernel/intern/deform.c
M	source/blender/blenkernel/intern/freestyle.c
M	source/blender/blenkernel/intern/ipo.c
M	source/blender/blenkernel/intern/key.c
M	source/blender/blenkernel/intern/mask.c
M	source/blender/blenkernel/intern/mask_rasterize.c
M	source/blender/blenkernel/intern/nla.c
M	source/blender/blenkernel/intern/node.c
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/object_deform.c
M	source/blender/blenkernel/intern/object_dupli.c
M	source/blender/blenkernel/intern/paint.c
M	source/blender/blenkernel/intern/particle.c
M	source/blender/blenkernel/intern/rigidbody.c
M	source/blender/blenkernel/intern/scene.c
M	source/blender/blenkernel/intern/sequencer.c
M	source/blender/blenkernel/intern/softbody.c
M	source/blender/blenkernel/intern/tracking.c
M	source/blender/blenkernel/intern/tracking_solver.c
M	source/blender/blenlib/BLI_listbase.h
M	source/blender/blenlib/intern/listbase.c
M	source/blender/blenlib/intern/scanfill.c
M	source/blender/blenlib/intern/scanfill_utils.c
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/blenloader/intern/versioning_legacy.c
M	source/blender/bmesh/intern/bmesh_log.c
M	source/blender/bmesh/intern/bmesh_mesh_conv.c
M	source/blender/bmesh/operators/bmo_connect_pair.c
M	source/blender/bmesh/tools/bmesh_region_match.c
M	source/blender/collada/ArmatureExporter.cpp
M	source/blender/collada/ControllerExporter.cpp
M	source/blender/editors/animation/keyingsets.c
M	source/blender/editors/armature/armature_edit.c
M	source/blender/editors/armature/armature_skinning.c
M	source/blender/editors/armature/editarmature_retarget.c
M	source/blender/editors/armature/editarmature_sketch.c
M	source/blender/editors/armature/pose_edit.c
M	source/blender/editors/armature/pose_group.c
M	source/blender/editors/armature/pose_lib.c
M	source/blender/editors/armature/pose_select.c
M	source/blender/editors/armature/reeb.c
M	source/blender/editors/curve/editcurve_add.c
M	source/blender/editors/curve/editfont.c
M	source/blender/editors/interface/interface_layout.c
M	source/blender/editors/mesh/editmesh_knife.c
M	source/blender/editors/object/object_bake.c
M	source/blender/editors/object/object_constraint.c
M	source/blender/editors/object/object_vgroup.c
M	source/blender/editors/render/render_shading.c
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/space_buttons/buttons_texture.c
M	source/blender/editors/space_console/console_ops.c
M	source/blender/editors/space_image/image_buttons.c
M	source/blender/editors/space_image/image_ops.c
M	source/blender/editors/space_logic/logic_window.c
M	source/blender/editors/space_nla/nla_edit.c
M	source/blender/editors/space_node/node_draw.c
M	source/blender/editors/space_node/node_edit.c
M	source/blender/editors/space_node/node_relationships.c
M	source/blender/editors/space_node/node_templates.c
M	source/blender/editors/space_node/space_node.c
M	source/blender/editors/space_outliner/outliner_edit.c
M	source/blender/editors/space_text/text_draw.c
M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/editors/transform/transform_orientations.c
M	source/blender/editors/transform/transform_snap.c
M	source/blender/editors/util/ed_transverts.c
M	source/blender/makesdna/DNA_key_types.h
M	source/blender/makesrna/intern/rna_action.c
M	source/blender/makesrna/intern/rna_animation.c
M	source/blender/makesrna/intern/rna_boid.c
M	source/blender/makesrna/intern/rna_dynamicpaint.c
M	source/blender/makesrna/intern/rna_object.c
M	source/blender/makesrna/intern/rna_object_force.c
M	source/blender/makesrna/intern/rna_particle.c
M	source/blender/makesrna/intern/rna_pose.c
M	source/blender/makesrna/intern/rna_rna.c
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/modifiers/intern/MOD_mask.c
M	source/blender/nodes/composite/nodes/node_composite_outputFile.c
M	source/blender/python/bmesh/bmesh_py_types_select.c
M	source/blender/python/intern/bpy_driver.c
M	source/blender/python/intern/gpu.c
M	source/blender/render/intern/source/renderdatabase.c
M	source/blender/windowmanager/intern/wm.c
M	source/gameengine/Converter/BL_BlenderDataConversion.cpp
M	source/gameengine/Converter/BL_SkinDeformer.cpp

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

diff --git a/source/blender/blenfont/intern/blf_dir.c b/source/blender/blenfont/intern/blf_dir.c
index 4a36ae0..f493aa9 100644
--- a/source/blender/blenfont/intern/blf_dir.c
+++ b/source/blender/blenfont/intern/blf_dir.c
@@ -103,7 +103,7 @@ char **BLF_dir_get(int *ndir)
 	char *path;
 	int i, count;
 	
-	count = BLI_countlist(&global_font_dir);
+	count = BLI_listbase_count(&global_font_dir);
 	if (!count)
 		return NULL;
 	
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 6276277..affb855 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -1221,7 +1221,7 @@ static void calc_weightpaint_vert_array(Object *ob, DerivedMesh *dm, int const d
 		unsigned int i;
 
 		/* variables for multipaint */
-		const int defbase_tot = BLI_countlist(&ob->defbase);
+		const int defbase_tot = BLI_listbase_count(&ob->defbase);
 		const int defbase_act = ob->actdef - 1;
 
 		int defbase_sel_tot = 0;
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index c6dcca5..e753a7f 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -966,7 +966,7 @@ bActionGroup *BKE_pose_add_group(bPose *pose, const char *name)
 	BLI_addtail(&pose->agroups, grp);
 	BLI_uniquename(&pose->agroups, grp, name, '.', offsetof(bActionGroup, name), sizeof(grp->name));
 	
-	pose->active_group = BLI_countlist(&pose->agroups);
+	pose->active_group = BLI_listbase_count(&pose->agroups);
 	
 	return grp;
 }
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index afc0ff7..d3dcb2b 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -840,7 +840,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float
 	/* bone defmats are already in the channels, chan_mat */
 
 	/* initialize B_bone matrices and dual quaternions */
-	totchan = BLI_countlist(&armOb->pose->chanbase);
+	totchan = BLI_listbase_count(&armOb->pose->chanbase);
 
 	if (use_quaternion) {
 		dualquats = MEM_callocN(sizeof(DualQuat) * totchan, "dualquats");
@@ -866,7 +866,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, float
 	armature_def_nr = defgroup_name_index(target, defgrp_name);
 
 	if (ELEM(target->type, OB_MESH, OB_LATTICE)) {
-		defbase_tot = BLI_countlist(&target->defbase);
+		defbase_tot = BLI_listbase_count(&target->defbase);
 
 		if (target->type == OB_MESH) {
 			Mesh *me = target->data;
diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c
index 5731455..4a56461 100644
--- a/source/blender/blenkernel/intern/boids.c
+++ b/source/blender/blenkernel/intern/boids.c
@@ -995,7 +995,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
 		case eBoidRulesetType_Random:
 		{
 			/* use random rule for each particle (allways same for same particle though) */
-			rule = BLI_findlink(&state->rules, rand % BLI_countlist(&state->rules));
+			rule = BLI_findlink(&state->rules, rand % BLI_listbase_count(&state->rules));
 
 			apply_boid_rule(bbd, rule, &val, pa, -1.0);
 			break;
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index de285f8..4b0adaf 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -588,7 +588,7 @@ int ctx_data_list_count(const bContext *C, int (*func)(const bContext *, ListBas
 	ListBase list;
 
 	if (func(C, &list)) {
-		int tot = BLI_countlist(&list);
+		int tot = BLI_listbase_count(&list);
 		BLI_freelistN(&list);
 		return tot;
 	}
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index 528ff2d..d3148db 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -441,7 +441,7 @@ int defgroup_name_index(Object *ob, const char *name)
 /* note, must be freed */
 int *defgroup_flip_map(Object *ob, int *flip_map_len, const bool use_default)
 {
-	int defbase_tot = *flip_map_len = BLI_countlist(&ob->defbase);
+	int defbase_tot = *flip_map_len = BLI_listbase_count(&ob->defbase);
 
 	if (defbase_tot == 0) {
 		return NULL;
@@ -480,7 +480,7 @@ int *defgroup_flip_map(Object *ob, int *flip_map_len, const bool use_default)
 /* note, must be freed */
 int *defgroup_flip_map_single(Object *ob, int *flip_map_len, const bool use_default, int defgroup)
 {
-	int defbase_tot = *flip_map_len = BLI_countlist(&ob->defbase);
+	int defbase_tot = *flip_map_len = BLI_listbase_count(&ob->defbase);
 
 	if (defbase_tot == 0) {
 		return NULL;
diff --git a/source/blender/blenkernel/intern/freestyle.c b/source/blender/blenkernel/intern/freestyle.c
index 4aa1b49..cc9ad63 100644
--- a/source/blender/blenkernel/intern/freestyle.c
+++ b/source/blender/blenkernel/intern/freestyle.c
@@ -181,7 +181,7 @@ static FreestyleLineSet *alloc_lineset(void)
 
 FreestyleLineSet *BKE_freestyle_lineset_add(FreestyleConfig *config, const char *name)
 {
-	int lineset_index = BLI_countlist(&config->linesets);
+	int lineset_index = BLI_listbase_count(&config->linesets);
 
 	FreestyleLineSet *lineset = alloc_lineset();
 	BLI_addtail(&config->linesets, (void *)lineset);
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 51cf260..34877c7 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -1523,7 +1523,7 @@ static void ipo_to_animdata(ID *id, Ipo *ipo, char actname[], char constname[],
 	if (G.debug & G_DEBUG) {
 		printf("ipo to animdata - ID:%s, IPO:%s, actname:%s constname:%s seqname:%s  curves:%d\n",
 		       id->name + 2, ipo->id.name + 2, (actname) ? actname : "<None>", (constname) ? constname : "<None>", (seq) ? (seq->name + 2) : "<None>",
-		       BLI_countlist(&ipo->curve));
+		       BLI_listbase_count(&ipo->curve));
 	}
 	
 	/* Convert curves to animato system (separated into separate lists of F-Curves for animation and drivers),
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index 69b375f..28a77b7 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -1086,7 +1086,7 @@ static float *get_weights_array(Object *ob, char *vgroup, WeightsArrayCache *cac
 
 		if (cache) {
 			if (cache->defgroup_weights == NULL) {
-				int num_defgroup = BLI_countlist(&ob->defbase);
+				int num_defgroup = BLI_listbase_count(&ob->defbase);
 				cache->defgroup_weights =
 				    MEM_callocN(sizeof(*cache->defgroup_weights) * num_defgroup,
 				                "cached defgroup weights");
@@ -1518,7 +1518,7 @@ KeyBlock *BKE_keyblock_add(Key *key, const char *name)
 	BLI_addtail(&key->block, kb);
 	kb->type = KEY_CARDINAL;
 	
-	tot = BLI_countlist(&key->block);
+	tot = BLI_listbase_count(&key->block);
 	if (name) {
 		BLI_strncpy(kb->name, name, sizeof(kb->name));
 	}
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c
index 83ad2f1..b05634f 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -1457,7 +1457,7 @@ void BKE_mask_layer_evaluate(MaskLayer *masklay, const float ctime, const bool d
 		{
 			if (found == 1) {
 #if 0
-				printf("%s: exact %d %d (%d)\n", __func__, (int)ctime, BLI_countlist(&masklay->splines_shapes),
+				printf("%s: exact %d %d (%d)\n", __func__, (int)ctime, BLI_listbase_count(&masklay->splines_shapes),
 				       masklay_shape_a->frame);
 #endif
 
@@ -1466,7 +1466,7 @@ void BKE_mask_layer_evaluate(MaskLayer *masklay, const float ctime, const bool d
 			else if (found == 2) {
 				float w = masklay_shape_b->frame - masklay_shape_a->frame;
 #if 0
-				printf("%s: tween %d %d (%d %d)\n", __func__, (int)ctime, BLI_countlist(&masklay->splines_shapes),
+				printf("%s: tween %d %d (%d %d)\n", __func__, (int)ctime, BLI_listbase_count(&masklay->splines_shapes),
 				       masklay_shape_a->frame, masklay_shape_b->frame);
 #endif
 				BKE_mask_layer_shape_to_mask_interp(masklay, masklay_shape_a, masklay_shape_b,
@@ -1833,7 +1833,7 @@ static int mask_layer_shape_sort_cb(const void *masklay_shape_a_ptr, const void
 
 void BKE_mask_layer_shape_sort(MaskLayer *masklay)
 {
-	BLI_sortlist(&masklay->splines_shapes, mask_layer_shape_sort_cb);
+	BLI_listbase_sort(&masklay->splines_shapes, mask_layer_shape_sort_cb);
 }
 
 bool BKE_mask_layer_shape_spline_from_index(MaskLayer *masklay, int index,
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c
index 4dc8ed2..387d093 100644
--- a/source/blender/blenkernel/intern/mask_rasterize.c
+++ b/source/blender/blenkernel/intern/mask_rasterize.c
@@ -572,7 +572,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas
 	unsigned int masklay_index;
 	MemArena *sf_arena;
 
-	mr_handle->layers_tot = (unsigned int)BLI_countlist(&mask->masklayers);
+	mr_handle->layers_tot = (unsigned int)BLI_listbase_count(&mask->masklayers);
 	mr_handle->layers = MEM_mallocN(sizeof(MaskRasterLayer) * mr_handle->layers_tot, "MaskRasterLayer");
 	BLI_rctf_init_minmax(&mr_handle->bounds);
 
@@ -608,7 +608,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas
 			continue;
 		}
 
-		tot_splines = (unsigned int)BLI_countlist(&masklay->splines);
+		tot_splines = (unsigned int)BLI_listbase_count(&masklay->splines);
 		open_spline_ranges = MEM_callocN(sizeof(*open_spline_ranges) * tot_splines, __func__);
 
 		BLI_scanfill_begin_arena(&sf_ctx, sf_arena);
@@ -956,7 +956,7 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, struct Mask *mas
 			                                             &isect_remvertbase,
 			                                             &isect_remedgebase)))
 			{
-				unsigned int sf_vert_tot_isect = (unsigned int)BLI_countlist(&sf_ctx.fillvertbase);
+				unsigned int sf_vert_tot_isect = (unsigned int)BLI_listbase_count(&sf_ctx.fillvertbase);
 				unsigned int i = sf_vert_tot;
 
 				face_coords = MEM_

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list