[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [41919] branches/bmesh/blender/source/ blender/blenlib/BLI_array.h: edit the _BLI_array_growone macro so it doesnt give the error that values are calculated but not used .
Campbell Barton
ideasman42 at gmail.com
Wed Nov 16 16:49:49 CET 2011
Revision: 41919
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=41919
Author: campbellbarton
Date: 2011-11-16 15:49:48 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------
edit the _BLI_array_growone macro so it doesnt give the error that values are calculated but not used.
Modified Paths:
--------------
branches/bmesh/blender/source/blender/blenlib/BLI_array.h
Modified: branches/bmesh/blender/source/blender/blenlib/BLI_array.h
===================================================================
--- branches/bmesh/blender/source/blender/blenlib/BLI_array.h 2011-11-16 15:47:25 UTC (rev 41918)
+++ branches/bmesh/blender/source/blender/blenlib/BLI_array.h 2011-11-16 15:49:48 UTC (rev 41919)
@@ -91,18 +91,24 @@
/* 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++ \
+ ) \
)
More information about the Bf-blender-cvs
mailing list