Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-12-23 17:52:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-12-23 17:52:54 +0300
commitb9dea0f94159f4b64e65ec80314d393107d4eb28 (patch)
tree37261270086c9233fdb0c97b1765c316da5e2051 /source/blender/blenlib/BLI_buffer.h
parentac782ba31cba4d5c349e97326cc7d77dfc71fd70 (diff)
Remove BLI_buffer calloc option
This wasn't working reliably (after clear for example), and wasn't used anywhere.
Diffstat (limited to 'source/blender/blenlib/BLI_buffer.h')
-rw-r--r--source/blender/blenlib/BLI_buffer.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/source/blender/blenlib/BLI_buffer.h b/source/blender/blenlib/BLI_buffer.h
index 6ea9e765c1d..0c0845daf19 100644
--- a/source/blender/blenlib/BLI_buffer.h
+++ b/source/blender/blenlib/BLI_buffer.h
@@ -35,31 +35,27 @@ typedef struct {
enum {
BLI_BUFFER_NOP = 0,
BLI_BUFFER_USE_STATIC = (1 << 0),
- BLI_BUFFER_USE_CALLOC = (1 << 1), /* ensure the array is always calloc'd */
};
#define BLI_buffer_declare_static(type_, name_, flag_, static_count_) \
char name_ ## user; /* warn for free only */ \
type_ name_ ## _static_[static_count_]; \
BLI_Buffer name_ = { \
- /* clear the static memory if this is a calloc'd array */ \
- ((void)((flag_ & BLI_BUFFER_USE_CALLOC) ? \
- memset(name_ ## _static_, 0, sizeof(name_ ## _static_)) : NULL \
- ), /* memset-end */ \
- name_ ## _static_), \
- sizeof(type_), \
- 0, \
- static_count_, \
- BLI_BUFFER_USE_STATIC | flag_}
+ (name_ ## _static_), \
+ sizeof(type_), \
+ 0, \
+ static_count_, \
+ BLI_BUFFER_USE_STATIC | (flag_)}
/* never use static*/
#define BLI_buffer_declare(type_, name_, flag_) \
bool name_ ## user; /* warn for free only */ \
- BLI_Buffer name_ = {NULL, \
- sizeof(type_), \
- 0, \
- 0, \
- flag_}
+ BLI_Buffer name_ = { \
+ NULL, \
+ sizeof(type_), \
+ 0, \
+ 0, \
+ (flag_)}
#define BLI_buffer_at(buffer_, type_, index_) ( \
(((type_ *)(buffer_)->data)[ \