diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-16 19:49:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-16 19:49:48 +0400 |
commit | aaf14ead155f1a9014195e11a1d8aca03311b0be (patch) | |
tree | 8b03e531837a18dda2601cb5b7f1255399c81c8b /source/blender/blenlib | |
parent | 0c017bf14679b966a136aaec32173b873413fae3 (diff) |
edit the _BLI_array_growone macro so it doesnt give the error that values are calculated but not used.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_array.h | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/source/blender/blenlib/BLI_array.h b/source/blender/blenlib/BLI_array.h index 4747654736c..80b479a7629 100644 --- a/source/blender/blenlib/BLI_array.h +++ b/source/blender/blenlib/BLI_array.h @@ -91,18 +91,24 @@ behaviour, though it may not be the best in practice. /* grow the array by one. zeroes the new elements. */ #define _BLI_array_growone(arr) ( \ (BLI_array_totalsize(arr) > _##arr##_count) ? \ - ++_##arr##_count : \ - ((_##arr##_tmp = MEM_callocN( \ - sizeof(*arr)*(_##arr##_count*2+2), \ - #arr " " __FILE__ ":" STRINGIFY(__LINE__) \ - ) \ - ), \ - (arr && memcpy(_##arr##_tmp, arr, sizeof(*arr) * _##arr##_count)), \ - (arr && ((void *)(arr) != (void*)_##arr##_static ? \ - (MEM_freeN(arr), arr) : \ - arr)), \ - (arr = _##arr##_tmp), \ - _##arr##_count++) \ + ++_##arr##_count : ( \ + (void) (_##arr##_tmp = MEM_callocN( \ + sizeof(*arr)*(_##arr##_count*2+2), \ + #arr " " __FILE__ ":" STRINGIFY(__LINE__) \ + ) \ + ), \ + (void) (arr && memcpy(_##arr##_tmp, \ + arr, \ + sizeof(*arr) * _##arr##_count) \ + ), \ + (void) (arr && ((void *)(arr) != (void*)_##arr##_static ? \ + (MEM_freeN(arr), arr) : \ + arr) \ + ), \ + (void)(arr = _##arr##_tmp \ + ), \ + _##arr##_count++ \ + ) \ ) |