diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-15 15:36:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-15 15:39:08 +0300 |
commit | ccdacf1c9b31b15e188aa9e9adb044ffd0ca0da4 (patch) | |
tree | 086fc08c0a7d7ecefb4ed6666a3c2fd813142c8b /source/blender/editors/curve | |
parent | 4da6c496137042d4c90292f5567a6702a3df3323 (diff) |
Cleanup: use '_len' instead of '_size' w/ BLI API
- When returning the number of items in a collection use BLI_*_len()
- Keep _size() for size in bytes.
- Keep _count() for data structures that don't store length
(hint this isn't a simple getter).
See P611 to apply instead of manually resolving conflicts.
Diffstat (limited to 'source/blender/editors/curve')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 2 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve_paint.c | 12 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve_select.c | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index f4ee05636c7..6e059342a6b 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -527,7 +527,7 @@ static GHash *dupli_keyIndexHash(GHash *keyindex) GHash *gh; GHashIterator gh_iter; - gh = BLI_ghash_ptr_new_ex("dupli_keyIndex gh", BLI_ghash_size(keyindex)); + gh = BLI_ghash_ptr_new_ex("dupli_keyIndex gh", BLI_ghash_len(keyindex)); GHASH_ITER (gh_iter, keyindex) { void *cv = BLI_ghashIterator_getKey(&gh_iter); diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index 4602945d11c..5bba21f6252 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -359,7 +359,7 @@ static void curve_draw_stroke_3d(const struct bContext *UNUSED(C), ARegion *UNUS wmOperator *op = arg; struct CurveDrawData *cdd = op->customdata; - const int stroke_len = BLI_mempool_count(cdd->stroke_elem_pool); + const int stroke_len = BLI_mempool_len(cdd->stroke_elem_pool); if (stroke_len == 0) { return; @@ -677,7 +677,7 @@ static void curve_draw_exec_precalc(wmOperator *op) if (!RNA_property_is_set(op->ptr, prop)) { bool use_cyclic = false; - if (BLI_mempool_count(cdd->stroke_elem_pool) > 2) { + if (BLI_mempool_len(cdd->stroke_elem_pool) > 2) { BLI_mempool_iter iter; const struct StrokeElem *selem, *selem_first, *selem_last; @@ -703,7 +703,7 @@ static void curve_draw_exec_precalc(wmOperator *op) (cps->radius_taper_end != 0.0f)) { /* note, we could try to de-duplicate the length calculations above */ - const int stroke_len = BLI_mempool_count(cdd->stroke_elem_pool); + const int stroke_len = BLI_mempool_len(cdd->stroke_elem_pool); BLI_mempool_iter iter; struct StrokeElem *selem, *selem_prev; @@ -763,14 +763,14 @@ static int curve_draw_exec(bContext *C, wmOperator *op) Curve *cu = obedit->data; ListBase *nurblist = object_editcurve_get(obedit); - int stroke_len = BLI_mempool_count(cdd->stroke_elem_pool); + int stroke_len = BLI_mempool_len(cdd->stroke_elem_pool); const bool is_3d = (cu->flag & CU_3D) != 0; invert_m4_m4(obedit->imat, obedit->obmat); - if (BLI_mempool_count(cdd->stroke_elem_pool) == 0) { + if (BLI_mempool_len(cdd->stroke_elem_pool) == 0) { curve_draw_stroke_from_operator(op); - stroke_len = BLI_mempool_count(cdd->stroke_elem_pool); + stroke_len = BLI_mempool_len(cdd->stroke_elem_pool); } ED_curve_deselect_all(cu->editnurb); diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c index 02b8970731c..4a4b13d0d1b 100644 --- a/source/blender/editors/curve/editcurve_select.c +++ b/source/blender/editors/curve/editcurve_select.c @@ -1607,7 +1607,7 @@ static void curve_select_shortest_path_surf(Nurb *nu, int vert_src, int vert_dst int axis, sign; int u, v; - vert_curr = *((int *)BLI_heap_popmin(heap)); + vert_curr = *((int *)BLI_heap_pop_min(heap)); if (vert_curr == vert_dst) { break; } |