[Bf-blender-cvs] [642c824] master: BLI_buffer: empty macro

Campbell Barton noreply at git.blender.org
Fri Oct 10 10:11:09 CEST 2014


Commit: 642c8243e7a5425de949892ab7a43a3e2077e122
Author: Campbell Barton
Date:   Fri Oct 10 10:10:13 2014 +0200
Branches: master
https://developer.blender.org/rB642c8243e7a5425de949892ab7a43a3e2077e122

BLI_buffer: empty macro

===================================================================

M	source/blender/blenkernel/intern/pbvh_bmesh.c
M	source/blender/blenlib/BLI_buffer.h

===================================================================

diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 8940b13..1a35dea 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 9c4b4b0..700abca 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);




More information about the Bf-blender-cvs mailing list