more array list functions

This commit is contained in:
Greg Wells
2025-07-01 16:14:56 -04:00
parent 48701d9931
commit b2a96ba8e1

View File

@@ -37,6 +37,22 @@ int newCount = count - (list->maxSize - list->count);\
list->data = realloc(list->data, sizeof(type) * (newCount + list->maxSize)); \
list->maxSize += newCount; \
list->count += count; \
} \
inline static void type##ArrayListRemove(type##ArrayList* list) { \
if (list->count == 0) return; \
list->count--; \
} \
inline static void type##ArrayListPopHead(type##ArrayList* list) { \
if (list->count == 0) return; \
list->count--; \
for (int i = 0; i < list->count; i++) { \
list->data[i] = list->data[i + 1];\
} \
}
//metalAvaliableTextureArrayListPopHead
GN_ARRAY_LIST(int);
GN_ARRAY_LIST(uint32_t);