more array list functions

This commit is contained in:
Gregory Wells
2025-08-03 15:28:59 -04:00
parent 203928aa81
commit c426f9ab6d

View File

@@ -12,6 +12,7 @@ void type##ArrayListRemove(type##ArrayList list); \
void type##ArrayListPopHead(type##ArrayList list); \
uint32_t type##ArrayListCount(type##ArrayList list); \
type type##ArrayListAt(type##ArrayList list, int i); \
type* type##ArrayListRefAt(type##ArrayList list, int i); \
type* type##ArrayListData(type##ArrayList list)
#define GN_ARRAY_LIST_DEFINITION(type)\
@@ -67,6 +68,9 @@ uint32_t type##ArrayListCount(type##ArrayList list) { \
type type##ArrayListAt(type##ArrayList list, int i) { \
return list->data[i]; \
} \
type* type##ArrayListRefAt(type##ArrayList list, int i) { \
return &list->data[i]; \
} \
type* type##ArrayListData(type##ArrayList list) { \
return &list->data[0]; \
}