Lines Matching refs:arr

53 deBool			dePoolArray_reserve			(dePoolArray* arr, int capacity);
54 deBool dePoolArray_setSize (dePoolArray* arr, int size);
107 DE_INLINE int TYPENAME##_getNumElements (const TYPENAME* arr) DE_UNUSED_FUNCTION; \
108 DE_INLINE deBool TYPENAME##_reserve (TYPENAME* arr, int capacity) DE_UNUSED_FUNCTION; \
109 DE_INLINE deBool TYPENAME##_setSize (TYPENAME* arr, int size) DE_UNUSED_FUNCTION; \
110 DE_INLINE void TYPENAME##_reset (TYPENAME* arr) DE_UNUSED_FUNCTION; \
111 DE_INLINE VALUETYPE TYPENAME##_get (const TYPENAME* arr, int ndx) DE_UNUSED_FUNCTION; \
112 DE_INLINE void TYPENAME##_set (TYPENAME* arr, int ndx, VALUETYPE elem) DE_UNUSED_FUNCTION; \
113 DE_INLINE deBool TYPENAME##_pushBack (TYPENAME* arr, VALUETYPE elem) DE_UNUSED_FUNCTION; \
114 DE_INLINE VALUETYPE TYPENAME##_popBack (TYPENAME* arr) DE_UNUSED_FUNCTION; \
116 DE_INLINE void TYPENAME##_swap (TYPENAME* arr, int aNdx, int bNdx) DE_UNUSED_FUNCTION; \
123 DE_INLINE int TYPENAME##_getNumElements (const TYPENAME* arr) \
125 return arr->numElements; \
128 DE_INLINE deBool TYPENAME##_reserve (TYPENAME* arr, int capacity) \
130 if (capacity > arr->capacity) \
131 return dePoolArray_reserve((dePoolArray*)arr, capacity); \
135 DE_INLINE deBool TYPENAME##_setSize (TYPENAME* arr, int size) \
137 if (size > arr->capacity) \
138 return dePoolArray_setSize((dePoolArray*)arr, size); \
140 arr->numElements = size; \
144 DE_INLINE void TYPENAME##_reset (TYPENAME* arr) \
146 arr->numElements = 0; \
149 DE_INLINE VALUETYPE TYPENAME##_get (const TYPENAME* arr, int ndx) \
151 DE_ASSERT(ndx >= 0 && ndx < arr->numElements); \
155 return ((VALUETYPE*)arr->pageTable[pageNdx])[subNdx]; \
159 DE_INLINE void TYPENAME##_set (TYPENAME* arr, int ndx, VALUETYPE elem) \
161 DE_ASSERT(ndx >= 0 && ndx < arr->numElements); \
165 ((VALUETYPE*)arr->pageTable[pageNdx])[subNdx] = elem; \
169 DE_INLINE deBool TYPENAME##_pushBack (TYPENAME* arr, VALUETYPE elem) \
171 if ((arr->numElements + 1 >= arr->capacity) && !TYPENAME##_reserve(arr, arr->numElements + 1)) \
173 arr->numElements++; \
174 TYPENAME##_set(arr, arr->numElements - 1, elem); \
178 DE_INLINE VALUETYPE TYPENAME##_popBack (TYPENAME* arr) \
180 int ndx = arr->numElements - 1; \
183 DE_ASSERT(arr->numElements > 0); \
184 arr->numElements--; \
186 return ((VALUETYPE*)arr->pageTable[pageNdx])[subNdx]; \
203 DE_INLINE void TYPENAME##_swap (TYPENAME* arr, int aNdx, int bNdx) \
205 VALUETYPE tmp = TYPENAME##_get(arr, aNdx); \
206 TYPENAME##_set(arr, aNdx, TYPENAME##_get(arr, bNdx)); \
207 TYPENAME##_set(arr, bNdx, tmp); \
241 DE_INLINE void TYPENAME##_##SORTNAME##ShiftDown (TYPENAME* arr, int startNdx, int endNdx) \
249 …if ((childNdx + 1 <= endNdx) && (CMPFUNC(TYPENAME##_get(arr, childNdx), TYPENAME##_get(arr, childN…
252 if (CMPFUNC(TYPENAME##_get(arr, rootNdx), TYPENAME##_get(arr, childNdx)) < 0) \
254 TYPENAME##_swap(arr, rootNdx, childNdx); \
262 DE_INLINE void TYPENAME##_##SORTNAME##Heapify (TYPENAME* arr) \
264 int startNdx = (TYPENAME##_getNumElements(arr) - 2) / 2; \
268 TYPENAME##_##SORTNAME##ShiftDown(arr, startNdx, TYPENAME##_getNumElements(arr) - 1); \
273 DE_INLINE void TYPENAME##_##SORTNAME (TYPENAME* arr) \
275 int endNdx = TYPENAME##_getNumElements(arr) - 1; \
277 TYPENAME##_##SORTNAME##Heapify(arr); \
281 TYPENAME##_swap(arr, endNdx, 0); \
283 TYPENAME##_##SORTNAME##ShiftDown(arr, 0, endNdx); \