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>2014-09-28 11:29:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-09-28 11:29:48 +0400
commit839e24c0c3378a80eb41b209c96dd9d4ff529055 (patch)
tree15ed3cfea081759217a303c0715922db5a02a148 /source/blender/blenlib/BLI_array.h
parent4a92620d3eb32da477bb7995c517e4f4b071a6a4 (diff)
Correct recent error in BLI_array_append_ret
Diffstat (limited to 'source/blender/blenlib/BLI_array.h')
-rw-r--r--source/blender/blenlib/BLI_array.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenlib/BLI_array.h b/source/blender/blenlib/BLI_array.h
index a1f25a0208a..db33c5cec8b 100644
--- a/source/blender/blenlib/BLI_array.h
+++ b/source/blender/blenlib/BLI_array.h
@@ -88,12 +88,12 @@ void _bli_array_grow_func(void **arr_p, const void *arr_static,
(((void *)(arr) == NULL) && \
((void *)(_##arr##_static) != NULL) && \
/* don't add _##arr##_count below because it must be zero */ \
- (_bli_array_totalsize_static(arr) >= _##arr##_count + num)) ? \
+ (_bli_array_totalsize_static(arr) >= _##arr##_count + (num))) ? \
/* we have an empty array and a static var big enough */ \
(void)(arr = (void *)_##arr##_static) \
: \
/* use existing static array or allocate */ \
- (LIKELY(_bli_array_totalsize(arr) >= _##arr##_count + num) ? \
+ (LIKELY(_bli_array_totalsize(arr) >= _##arr##_count + (num)) ? \
(void)0 /* do nothing */ : \
_bli_array_grow_func((void **)&(arr), _##arr##_static, \
sizeof(*(arr)), _##arr##_count, num, \
@@ -126,7 +126,7 @@ void _bli_array_grow_func(void **arr_p, const void *arr_static,
/* appends (grows) & returns a pointer to the uninitialized memory */
#define BLI_array_append_ret(arr) \
- (BLI_array_reserve(arr, 1), &arr[(_##arr##_count += 1)])
+ (BLI_array_reserve(arr, 1), &arr[(_##arr##_count++)])
#define BLI_array_free(arr) \
if (arr && (char *)arr != _##arr##_static) { \