diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-07-06 05:05:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-07-06 05:09:52 +0300 |
commit | 3382b07ad6cfbb117cf8ec8fc95aa46cf585237e (patch) | |
tree | e202bacdebb7808b0dfa73469fdc00570a2abd3f /source/blender/bmesh/operators | |
parent | 432bfbf7a3b74943b1c251c12bd76616da23991f (diff) |
Cleanup: rename 'count' to 'len'
Reserve the term count for values that require calculation
(typically linked lists).
Diffstat (limited to 'source/blender/bmesh/operators')
-rw-r--r-- | source/blender/bmesh/operators/bmo_beautify.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_bisect_plane.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_create.c | 6 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_edgenet.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_extrude.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_fill_attribute.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_fill_edgeloop.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_fill_holes.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_offset_edgeloops.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_planar_faces.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_rotate_edges.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_triangulate.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_utils.c | 2 |
13 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/bmesh/operators/bmo_beautify.c b/source/blender/bmesh/operators/bmo_beautify.c index de26ca5ebd2..a72ff6363ed 100644 --- a/source/blender/bmesh/operators/bmo_beautify.c +++ b/source/blender/bmesh/operators/bmo_beautify.c @@ -59,7 +59,7 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op) /* will over alloc if some edges can't be rotated */ edge_array = MEM_mallocN( - sizeof(*edge_array) * (size_t)BMO_slot_buffer_count(op->slots_in, "edges"), __func__); + sizeof(*edge_array) * (size_t)BMO_slot_buffer_len(op->slots_in, "edges"), __func__); BMO_ITER (e, &siter, op->slots_in, "edges", BM_EDGE) { diff --git a/source/blender/bmesh/operators/bmo_bisect_plane.c b/source/blender/bmesh/operators/bmo_bisect_plane.c index 55b6337bea4..6296694f121 100644 --- a/source/blender/bmesh/operators/bmo_bisect_plane.c +++ b/source/blender/bmesh/operators/bmo_bisect_plane.c @@ -68,7 +68,7 @@ void bmo_bisect_plane_exec(BMesh *bm, BMOperator *op) /* Use an array of vertices because 'geom' contains both verts and edges that may use them. * Removing a vert may remove and edge which is later checked by #BMO_ITER. * over-allocate the total possible vert count. */ - const int vert_arr_max = min_ii(bm->totvert, BMO_slot_buffer_count(op->slots_in, "geom")); + const int vert_arr_max = min_ii(bm->totvert, BMO_slot_buffer_len(op->slots_in, "geom")); BMVert **vert_arr = MEM_mallocN(sizeof(*vert_arr) * (size_t)vert_arr_max, __func__); BMOIter siter; BMVert *v; diff --git a/source/blender/bmesh/operators/bmo_create.c b/source/blender/bmesh/operators/bmo_create.c index 2e2a7e0964e..a740e4d66e8 100644 --- a/source/blender/bmesh/operators/bmo_create.c +++ b/source/blender/bmesh/operators/bmo_create.c @@ -172,7 +172,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op) BMO_op_exec(bm, &op_sub); /* return if edge net create did something */ - if (BMO_slot_buffer_count(op_sub.slots_out, "faces.out")) { + if (BMO_slot_buffer_len(op_sub.slots_out, "faces.out")) { BMO_slot_copy(&op_sub, slots_out, "faces.out", op, slots_out, "faces.out"); BMO_op_finish(bm, &op_sub); return; @@ -191,7 +191,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op) BMO_op_exec(bm, &op_sub); /* if we dissolved anything, then return */ - if (BMO_slot_buffer_count(op_sub.slots_out, "region.out")) { + if (BMO_slot_buffer_len(op_sub.slots_out, "region.out")) { BMO_slot_copy(&op_sub, slots_out, "region.out", op, slots_out, "faces.out"); BMO_op_finish(bm, &op_sub); return; @@ -211,7 +211,7 @@ void bmo_contextual_create_exec(BMesh *bm, BMOperator *op) BMO_op_exec(bm, &op_sub); /* return if edge loop fill did something */ - if (BMO_slot_buffer_count(op_sub.slots_out, "faces.out")) { + if (BMO_slot_buffer_len(op_sub.slots_out, "faces.out")) { BMO_slot_copy(&op_sub, slots_out, "faces.out", op, slots_out, "faces.out"); BMO_op_finish(bm, &op_sub); return; diff --git a/source/blender/bmesh/operators/bmo_edgenet.c b/source/blender/bmesh/operators/bmo_edgenet.c index 5449762b83c..8e4b0732feb 100644 --- a/source/blender/bmesh/operators/bmo_edgenet.c +++ b/source/blender/bmesh/operators/bmo_edgenet.c @@ -79,7 +79,7 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op) BMO_op_exec(bm, &op_attr); /* check if some faces couldn't be touched */ - if (BMO_slot_buffer_count(op_attr.slots_out, "faces_fail.out")) { + if (BMO_slot_buffer_len(op_attr.slots_out, "faces_fail.out")) { BMO_op_callf(bm, op->flag, "recalc_face_normals faces=%S", &op_attr, "faces_fail.out"); } BMO_op_finish(bm, &op_attr); diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c index ffdce943d9f..0cedc2324f2 100644 --- a/source/blender/bmesh/operators/bmo_extrude.c +++ b/source/blender/bmesh/operators/bmo_extrude.c @@ -459,7 +459,7 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) } /* Allocate array to store possible vertices that will be dissolved. */ - int boundary_edges_len = BMO_slot_map_count(dupeop.slots_out, "boundary_map.out"); + int boundary_edges_len = BMO_slot_map_len(dupeop.slots_out, "boundary_map.out"); /* We do not know the real number of boundary vertices. */ int boundary_verts_len_maybe = 2 * boundary_edges_len; dissolve_verts = MEM_mallocN(boundary_verts_len_maybe * sizeof(*dissolve_verts), __func__); diff --git a/source/blender/bmesh/operators/bmo_fill_attribute.c b/source/blender/bmesh/operators/bmo_fill_attribute.c index e377fa6079b..5e8924c4a3b 100644 --- a/source/blender/bmesh/operators/bmo_fill_attribute.c +++ b/source/blender/bmesh/operators/bmo_fill_attribute.c @@ -161,7 +161,7 @@ void bmo_face_attribute_fill_exec(BMesh *bm, BMOperator *op) /* now we can copy adjacent data */ face_tot = bmesh_face_attribute_fill(bm, use_normals, use_data); - if (face_tot != BMO_slot_buffer_count(op->slots_in, "faces")) { + if (face_tot != BMO_slot_buffer_len(op->slots_in, "faces")) { /* any remaining tags will be skipped */ BMO_slot_buffer_from_enabled_hflag( bm, op, op->slots_out, "faces_fail.out", BM_FACE, BM_ELEM_TAG); diff --git a/source/blender/bmesh/operators/bmo_fill_edgeloop.c b/source/blender/bmesh/operators/bmo_fill_edgeloop.c index 2b481542463..da4567d947b 100644 --- a/source/blender/bmesh/operators/bmo_fill_edgeloop.c +++ b/source/blender/bmesh/operators/bmo_fill_edgeloop.c @@ -35,7 +35,7 @@ void bmo_edgeloop_fill_exec(BMesh *bm, BMOperator *op) { /* first collect an array of unique from the edges */ - const int tote = BMO_slot_buffer_count(op->slots_in, "edges"); + const int tote = BMO_slot_buffer_len(op->slots_in, "edges"); const int totv = tote; /* these should be the same */ BMVert **verts = MEM_mallocN(sizeof(*verts) * totv, __func__); diff --git a/source/blender/bmesh/operators/bmo_fill_holes.c b/source/blender/bmesh/operators/bmo_fill_holes.c index 64107fefe73..a24d81c5bdb 100644 --- a/source/blender/bmesh/operators/bmo_fill_holes.c +++ b/source/blender/bmesh/operators/bmo_fill_holes.c @@ -66,7 +66,7 @@ void bmo_holes_fill_exec(BMesh *bm, BMOperator *op) BMO_op_exec(bm, &op_attr); /* check if some faces couldn't be touched */ - if (BMO_slot_buffer_count(op_attr.slots_out, "faces_fail.out")) { + if (BMO_slot_buffer_len(op_attr.slots_out, "faces_fail.out")) { BMOIter siter; BMFace *f; diff --git a/source/blender/bmesh/operators/bmo_offset_edgeloops.c b/source/blender/bmesh/operators/bmo_offset_edgeloops.c index 98a8432cfb1..28f2c9a47aa 100644 --- a/source/blender/bmesh/operators/bmo_offset_edgeloops.c +++ b/source/blender/bmesh/operators/bmo_offset_edgeloops.c @@ -74,7 +74,7 @@ static BMFace *bm_face_split_walk_back(BMesh *bm, BMLoop *l_src, BMLoop **r_l) void bmo_offset_edgeloops_exec(BMesh *bm, BMOperator *op) { - const int edges_num = BMO_slot_buffer_count(op->slots_in, "edges"); + const int edges_num = BMO_slot_buffer_len(op->slots_in, "edges"); BMVert **verts; STACK_DECLARE(verts); int i; diff --git a/source/blender/bmesh/operators/bmo_planar_faces.c b/source/blender/bmesh/operators/bmo_planar_faces.c index c8f9d9a38dd..53cfc379269 100644 --- a/source/blender/bmesh/operators/bmo_planar_faces.c +++ b/source/blender/bmesh/operators/bmo_planar_faces.c @@ -41,7 +41,7 @@ void bmo_planar_faces_exec(BMesh *bm, BMOperator *op) { const float fac = BMO_slot_float_get(op->slots_in, "factor"); const int iterations = BMO_slot_int_get(op->slots_in, "iterations"); - const int faces_num = BMO_slot_buffer_count(op->slots_in, "faces"); + const int faces_num = BMO_slot_buffer_len(op->slots_in, "faces"); const float eps = 0.00001f; const float eps_sq = square_f(eps); diff --git a/source/blender/bmesh/operators/bmo_rotate_edges.c b/source/blender/bmesh/operators/bmo_rotate_edges.c index f05f6489c99..10dd9dcc9b7 100644 --- a/source/blender/bmesh/operators/bmo_rotate_edges.c +++ b/source/blender/bmesh/operators/bmo_rotate_edges.c @@ -234,7 +234,7 @@ void bmo_rotate_edges_exec(BMesh *bm, BMOperator *op) { BMOIter siter; BMEdge *e; - const int edges_len = BMO_slot_buffer_count(op->slots_in, "edges"); + const int edges_len = BMO_slot_buffer_len(op->slots_in, "edges"); const bool use_ccw = BMO_slot_bool_get(op->slots_in, "use_ccw"); const bool is_single = (edges_len == 1); short check_flag = is_single ? BM_EDGEROT_CHECK_EXISTS : diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c index f6d612f31eb..9fa74bb64c3 100644 --- a/source/blender/bmesh/operators/bmo_triangulate.c +++ b/source/blender/bmesh/operators/bmo_triangulate.c @@ -74,7 +74,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) uint nors_tot; bool calc_winding = false; - sf_vert_map = BLI_ghash_ptr_new_ex(__func__, BMO_slot_buffer_count(op->slots_in, "edges")); + sf_vert_map = BLI_ghash_ptr_new_ex(__func__, BMO_slot_buffer_len(op->slots_in, "edges")); BMO_slot_vec_get(op->slots_in, "normal", normal); diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index c056302ca0f..7d2b6b73455 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -393,7 +393,7 @@ void bmo_smooth_vert_exec(BMesh *UNUSED(bm), BMOperator *op) BMIter iter; BMVert *v; BMEdge *e; - float(*cos)[3] = MEM_mallocN(sizeof(*cos) * BMO_slot_buffer_count(op->slots_in, "verts"), + float(*cos)[3] = MEM_mallocN(sizeof(*cos) * BMO_slot_buffer_len(op->slots_in, "verts"), __func__); float *co, *co2, clip_dist = BMO_slot_float_get(op->slots_in, "clip_dist"); const float fac = BMO_slot_float_get(op->slots_in, "factor"); |