From 7d040d2a088ec425550da4242650f1ff75680e0d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 16 Nov 2014 13:57:58 +0100 Subject: Cleanup: use BLI_listbase_*** prefix for count,sort,sort_r --- source/blender/editors/animation/keyingsets.c | 8 +++---- source/blender/editors/armature/armature_edit.c | 2 +- .../blender/editors/armature/armature_skinning.c | 2 +- .../editors/armature/editarmature_retarget.c | 12 +++++----- .../blender/editors/armature/editarmature_sketch.c | 2 +- source/blender/editors/armature/pose_edit.c | 4 ++-- source/blender/editors/armature/pose_group.c | 2 +- source/blender/editors/armature/pose_lib.c | 4 ++-- source/blender/editors/armature/pose_select.c | 2 +- source/blender/editors/armature/reeb.c | 26 +++++++++++----------- source/blender/editors/curve/editcurve_add.c | 2 +- source/blender/editors/curve/editfont.c | 2 +- .../blender/editors/interface/interface_layout.c | 4 ++-- source/blender/editors/mesh/editmesh_knife.c | 14 ++++++------ source/blender/editors/object/object_bake.c | 2 +- source/blender/editors/object/object_constraint.c | 2 +- source/blender/editors/object/object_vgroup.c | 20 ++++++++--------- source/blender/editors/render/render_shading.c | 2 +- source/blender/editors/screen/screen_ops.c | 6 ++--- source/blender/editors/sculpt_paint/paint_vertex.c | 6 ++--- .../editors/space_buttons/buttons_texture.c | 6 ++--- source/blender/editors/space_console/console_ops.c | 4 ++-- source/blender/editors/space_image/image_buttons.c | 8 +++---- source/blender/editors/space_image/image_ops.c | 2 +- source/blender/editors/space_logic/logic_window.c | 8 +++---- source/blender/editors/space_nla/nla_edit.c | 2 +- source/blender/editors/space_node/node_draw.c | 2 +- source/blender/editors/space_node/node_edit.c | 2 +- .../editors/space_node/node_relationships.c | 4 ++-- source/blender/editors/space_node/node_templates.c | 2 +- source/blender/editors/space_node/space_node.c | 2 +- .../blender/editors/space_outliner/outliner_edit.c | 4 ++-- source/blender/editors/space_text/text_draw.c | 6 ++--- source/blender/editors/space_view3d/drawobject.c | 2 +- source/blender/editors/space_view3d/view3d_draw.c | 2 +- .../editors/transform/transform_conversions.c | 4 ++-- .../editors/transform/transform_orientations.c | 2 +- source/blender/editors/transform/transform_snap.c | 2 +- source/blender/editors/util/ed_transverts.c | 4 ++-- 39 files changed, 96 insertions(+), 96 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 027c669a01d..a5c0eee8d3b 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -127,7 +127,7 @@ static int add_default_keyingset_exec(bContext *C, wmOperator *UNUSED(op)) /* call the API func, and set the active keyingset index */ BKE_keyingset_add(&scene->keyingsets, NULL, NULL, flag, keyingflag); - scene->active_keyingset = BLI_countlist(&scene->keyingsets); + scene->active_keyingset = BLI_listbase_count(&scene->keyingsets); /* send notifiers */ WM_event_add_notifier(C, NC_SCENE | ND_KEYINGSET, NULL); @@ -216,7 +216,7 @@ static int add_empty_ks_path_exec(bContext *C, wmOperator *op) /* don't use the API method for this, since that checks on values... */ ksp = MEM_callocN(sizeof(KS_Path), "KeyingSetPath Empty"); BLI_addtail(&ks->paths, ksp); - ks->active_path = BLI_countlist(&ks->paths); + ks->active_path = BLI_listbase_count(&ks->paths); ksp->groupmode = KSP_GROUP_KSNAME; // XXX? ksp->idtype = ID_OB; @@ -316,7 +316,7 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op) /* call the API func, and set the active keyingset index */ ks = BKE_keyingset_add(&scene->keyingsets, "ButtonKeyingSet", "Button Keying Set", flag, keyingflag); - scene->active_keyingset = BLI_countlist(&scene->keyingsets); + scene->active_keyingset = BLI_listbase_count(&scene->keyingsets); } else if (scene->active_keyingset < 0) { BKE_report(op->reports, RPT_ERROR, "Cannot add property to built in keying set"); @@ -347,7 +347,7 @@ static int add_keyingset_button_exec(bContext *C, wmOperator *op) /* add path to this setting */ BKE_keyingset_add_path(ks, ptr.id.data, NULL, path, index, pflag, KSP_GROUP_KSNAME); - ks->active_path = BLI_countlist(&ks->paths); + ks->active_path = BLI_listbase_count(&ks->paths); success = 1; /* free the temp path created */ diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index 8bcee52baab..7f7843a6d1d 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -569,7 +569,7 @@ static int armature_fill_bones_exec(bContext *C, wmOperator *op) * 2) between the two joints (order is dependent on active-bone/hierarchy) * 3+) error (a smarter method involving finding chains needs to be worked out */ - count = BLI_countlist(&points); + count = BLI_listbase_count(&points); if (count == 0) { BKE_report(op->reports, RPT_ERROR, "No joints selected"); diff --git a/source/blender/editors/armature/armature_skinning.c b/source/blender/editors/armature/armature_skinning.c index 5ff15b84284..15f75ada060 100644 --- a/source/blender/editors/armature/armature_skinning.c +++ b/source/blender/editors/armature/armature_skinning.c @@ -428,7 +428,7 @@ void create_vgroups_from_armature(ReportList *reports, Scene *scene, Object *ob, bArmature *arm = par->data; if (mode == ARM_GROUPS_NAME) { - const int defbase_tot = BLI_countlist(&ob->defbase); + const int defbase_tot = BLI_listbase_count(&ob->defbase); int defbase_add; /* Traverse the bone list, trying to create empty vertex * groups corresponding to the bone. diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index 647b640ee61..d1cab01a2f6 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -1205,7 +1205,7 @@ static void RIG_arcFromBoneChain(RigGraph *rg, ListBase *list, EditBone *root_bo static void RIG_findHead(RigGraph *rg) { if (rg->head == NULL) { - if (BLI_countlist(&rg->arcs) == 1) { + if (BLI_listbase_count(&rg->arcs) == 1) { RigArc *arc = rg->arcs.first; rg->head = (RigNode *)arc->head; @@ -1958,7 +1958,7 @@ static void retargetArctoArcAggresive(bContext *C, RigGraph *rigg, RigArc *iarc, #endif float *vec0, *vec1; int *best_positions; - int nb_edges = BLI_countlist(&iarc->edges); + int nb_edges = BLI_listbase_count(&iarc->edges); int nb_joints = nb_edges - 1; RetargetMethod method = METHOD_MEMOIZE; int i; @@ -2152,7 +2152,7 @@ void exec_retargetArctoArc(TaskPool *UNUSED(pool), void *taskdata, int UNUSED(th RigNode *inode_start = p->inode_start; ReebArc *earc = iarc->link_mesh; - if (BLI_countlist(&iarc->edges) == 1) { + if (BLI_listbase_count(&iarc->edges) == 1) { RigEdge *edge = iarc->edges.first; if (testFlipArc(iarc, inode_start)) { @@ -2454,7 +2454,7 @@ const char *RIG_nameBone(RigGraph *rg, int arc_index, int bone_index) return "None"; } - if (bone_index == BLI_countlist(&arc->edges)) { + if (bone_index == BLI_listbase_count(&arc->edges)) { return "Last joint"; } @@ -2476,10 +2476,10 @@ int RIG_nbJoints(RigGraph *rg) RigArc *arc; int total = 0; - total += BLI_countlist(&rg->nodes); + total += BLI_listbase_count(&rg->nodes); for (arc = rg->arcs.first; arc; arc = arc->next) { - total += BLI_countlist(&arc->edges) - 1; /* -1 because end nodes are already counted */ + total += BLI_listbase_count(&arc->edges) - 1; /* -1 because end nodes are already counted */ } return total; diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 737f901a055..912fbc36d5d 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -1575,7 +1575,7 @@ static int sk_getIntersections(bContext *C, ListBase *list, SK_Sketch *sketch, S added = MAX2(s_added, added); } - BLI_sortlist(list, cmpIntersections); + BLI_listbase_sort(list, cmpIntersections); return added; } diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index 193ba6397fb..d8a32f085bc 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -381,14 +381,14 @@ static void pose_copy_menu(Scene *scene) * but for constraints (just add local constraints) */ if (pose_has_protected_selected(ob, 0)) { - i = BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */ + i = BLI_listbase_count(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */ if (i < 25) nr = pupmenu("Copy Pose Attributes %t|Local Location %x1|Local Rotation %x2|Local Size %x3|%l|Visual Location %x9|Visual Rotation %x10|Visual Size %x11|%l|Constraints (All) %x4|Constraints... %x5"); else nr = pupmenu("Copy Pose Attributes %t|Local Location %x1|Local Rotation %x2|Local Size %x3|%l|Visual Location %x9|Visual Rotation %x10|Visual Size %x11|%l|Constraints (All) %x4"); } else { - i = BLI_countlist(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */ + i = BLI_listbase_count(&(pchanact->constraints)); /* if there are 24 or less, allow for the user to select constraints */ if (i < 25) nr = pupmenu("Copy Pose Attributes %t|Local Location %x1|Local Rotation %x2|Local Size %x3|%l|Visual Location %x9|Visual Rotation %x10|Visual Size %x11|%l|Constraints (All) %x4|Constraints... %x5|%l|Transform Locks %x6|IK Limits %x7|Bone Shape %x8"); else diff --git a/source/blender/editors/armature/pose_group.c b/source/blender/editors/armature/pose_group.c index 2b605443beb..9c27fe5218a 100644 --- a/source/blender/editors/armature/pose_group.c +++ b/source/blender/editors/armature/pose_group.c @@ -387,7 +387,7 @@ static int group_sort_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; /* create temporary array with bone groups and indices */ - agrp_count = BLI_countlist(&pose->agroups); + agrp_count = BLI_listbase_count(&pose->agroups); agrp_array = MEM_mallocN(sizeof(tSortActionGroup) * agrp_count, "sort bone groups"); for (agrp = pose->agroups.first, i = 0; agrp; agrp = agrp->next, i++) { BLI_assert(i < agrp_count); diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index b8373b00368..15e70980425 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -472,7 +472,7 @@ static int poselib_add_exec(bContext *C, wmOperator *op) ANIM_apply_keyingset(C, NULL, act, ks, MODIFYKEY_MODE_INSERT, (float)frame); /* store new 'active' pose number */ - act->active_marker = BLI_countlist(&act->markers); + act->active_marker = BLI_listbase_count(&act->markers); /* done */ return OPERATOR_FINISHED; @@ -1348,7 +1348,7 @@ static int poselib_preview_handle_event(bContext *UNUSED(C), wmOperator *op, con else { /* change to last pose */ pld->marker = pld->act->markers.last; - pld->act->active_marker = BLI_countlist(&pld->act->markers); + pld->act->active_marker = BLI_listbase_count(&pld->act->markers); pld->redraw = PL_PREVIEW_REDRAWALL; } diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c index ba5ef4f3b5d..5d5a9bf363c 100644 --- a/source/blender/editors/armature/pose_select.c +++ b/source/blender/editors/armature/pose_select.c @@ -642,7 +642,7 @@ static bool pose_select_same_group(bContext *C, Object *ob, bool extend) return 0; /* count the number of groups */ - numGroups = BLI_countlist(&pose->agroups); + numGroups = BLI_listbase_count(&pose->agroups); if (numGroups == 0) return 0; diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 8cc6059e87b..dd2212745e0 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -107,7 +107,7 @@ static VertexData *allocVertexData(EditMesh *em) EditVert *eve; int totvert, index; - totvert = BLI_countlist(&em->verts); + totvert = BLI_listbase_count(&em->verts); data = MEM_callocN(sizeof(VertexData) * totvert, "VertexData"); @@ -1141,7 +1141,7 @@ static int compareNodesWeight(void *vnode1, void *vnode2) void sortNodes(ReebGraph *rg) { - BLI_sortlist(&rg->nodes, compareNodesWeight); + BLI_listbase_sort(&rg->nodes, compareNodesWeight); } static int compareArcsWeight(void *varc1, void *varc2) @@ -1166,7 +1166,7 @@ static int compareArcsWeight(void *varc1, void *varc2) void sortArcs(ReebGraph *rg) { - BLI_sortlist(&rg->arcs, compareArcsWeight); + BLI_listbase_sort(&rg->arcs, compareArcsWeight); } /******************************************* JOINING ***************************************************/ @@ -1512,7 +1512,7 @@ static int filterInternalExternalReebGraph(ReebGraph *rg, float threshold_intern ReebArc *arc = NULL, *nextArc = NULL; int value = 0; - BLI_sortlist(&rg->arcs, compareArcs); + BLI_listbase_sort(&rg->arcs, compareArcs); for (arc = rg->arcs.first; arc; arc = nextArc) { nextArc = arc->next; @@ -1632,7 +1632,7 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold)) #if 0 //XXX ReebArc *arc = NULL, *nextArc = NULL; - BLI_sortlist(&rg->arcs, compareArcs); + BLI_listbase_sort(&rg->arcs, compareArcs); #ifdef DEBUG_REEB { @@ -1867,7 +1867,7 @@ static void spreadWeight(EditMesh *em) { EditVert **verts, *eve; float lastWeight = 0.0f; - int totvert = BLI_countlist(&em->verts); + int totvert = BLI_listbase_count(&em->verts); int i; int work_needed = 1; @@ -2399,9 +2399,9 @@ ReebGraph *generateReebGraph(EditMesh *em, int subdivisions) rg->resolution = subdivisions; - /*totvert = BLI_countlist(&em->verts);*/ /*UNUSED*/ + /*totvert = BLI_listbase_count(&em->verts);*/ /*UNUSED*/ #ifdef DEBUG_REEB - totfaces = BLI_countlist(&em->faces); + totfaces = BLI_listbase_count(&em->faces); #endif renormalizeWeight(em, 1.0f); @@ -2460,7 +2460,7 @@ void renormalizeWeight(EditMesh *em, float newmax) EditVert *eve; float minimum, maximum, range; - if (em == NULL || BLI_countlist(&em->verts) == 0) + if (em == NULL || BLI_listbase_count(&em->verts) == 0) return; /* First pass, determine maximum and minimum */ @@ -2486,7 +2486,7 @@ int weightFromLoc(EditMesh *em, int axis) { EditVert *eve; - if (em == NULL || BLI_countlist(&em->verts) == 0 || axis < 0 || axis > 2) + if (em == NULL || BLI_listbase_count(&em->verts) == 0 || axis < 0 || axis > 2) return 0; /* Copy coordinate in weight */ @@ -2738,7 +2738,7 @@ static void buildIndexedEdges(EditMesh *em, EdgeIndex *indexed_edges) int tot_indexed = 0; int offset = 0; - totvert = BLI_countlist(&em->verts); + totvert = BLI_listbase_count(&em->verts); indexed_edges->offset = MEM_callocN(totvert * sizeof(int), "EdgeIndex offset"); @@ -2791,13 +2791,13 @@ int weightFromDistance(EditMesh *em, EdgeIndex *indexed_edges) int totvert = 0; int vCount = 0; - totvert = BLI_countlist(&em->verts); + totvert = BLI_listbase_count(&em->verts); if (em == NULL || totvert == 0) { return 0; } - totedge = BLI_countlist(&em->edges); + totedge = BLI_listbase_count(&em->edges); if (totedge == 0) { return 0; diff --git a/source/blender/editors/curve/editcurve_add.c b/source/blender/editors/curve/editcurve_add.c index 662a7eb811a..c9a961d1a4d 100644 --- a/source/blender/editors/curve/editcurve_add.c +++ b/source/blender/editors/curve/editcurve_add.c @@ -460,7 +460,7 @@ Nurb *add_nurbs_primitive(bContext *C, Object *obedit, float mat[4][4], int type if (nu) { /* should always be set */ nu->flag |= CU_SMOOTH; - cu->actnu = BLI_countlist(editnurb); + cu->actnu = BLI_listbase_count(editnurb); cu->actvert = CU_ACT_NONE; BKE_nurb_test2D(nu); diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 31c67fbca52..108166109b8 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -668,7 +668,7 @@ void ED_text_to_object(bContext *C, Text *text, const bool split_lines) offset[1] = 0.0f; offset[2] = 0.0f; - txt_add_object(C, text->lines.first, BLI_countlist(&text->lines), offset); + txt_add_object(C, text->lines.first, BLI_listbase_count(&text->lines), offset); } } diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 0e0c6d920e7..4cc159d144d 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1518,7 +1518,7 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, const char *s } RNA_PROP_END; - BLI_sortlist(items_list, sort_search_items_list); + BLI_listbase_sort(items_list, sort_search_items_list); /* add search items from temporary list */ for (cis = items_list->first; cis; cis = cis->next) { @@ -2512,7 +2512,7 @@ static void ui_litem_layout_split(uiLayout *litem) uiLayoutItemSplit *split = (uiLayoutItemSplit *)litem; uiItem *item; float percentage; - const int tot = BLI_countlist(&litem->items); + const int tot = BLI_listbase_count(&litem->items); int itemh, x, y, w, colw = 0; if (tot == 0) diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index b1fc18e1ab9..dccb1f14af6 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -753,7 +753,7 @@ static void knife_cut_face(KnifeTool_OpData *kcd, BMFace *f, ListBase *hits) (void) kcd; - n = BLI_countlist(hits); + n = BLI_listbase_count(hits); if (n < 2) return; @@ -2108,7 +2108,7 @@ static ListBase *find_chain(KnifeTool_OpData *kcd, ListBase *fedges) break; } if (ans) { - BLI_assert(BLI_countlist(ans) > 0); + BLI_assert(BLI_listbase_count(ans) > 0); for (r = ans->first; r; r = r->next) { ref = find_ref(fedges, r->ref); BLI_assert(ref != NULL); @@ -2216,7 +2216,7 @@ static bool find_hole_chains(KnifeTool_OpData *kcd, ListBase *hole, BMFace *f, L int besti[2], bestj[2]; float dist_sq, dist_best_sq; - nh = BLI_countlist(hole); + nh = BLI_listbase_count(hole); nf = f->len; if (nh < 2 || nf < 3) return false; @@ -2393,7 +2393,7 @@ static void knife_make_chain_cut(KnifeTool_OpData *kcd, BMFace *f, ListBase *cha KnifeVert *kfv, *kfvprev; BMLoop *l_new, *l_iter; int i; - int nco = BLI_countlist(chain) - 1; + int nco = BLI_listbase_count(chain) - 1; float (*cos)[3] = BLI_array_alloca(cos, nco); KnifeVert **kverts = BLI_array_alloca(kverts, nco); @@ -2466,7 +2466,7 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe Ref *ref, *refnext; int count, oldcount; - oldcount = BLI_countlist(kfedges); + oldcount = BLI_listbase_count(kfedges); while ((chain = find_chain(kcd, kfedges)) != NULL) { ListBase fnew_kfedges; knife_make_chain_cut(kcd, f, chain, &fnew); @@ -2495,7 +2495,7 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe /* find_chain should always remove edges if it returns true, * but guard against infinite loop anyway */ - count = BLI_countlist(kfedges); + count = BLI_listbase_count(kfedges); if (count >= oldcount) { BLI_assert(!"knife find_chain infinite loop"); return; @@ -2563,7 +2563,7 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe break; /* find_hole should always remove edges if it returns true, * but guard against infinite loop anyway */ - count = BLI_countlist(kfedges); + count = BLI_listbase_count(kfedges); if (count >= oldcount) { BLI_assert(!"knife find_hole infinite loop"); return; diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index b8957514159..1f1bdbe55e5 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -438,7 +438,7 @@ static void multiresbake_startjob(void *bkv, short *stop, short *do_update, floa MultiresBakeJob *bkj = bkv; int baked_objects = 0, tot_obj; - tot_obj = BLI_countlist(&bkj->data); + tot_obj = BLI_listbase_count(&bkj->data); if (bkj->bake_clear) { /* clear images */ for (data = bkj->data.first; data; data = data->next) { diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 674fb176a8f..2596ea0a064 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -233,7 +233,7 @@ static void set_constraint_nth_target(bConstraint *con, Object *target, const ch if (cti && cti->get_constraint_targets) { cti->get_constraint_targets(con, &targets); - num_targets = BLI_countlist(&targets); + num_targets = BLI_listbase_count(&targets); if (index < 0) { if (abs(index) < num_targets) diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 9dd79ddf995..49c77770467 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -145,7 +145,7 @@ bDeformGroup *ED_vgroup_add_name(Object *ob, const char *name) defgroup = BKE_defgroup_new(ob, name); - ob->actdef = BLI_countlist(&ob->defbase); + ob->actdef = BLI_listbase_count(&ob->defbase); return defgroup; } @@ -501,8 +501,8 @@ bool ED_vgroup_array_copy(Object *ob, Object *ob_from) int dvert_tot_from; int dvert_tot; int i; - int defbase_tot_from = BLI_countlist(&ob_from->defbase); - int defbase_tot = BLI_countlist(&ob->defbase); + int defbase_tot_from = BLI_listbase_count(&ob_from->defbase); + int defbase_tot = BLI_listbase_count(&ob->defbase); bool new_vgroup = false; if (ob == ob_from) @@ -1476,7 +1476,7 @@ static void vgroup_duplicate(Object *ob) BLI_addtail(&ob->defbase, cdg); idg = (ob->actdef - 1); - ob->actdef = BLI_countlist(&ob->defbase); + ob->actdef = BLI_listbase_count(&ob->defbase); icdg = (ob->actdef - 1); /* TODO, we might want to allow only copy selected verts here? - campbell */ @@ -1504,7 +1504,7 @@ static void vgroup_duplicate(Object *ob) bool *ED_vgroup_subset_from_select_type(Object *ob, eVGroupSelect subset_type, int *r_vgroup_tot, int *r_subset_count) { bool *vgroup_validmap = NULL; - *r_vgroup_tot = BLI_countlist(&ob->defbase); + *r_vgroup_tot = BLI_listbase_count(&ob->defbase); switch (subset_type) { case WT_VGROUP_ACTIVE: @@ -2051,7 +2051,7 @@ static void vgroup_normalize_all(Object *ob, ED_vgroup_parray_alloc(ob->data, &dvert_array, &dvert_tot, use_vert_sel); if (dvert_array) { - const int defbase_tot = BLI_countlist(&ob->defbase); + const int defbase_tot = BLI_listbase_count(&ob->defbase); bool *lock_flags = BKE_objdef_lock_flags_get(ob, defbase_tot); if ((lock_active == true) && @@ -2766,7 +2766,7 @@ static void vgroup_remap_update_users(Object *ob, int *map) static void vgroup_delete_update_users(Object *ob, int id) { - int i, defbase_tot = BLI_countlist(&ob->defbase) + 1; + int i, defbase_tot = BLI_listbase_count(&ob->defbase) + 1; int *map = MEM_mallocN(sizeof(int) * defbase_tot, "vgroup del"); map[id] = map[0] = 0; @@ -4237,7 +4237,7 @@ void OBJECT_OT_vertex_group_set_active(wmOperatorType *ot) static char *vgroup_init_remap(Object *ob) { bDeformGroup *def; - int defbase_tot = BLI_countlist(&ob->defbase); + int defbase_tot = BLI_listbase_count(&ob->defbase); char *name_array = MEM_mallocN(MAX_VGROUP_NAME * sizeof(char) * defbase_tot, "sort vgroups"); char *name; @@ -4254,7 +4254,7 @@ static int vgroup_do_remap(Object *ob, const char *name_array, wmOperator *op) { MDeformVert *dvert = NULL; bDeformGroup *def; - int defbase_tot = BLI_countlist(&ob->defbase); + int defbase_tot = BLI_listbase_count(&ob->defbase); /* needs a dummy index at the start*/ int *sort_map_update = MEM_mallocN(sizeof(int) * (defbase_tot + 1), "sort vgroups"); @@ -4378,7 +4378,7 @@ static int vertex_group_sort_exec(bContext *C, wmOperator *op) /*sort vgroup names*/ switch (sort_type) { case SORT_TYPE_NAME: - BLI_sortlist(&ob->defbase, vgroup_sort_name); + BLI_listbase_sort(&ob->defbase, vgroup_sort_name); break; case SORT_TYPE_BONEHIERARCHY: vgroup_sort_bone_hierarchy(ob, NULL); diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index b4114126b8a..eaa7cf40aca 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -558,7 +558,7 @@ static int render_layer_add_exec(bContext *C, wmOperator *UNUSED(op)) Scene *scene = CTX_data_scene(C); BKE_scene_add_render_layer(scene, NULL); - scene->r.actlay = BLI_countlist(&scene->r.layers) - 1; + scene->r.actlay = BLI_listbase_count(&scene->r.layers) - 1; DAG_id_tag_update(&scene->id, 0); WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 35d9b764043..454bb3b7ca3 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2320,7 +2320,7 @@ static int screen_set_exec(bContext *C, wmOperator *op) bScreen *screen_prev = screen; ScrArea *sa = CTX_wm_area(C); - int tot = BLI_countlist(&bmain->screen); + int tot = BLI_listbase_count(&bmain->screen); int delta = RNA_int_get(op->ptr, "delta"); /* temp screens are for userpref or render display */ @@ -2795,7 +2795,7 @@ static int spacedata_cleanup_exec(bContext *C, wmOperator *op) SpaceLink *sl = sa->spacedata.first; BLI_remlink(&sa->spacedata, sl); - tot += BLI_countlist(&sa->spacedata); + tot += BLI_listbase_count(&sa->spacedata); BKE_spacedata_freelist(&sa->spacedata); BLI_addtail(&sa->spacedata, sl); } @@ -2853,7 +2853,7 @@ static int repeat_history_invoke(bContext *C, wmOperator *op, const wmEvent *UNU uiLayout *layout; int items, i; - items = BLI_countlist(&wm->operators); + items = BLI_listbase_count(&wm->operators); if (items == 0) return OPERATOR_CANCELLED; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 431dd54b3c0..75bef040d2e 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -382,7 +382,7 @@ static int wpaint_mirror_vgroup_ensure(Object *ob, const int vgroup_active) mirrdef = defgroup_name_index(ob, name_flip); if (mirrdef == -1) { if (BKE_defgroup_new(ob, name_flip)) { - mirrdef = BLI_countlist(&ob->defbase) - 1; + mirrdef = BLI_listbase_count(&ob->defbase) - 1; } } @@ -1177,7 +1177,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA me = BKE_mesh_from_object(vc.obact); if (me && me->dvert && vc.v3d && vc.rv3d && vc.obact->defbase.first) { - const int defbase_tot = BLI_countlist(&vc.obact->defbase); + const int defbase_tot = BLI_listbase_count(&vc.obact->defbase); const int use_vert_sel = (me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0; int *groups = MEM_callocN(defbase_tot * sizeof(int), "groups"); bool found = false; @@ -2235,7 +2235,7 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UN /* set up auto-normalize, and generate map for detecting which * vgroups affect deform bones */ - wpd->defbase_tot = BLI_countlist(&ob->defbase); + wpd->defbase_tot = BLI_listbase_count(&ob->defbase); wpd->lock_flags = BKE_objdef_lock_flags_get(ob, wpd->defbase_tot); if (ts->auto_normalize || ts->multipaint || wpd->lock_flags) { wpd->vgroup_validmap = BKE_objdef_validmap_get(ob, wpd->defbase_tot); diff --git a/source/blender/editors/space_buttons/buttons_texture.c b/source/blender/editors/space_buttons/buttons_texture.c index cfdb5b0f8ba..c8cbf0f5794 100644 --- a/source/blender/editors/space_buttons/buttons_texture.c +++ b/source/blender/editors/space_buttons/buttons_texture.c @@ -256,7 +256,7 @@ static void buttons_texture_user_property_add(ListBase *users, ID *id, user->category = category; user->icon = icon; user->name = name; - user->index = BLI_countlist(users); + user->index = BLI_listbase_count(users); BLI_addtail(users, user); } @@ -273,7 +273,7 @@ static void buttons_texture_user_node_add(ListBase *users, ID *id, user->category = category; user->icon = icon; user->name = name; - user->index = BLI_countlist(users); + user->index = BLI_listbase_count(users); BLI_addtail(users, user); } @@ -468,7 +468,7 @@ void buttons_texture_context_compute(const bContext *C, SpaceButs *sbuts) } else { /* set one user as active based on active index */ - if (ct->index >= BLI_countlist(&ct->users)) + if (ct->index >= BLI_listbase_count(&ct->users)) ct->index = 0; ct->user = BLI_findlink(&ct->users, ct->index); diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index b44e942527c..2d5e5c6e0f2 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -95,7 +95,7 @@ static void console_scrollback_limit(SpaceConsole *sc) if (U.scrollback < 32) U.scrollback = 256; // XXX - save in user defaults - for (tot = BLI_countlist(&sc->scrollback); tot > U.scrollback; tot--) + for (tot = BLI_listbase_count(&sc->scrollback); tot > U.scrollback; tot--) console_scrollback_free(sc, sc->scrollback.first); } @@ -136,7 +136,7 @@ static void console_lb_debug__internal(ListBase *lb) { ConsoleLine *cl; - printf("%d: ", BLI_countlist(lb)); + printf("%d: ", BLI_listbase_count(lb)); for (cl = lb->first; cl; cl = cl->next) printf("<%s> ", cl->line); printf("\n"); diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index c6fcf746220..be65cdb2d4f 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -347,7 +347,7 @@ static void ui_imageuser_layer_menu(bContext *UNUSED(C), uiLayout *layout, void 0, 0, UI_UNIT_X * 5, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); uiItemS(layout); - nr = BLI_countlist(&rr->layers) - 1; + nr = BLI_listbase_count(&rr->layers) - 1; fake_name = ui_imageuser_layer_fake_name(rr); if (fake_name) { @@ -414,7 +414,7 @@ static void ui_imageuser_pass_menu(bContext *UNUSED(C), uiLayout *layout, void * uiItemS(layout); - nr = (rl ? BLI_countlist(&rl->passes) : 0) - 1; + nr = (rl ? BLI_listbase_count(&rl->passes) : 0) - 1; fake_name = ui_imageuser_pass_fake_name(rl); if (fake_name) { @@ -452,7 +452,7 @@ static void image_multi_inclay_cb(bContext *C, void *rr_v, void *iuser_v) { RenderResult *rr = rr_v; ImageUser *iuser = iuser_v; - int tot = BLI_countlist(&rr->layers); + int tot = BLI_listbase_count(&rr->layers); if (rr->rectf || rr->rect32) tot++; /* fake compo/sequencer layer */ @@ -480,7 +480,7 @@ static void image_multi_incpass_cb(bContext *C, void *rr_v, void *iuser_v) RenderLayer *rl = BLI_findlink(&rr->layers, iuser->layer); if (rl) { - int tot = BLI_countlist(&rl->passes); + int tot = BLI_listbase_count(&rl->passes); if (rr->rectf || rr->rect32) tot++; /* fake compo/sequencer layer */ diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 1b86b608a7c..836ff25bddc 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1024,7 +1024,7 @@ static int image_sequence_get_len(ListBase *frames, int *ofs) { ImageFrame *frame; - BLI_sortlist(frames, image_cmp_frame); + BLI_listbase_sort(frames, image_cmp_frame); frame = frames->first; if (frame) { diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 504256179c8..5464449a94e 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -126,10 +126,10 @@ void make_unique_prop_names(bContext *C, char *str) /* count total names */ for (a=0; aprop); - propcount+= BLI_countlist(&ob->sensors); - propcount+= BLI_countlist(&ob->controllers); - propcount+= BLI_countlist(&ob->actuators); + propcount+= BLI_listbase_count(&ob->prop); + propcount+= BLI_listbase_count(&ob->sensors); + propcount+= BLI_listbase_count(&ob->controllers); + propcount+= BLI_listbase_count(&ob->actuators); } if (propcount==0) { if (idar) MEM_freeN(idar); diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 1085bcfc20b..37efe1afcf5 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1436,7 +1436,7 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op) if (BLI_listbase_is_empty(&nlt->strips) == false) { NlaStrip *mstrip = (NlaStrip *)nlt->strips.first; - if ((mstrip->flag & NLASTRIP_FLAG_TEMP_META) && (BLI_countlist(&mstrip->strips) == 2)) { + if ((mstrip->flag & NLASTRIP_FLAG_TEMP_META) && (BLI_listbase_count(&mstrip->strips) == 2)) { /* remove this temp meta, so that we can see the strips inside */ BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); } diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index b64dc0eb03f..42259a37f45 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -214,7 +214,7 @@ void ED_node_sort(bNodeTree *ntree) { /* merge sort is the algorithm of choice here */ bNode *first_a, *first_b, *node_a, *node_b, *tmp; - int totnodes = BLI_countlist(&ntree->nodes); + int totnodes = BLI_listbase_count(&ntree->nodes); int k, a, b; k = 1; diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index ca13d87d632..a16adb09b4f 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -695,7 +695,7 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node) for (scene = bmain->scene.first; scene; scene = scene->id.next) { if (scene->nodetree && scene->use_nodes && ntreeHasTree(scene->nodetree, ntree)) { if (node->id == NULL || node->id == (ID *)scene) { - int num_layers = BLI_countlist(&scene->r.layers); + int num_layers = BLI_listbase_count(&scene->r.layers); scene->r.actlay = node->custom1; /* Clamp the value, because it might have come from a different * scene which could have more render layers than new one. diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c index 8ec5ad1f631..8dfc2ac8e83 100644 --- a/source/blender/editors/space_node/node_relationships.c +++ b/source/blender/editors/space_node/node_relationships.c @@ -203,7 +203,7 @@ static void snode_autoconnect(SpaceNode *snode, const bool allow_multiple, const } /* sort nodes left to right */ - BLI_sortlist(nodelist, sort_nodes_locx); + BLI_listbase_sort(nodelist, sort_nodes_locx); for (nli = nodelist->first; nli; nli = nli->next) { bNode *node_fr, *node_to; @@ -236,7 +236,7 @@ static void snode_autoconnect(SpaceNode *snode, const bool allow_multiple, const if (!has_selected_inputs) { /* no selected inputs, connect by finding suitable match */ - int num_inputs = BLI_countlist(&node_to->inputs); + int num_inputs = BLI_listbase_count(&node_to->inputs); for (i = 0; i < num_inputs; i++) { diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index 692aebb9072..ab0619604a9 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -300,7 +300,7 @@ static void ui_node_link_items(NodeLinkArg *arg, int in_out, NodeLinkItem **r_it for (ngroup = arg->bmain->nodetree.first; ngroup; ngroup = ngroup->id.next) { ListBase *lb = ((in_out == SOCK_IN) ? &ngroup->inputs : &ngroup->outputs); - totitems += BLI_countlist(lb); + totitems += BLI_listbase_count(lb); } if (totitems > 0) { diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index ccaeae34927..e28c775ad88 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -152,7 +152,7 @@ void ED_node_tree_pop(SpaceNode *snode) int ED_node_tree_depth(SpaceNode *snode) { - return BLI_countlist(&snode->treepath); + return BLI_listbase_count(&snode->treepath); } bNodeTree *ED_node_tree_get(SpaceNode *snode, int level) diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 3f1f8be379c..ab7b1583275 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -1305,7 +1305,7 @@ static KeyingSet *verify_active_keyingset(Scene *scene, short add) // XXX the default settings have yet to evolve if ((add) && (ks == NULL)) { ks = BKE_keyingset_add(&scene->keyingsets, NULL, NULL, KEYINGSET_ABSOLUTE, 0); - scene->active_keyingset = BLI_countlist(&scene->keyingsets); + scene->active_keyingset = BLI_listbase_count(&scene->keyingsets); } return ks; @@ -1347,7 +1347,7 @@ static void do_outliner_keyingset_editop(SpaceOops *soops, KeyingSet *ks, ListBa /* TODO: what do we do with group name? * for now, we don't supply one, and just let this use the KeyingSet name */ BKE_keyingset_add_path(ks, id, NULL, path, array_index, flag, groupmode); - ks->active_path = BLI_countlist(&ks->paths); + ks->active_path = BLI_listbase_count(&ks->paths); break; } case KEYINGSET_EDITMODE_REMOVE: diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 1123145bad5..c8ca4e1a7da 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -518,7 +518,7 @@ static void text_drawcache_init(SpaceText *st) DrawCache *drawcache = MEM_callocN(sizeof(DrawCache), "text draw cache"); drawcache->winx = -1; - drawcache->nlines = BLI_countlist(&st->text->lines); + drawcache->nlines = BLI_listbase_count(&st->text->lines); drawcache->text_id[0] = '\0'; st->drawcache = drawcache; @@ -559,7 +559,7 @@ static void text_update_drawcache(SpaceText *st, ARegion *ar) int lineno = 0, size, lines_count; int *fp = drawcache->line_height, *new_tail, *old_tail; - nlines = BLI_countlist(&txt->lines); + nlines = BLI_listbase_count(&txt->lines); size = sizeof(int) * nlines; if (fp) fp = MEM_reallocN(fp, size); @@ -604,7 +604,7 @@ static void text_update_drawcache(SpaceText *st, ARegion *ar) } if (full_update || drawcache->update_flag) { - nlines = BLI_countlist(&txt->lines); + nlines = BLI_listbase_count(&txt->lines); if (st->showlinenrs) st->linenrs_tot = (int)floor(log10((float)nlines)) + 1; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index ecedf35dde2..7bcc95e9871 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2496,7 +2496,7 @@ static void draw_dm_edges_weight_interp(BMEditMesh *em, DerivedMesh *dm, const c data.bm = em->bm; data.cd_dvert_offset = CustomData_get_offset(&em->bm->vdata, CD_MDEFORMVERT); - data.defgroup_tot = BLI_countlist(&ob->defbase); + data.defgroup_tot = BLI_listbase_count(&ob->defbase); data.vgroup_index = ob->actdef - 1; data.weight_user = weight_user; UI_GetThemeColor3fv(TH_VERTEX_UNREFERENCED, data.alert_color); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 77df6d3d51a..e921a436c85 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2003,7 +2003,7 @@ static void draw_dupli_objects_color( tbase.flag = OB_FROMDUPLI | base->flag; lb = object_duplilist(G.main->eval_ctx, scene, base->object); - // BLI_sortlist(lb, dupli_ob_sort); /* might be nice to have if we have a dupli list with mixed objects. */ + // BLI_listbase_sort(lb, dupli_ob_sort); /* might be nice to have if we have a dupli list with mixed objects. */ apply_data = duplilist_apply(base->object, lb); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index dc0b8403e4f..e16a7155fe6 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -3150,7 +3150,7 @@ static void posttrans_gpd_clean(bGPdata *gpd) bGPDframe *gpf, *gpfn; bool is_double = false; - BLI_sortlist_r(&gpl->frames, &is_double, gpf_cmp_frame); + BLI_listbase_sort_r(&gpl->frames, &is_double, gpf_cmp_frame); if (is_double) { for (gpf = gpl->frames.first; gpf; gpf = gpfn) { @@ -3177,7 +3177,7 @@ static void posttrans_mask_clean(Mask *mask) MaskLayerShape *masklay_shape, *masklay_shape_next; bool is_double = false; - BLI_sortlist_r(&masklay->splines_shapes, &is_double, masklay_shape_cmp_frame); + BLI_listbase_sort_r(&masklay->splines_shapes, &is_double, masklay_shape_cmp_frame); if (is_double) { for (masklay_shape = masklay->splines_shapes.first; masklay_shape; masklay_shape = masklay_shape_next) { diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index c7d63da8281..ba93d4463b7 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -392,7 +392,7 @@ void BIF_selectTransformOrientationValue(bContext *C, int orientation) int BIF_countTransformOrientation(const bContext *C) { ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces; - return BLI_countlist(transform_spaces); + return BLI_listbase_count(transform_spaces); } bool applyTransformOrientation(const bContext *C, float mat[3][3], char *r_name) diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index a3e2ab3907b..cd636591212 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -2267,7 +2267,7 @@ static bool peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, } } - BLI_sortlist(depth_peels, cmpPeel); + BLI_listbase_sort(depth_peels, cmpPeel); removeDoublesPeel(depth_peels); return retval; diff --git a/source/blender/editors/util/ed_transverts.c b/source/blender/editors/util/ed_transverts.c index 104b628c25a..c3eef94f4bb 100644 --- a/source/blender/editors/util/ed_transverts.c +++ b/source/blender/editors/util/ed_transverts.c @@ -310,7 +310,7 @@ void ED_transverts_create_from_obedit(TransVertStore *tvs, Object *obedit, const } else if (obedit->type == OB_ARMATURE) { bArmature *arm = obedit->data; - int totmalloc = BLI_countlist(arm->edbo); + int totmalloc = BLI_listbase_count(arm->edbo); totmalloc *= 2; /* probably overkill but bones can have 2 trans verts each */ @@ -441,7 +441,7 @@ void ED_transverts_create_from_obedit(TransVertStore *tvs, Object *obedit, const } else if (obedit->type == OB_MBALL) { MetaBall *mb = obedit->data; - int totmalloc = BLI_countlist(mb->editelems); + int totmalloc = BLI_listbase_count(mb->editelems); tv = tvs->transverts = MEM_callocN(totmalloc * sizeof(TransVert), __func__); -- cgit v1.2.3