fix for error in r35590, ARRAY_LAST_ITEM was returning one item over the end of the array.

This commit is contained in:
Campbell Barton
2011-03-18 02:09:59 +00:00
parent 25d4515181
commit faafd4634a

View File

@@ -131,7 +131,7 @@
#define IN_RANGE_INCL(a, b, c) ((b < c)? ((b<=a && a<=c)? 1:0) : ((c<=a && a<=b)? 1:0))
/* array helpers */
#define ARRAY_LAST_ITEM(arr_start, arr_dtype, elem_size, tot) (arr_dtype *)((char*)arr_start + (elem_size*tot))
#define ARRAY_LAST_ITEM(arr_start, arr_dtype, elem_size, tot) (arr_dtype *)((char*)arr_start + (elem_size*(tot - 1)))
#define ARRAY_HAS_ITEM(item, arr_start, arr_dtype, elem_size, tot) ((item >= arr_start) && (item <= ARRAY_LAST_ITEM(arr_start, arr_dtype, elem_size, tot)))
/* This one rotates the bytes in an int64, int (32) and short (16) */