diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-10-10 12:10:13 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-10-10 12:10:13 +0400 |
commit | 642c8243e7a5425de949892ab7a43a3e2077e122 (patch) | |
tree | 33e00e2f8c647970f0693a353763ae70eaa66ef0 /source/blender | |
parent | c6d8ac9fe236c0136a1d9aebbdd0ba080617a725 (diff) |
BLI_buffer: empty macro
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_bmesh.c | 3 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_buffer.h | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index 8940b137b42..1a35dea2459 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -883,7 +883,8 @@ 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. */ - deleted_faces->count = 0; + BLI_buffer_empty(deleted_faces); + BM_ITER_ELEM (f, &bm_iter, v_del, BM_FACES_OF_VERT) { BMVert *v_tri[3]; BMFace *existing_face; diff --git a/source/blender/blenlib/BLI_buffer.h b/source/blender/blenlib/BLI_buffer.h index 9c4b4b00b24..700abcad9bd 100644 --- a/source/blender/blenlib/BLI_buffer.h +++ b/source/blender/blenlib/BLI_buffer.h @@ -88,13 +88,15 @@ enum { #define BLI_buffer_resize_data(buffer_, type_, new_count_) ( \ (BLI_buffer_resize(buffer_, new_count_), new_count_ ? BLI_buffer_array(buffer_, type_) : NULL)) - - #define BLI_buffer_append(buffer_, type_, val_) ( \ BLI_buffer_resize(buffer_, (buffer_)->count + 1), \ (BLI_buffer_at(buffer_, type_, (buffer_)->count - 1) = val_) \ ) +#define BLI_buffer_empty(buffer_) { \ + (buffer_)->count = 0; \ +} (void)0 + /* Never decreases the amount of memory allocated */ void BLI_buffer_resize(BLI_Buffer *buffer, int new_count); |