Cleanup: rename BLI_*_empty() -> clear()

Consistent with other BLI API's
This commit is contained in:
Campbell Barton 2018-02-01 12:06:57 +11:00
parent 0a4e170c28
commit 078e012cd9
14 changed files with 22 additions and 22 deletions

@ -4149,7 +4149,7 @@ void DM_init_origspace(DerivedMesh *dm)
BKE_mesh_calc_poly_normal(mp, l, mv, p_nor);
axis_dominant_v3_to_m3(mat, p_nor);
BLI_array_empty(vcos_2d);
BLI_array_clear(vcos_2d);
BLI_array_reserve(vcos_2d, mp->totloop);
for (j = 0; j < mp->totloop; j++, l++) {
mul_v3_m3v3(co, mat, mv[l->v].co);

@ -1326,7 +1326,7 @@ static void pbvh_bmesh_collapse_edge(
/* Note: this could be done with BM_vert_splice(), but that
* requires handling other issues like duplicate edges, so doesn't
* really buy anything. */
BLI_buffer_empty(deleted_faces);
BLI_buffer_clear(deleted_faces);
BMLoop *l;

@ -361,7 +361,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
#ifdef USE_DYNSIZE
CCGVertHDL fverts[nverts];
#else
BLI_array_empty(fverts);
BLI_array_clear(fverts);
BLI_array_grow_items(fverts, nverts);
#endif
@ -400,7 +400,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
#ifdef USE_DYNSIZE
CCGVertHDL fverts[nverts];
#else
BLI_array_empty(fverts);
BLI_array_clear(fverts);
BLI_array_grow_items(fverts, nverts);
#endif
@ -744,7 +744,7 @@ static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss,
#ifdef USE_DYNSIZE
CCGVertHDL fVerts[mp->totloop];
#else
BLI_array_empty(fVerts);
BLI_array_clear(fVerts);
BLI_array_grow_items(fVerts, mp->totloop);
#endif
@ -4840,7 +4840,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
*((int *)ccgSubSurf_getFaceUserData(ss, f)) = vertNum;
#ifndef USE_DYNSIZE
BLI_array_empty(loopidx);
BLI_array_clear(loopidx);
BLI_array_grow_items(loopidx, numVerts);
#endif
for (s = 0; s < numVerts; s++) {
@ -4848,7 +4848,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
}
#ifndef USE_DYNSIZE
BLI_array_empty(vertidx);
BLI_array_clear(vertidx);
BLI_array_grow_items(vertidx, numVerts);
#endif
for (s = 0; s < numVerts; s++) {

@ -151,7 +151,7 @@ void _bli_array_grow_func(void **arr_p, const void *arr_static,
/**
* resets the logical size of an array to zero, but doesn't
* free the memory. */
#define BLI_array_empty(arr) \
#define BLI_array_clear(arr) \
{ _##arr##_count = 0; } (void)0
/**

@ -77,7 +77,7 @@ enum {
(BLI_buffer_at(buffer_, type_, (buffer_)->count - 1) = val_) \
)
#define BLI_buffer_empty(buffer_) { \
#define BLI_buffer_clear(buffer_) { \
(buffer_)->count = 0; \
} (void)0

@ -166,7 +166,7 @@ void bmo_dissolve_faces_exec(BMesh *bm, BMOperator *op)
continue;
}
BLI_array_empty(faces);
BLI_array_clear(faces);
faces = NULL; /* forces different allocatio */
BMW_init(&regwalker, bm, BMW_ISLAND_MANIFOLD,

@ -186,7 +186,7 @@ void bmo_edgenet_prepare_exec(BMesh *bm, BMOperator *op)
BLI_array_count_set(edges2, BLI_array_count(edges));
}
BLI_array_empty(edges);
BLI_array_clear(edges);
count++;
}

@ -521,7 +521,7 @@ static void hull_from_bullet(
int j;
/* Get face vertex indices */
BLI_array_empty(fvi);
BLI_array_clear(fvi);
BLI_array_grow_items(fvi, len);
plConvexHullGetFaceVertices(hull, i, fvi);

@ -1011,8 +1011,8 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
/* figure out which pattern to use */
BLI_array_empty(edges);
BLI_array_empty(verts);
BLI_array_clear(edges);
BLI_array_clear(verts);
BLI_array_grow_items(edges, face->len);
BLI_array_grow_items(verts, face->len);
@ -1140,7 +1140,7 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
face = fd->face;
/* figure out which pattern to use */
BLI_array_empty(verts);
BLI_array_clear(verts);
pat = fd->pat;
@ -1148,8 +1148,8 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op)
int vlen;
/* ok, no pattern. we still may be able to do something */
BLI_array_empty(loops);
BLI_array_empty(loops_split);
BLI_array_clear(loops);
BLI_array_clear(loops_split);
/* for case of two edges, connecting them shouldn't be too hard */
BLI_array_grow_items(loops, face->len);

@ -3736,7 +3736,7 @@ static int bevel_edge_order_extend(BMesh *bm, BevVert *bv, int i)
tryj = bevel_edge_order_extend(bm, bv, j + 1);
if (tryj > bestj || (tryj == bestj && edges_face_connected_at_vert(bv->edges[tryj].e, bv->edges[0].e))) {
bestj = tryj;
BLI_array_empty(save_path);
BLI_array_clear(save_path);
for (k = j + 1; k <= bestj; k++) {
BLI_array_append(save_path, bv->edges[k].e);
}

@ -122,7 +122,7 @@ void BM_mesh_separate_faces(
/* Perform the split */
BM_face_loop_separate_multi(bm, loop_split.data, loop_split.count);
BLI_buffer_empty(&loop_split);
BLI_buffer_clear(&loop_split);
}
} while ((l_iter = l_iter->next) != l_first);
}

@ -400,7 +400,7 @@ static void bm_face_split_by_edges(
bm, f, edge_net_temp_buf->data, edge_net_temp_buf->count,
&face_arr, &face_arr_len);
BLI_buffer_empty(edge_net_temp_buf);
BLI_buffer_clear(edge_net_temp_buf);
if (face_arr_len) {
int i;

@ -1801,7 +1801,7 @@ static int uv_remove_doubles_exec(bContext *C, wmOperator *op)
float uv_min[2];
float uv_max[2];
BLI_array_empty(loop_arr);
BLI_array_clear(loop_arr);
BLI_array_append(loop_arr, vert_arr[uv_a_index].uv_loop);
uv_a = vert_arr[uv_a_index].uv_loop->uv;

@ -2185,7 +2185,7 @@ static void p_chart_simplify_compute(PChart *chart)
e->u.nextcollapse = NULL;
/* pop edge collapse out of heap one by one */
while (!BLI_heap_empty(heap)) {
while (!BLI_heap_is_empty(heap)) {
if (ncollapsed == NCOLLAPSE)
break;