diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-13 17:17:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-13 17:17:30 +0400 |
commit | 068c62701375e51445a768ab69b74802338f57c1 (patch) | |
tree | 2aca17f045376bde24057f70e8c12fc37ab74b66 /source/blender/blenlib | |
parent | 73e2b88f6296c83aaff2b47ed9e1d5debbd2e9df (diff) |
remove unused vars
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_array.h | 5 | ||||
-rw-r--r-- | source/blender/blenlib/intern/scanfill.c | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_array.h b/source/blender/blenlib/BLI_array.h index 8d502a97f06..3f5c2cc9d48 100644 --- a/source/blender/blenlib/BLI_array.h +++ b/source/blender/blenlib/BLI_array.h @@ -87,7 +87,7 @@ behaviour, though it may not be the best in practice. /*grow an array by a specified number of items.*/ #define BLI_array_growitems(arr, num) {int _i; for (_i=0; _i<(num); _i++) {BLI_array_growone(arr);}} -#define BLI_array_free(arr) if (arr && (char *)arr != _##arr##_static) MEM_freeN(arr) +#define BLI_array_free(arr) if (arr && (char *)arr != _##arr##_static) { BLI_array_fake_user(arr); MEM_freeN(arr); } #define BLI_array_pop(arr) ((arr&&_##arr##_count) ? arr[--_##arr##_count] : 0) /*resets the logical size of an array to zero, but doesn't @@ -97,3 +97,6 @@ behaviour, though it may not be the best in practice. /*set the count of the array, doesn't actually increase the allocated array size. don't use this unless you know what you're doing.*/ #define BLI_array_set_length(arr, count) _##arr##_count = (count) + +/*only to prevent unused warnings*/ +#define BLI_array_fake_user(arr) (void)_##arr##_count, (void)_##arr##_tmp, (void)_##arr##_static diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index b5e89530e13..908e6918250 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -158,7 +158,7 @@ static void *new_mem_element(int size) printf("incorrect use of new_mem_element\n"); } else if(size== -1) { - /*keep the first block*/ + /*BMESH_TODO: keep the first block, gives memory leak on exit with 'newmem' */ first = lb.first; BLI_remlink(&lb, first); |