#if defined(__GNUC__) && (__GNUC__ > 2)
#define DP_FUNC_PRINTF(n) __attribute__ ((format (printf, n, n+1)))
+#define DP_FUNC_PURE __attribute__ ((pure))
#else
#define DP_FUNC_PRINTF(n)
+#define DP_FUNC_PURE
#endif
#include <sys/types.h>
}
}
-size_t Mem_ExpandableArray_IndexRange(memexpandablearray_t *l)
+size_t Mem_ExpandableArray_IndexRange(const memexpandablearray_t *l)
{
size_t i, j, k, end = 0;
for (i = 0;i < l->numarrays;i++)
return end;
}
-void *Mem_ExpandableArray_RecordAtIndex(memexpandablearray_t *l, size_t index)
+void *Mem_ExpandableArray_RecordAtIndex(const memexpandablearray_t *l, size_t index)
{
size_t i, j;
i = index / l->numrecordsperarray;
void Mem_ExpandableArray_FreeArray(memexpandablearray_t *l);
void *Mem_ExpandableArray_AllocRecord(memexpandablearray_t *l);
void Mem_ExpandableArray_FreeRecord(memexpandablearray_t *l, void *record);
-size_t Mem_ExpandableArray_IndexRange(memexpandablearray_t *l);
-void *Mem_ExpandableArray_RecordAtIndex(memexpandablearray_t *l, size_t index);
+size_t Mem_ExpandableArray_IndexRange(const memexpandablearray_t *l) DP_FUNC_PURE;
+void *Mem_ExpandableArray_RecordAtIndex(const memexpandablearray_t *l, size_t index) DP_FUNC_PURE;
// used for temporary allocations
extern mempool_t *tempmempool;