diff options
Diffstat (limited to 'source/blender/blenlib/BLI_buffer.h')
-rw-r--r-- | source/blender/blenlib/BLI_buffer.h | 6 |
1 files changed, 4 insertions, 2 deletions
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); |