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>2011-11-16 21:09:41 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-16 21:09:41 +0400
commit9087cb91d40824abfb939d15832b159a7b3b6d24 (patch)
treef84f17aee7e84255770887728df4eb4e327a312b /source/blender/blenlib
parentaaf14ead155f1a9014195e11a1d8aca03311b0be (diff)
quiet compiler warnings for BLI_array defines, split BLI_array_append into BLI_array_append / BLI_array_append_r, the latter returning the new array location.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_array.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/blenlib/BLI_array.h b/source/blender/blenlib/BLI_array.h
index 80b479a7629..5bd281545fc 100644
--- a/source/blender/blenlib/BLI_array.h
+++ b/source/blender/blenlib/BLI_array.h
@@ -120,14 +120,19 @@ behaviour, though it may not be the best in practice.
)
-/* appends an item to the array and returns a pointer to the item in the array.
- * item is not a pointer, but actual data value.*/
+/* appends an item to the array. */
#define BLI_array_append(arr, item) ( \
- BLI_array_growone(arr), \
- (arr[_##arr##_count-1] = item), \
- (arr+(_##arr##_count-1)) \
+ (void) BLI_array_growone(arr), \
+ (void) (arr[_##arr##_count-1] = item) \
)
+/* appends an item to the array and returns a pointer to the item in the array.
+ * item is not a pointer, but actual data value.*/
+#define BLI_array_append_r(arr, item) ( \
+ (void) BLI_array_growone(arr), \
+ (void) (arr[_##arr##_count-1] = item), \
+ (&arr[_##arr##_count-1]) \
+)
/* grow an array by a specified number of items. */
/* TODO, this could be done in a less crappy way by not looping - campbell */