Allow current item pointer to have custom type.feature/data-structs
@@ -22,7 +22,7 @@ void IZ_ListTeardown(IZ_List*); | |||||
IZ_ListNode* IZ_ListAppendNode(IZ_List*, void*); | IZ_ListNode* IZ_ListAppendNode(IZ_List*, void*); | ||||
#define IZ_LIST_FILTER_FUNCTION(X) static IZ_PoolItem* X = NULL; | |||||
#define IZ_ListFilterFunctionArgs(X) static X = NULL; | |||||
void _IZ_ListDeleteFirstNode(IZ_List*, IZ_ListFindFilter); | void _IZ_ListDeleteFirstNode(IZ_List*, IZ_ListFindFilter); | ||||
@@ -3,15 +3,15 @@ | |||||
#include "../../../__mocks__/SDL_stdinc.mock.h" | #include "../../../__mocks__/SDL_stdinc.mock.h" | ||||
#include "IZ_list.h" | #include "IZ_list.h" | ||||
bool NodeExists(IZ_ListNode* node, u64 _index) { | |||||
IZ_ListFilterFunctionArgs(IZ_ListNode* __current_item_NodeExists) bool NodeExists(IZ_ListNode* node, u64 _index) { | |||||
return *((u64*) node->value) == 42069; | return *((u64*) node->value) == 42069; | ||||
} | } | ||||
bool NodeExists2(IZ_ListNode* node, u64 _index) { | |||||
IZ_ListFilterFunctionArgs(IZ_ListNode* __current_item_NodeExists2) bool NodeExists2(IZ_ListNode* node, u64 _index) { | |||||
return *((u64*) node->value) == 69420; | return *((u64*) node->value) == 69420; | ||||
} | } | ||||
bool NodeDoesNotExist(IZ_ListNode* node, u64 _index) { | |||||
IZ_ListFilterFunctionArgs(IZ_ListNode* __current_item_NodeDoesNotExist) bool NodeDoesNotExist(IZ_ListNode* node, u64 _index) { | |||||
return *((u64*) node->value) == 55555; | return *((u64*) node->value) == 55555; | ||||
} | } | ||||
@@ -37,7 +37,7 @@ IZ_PoolItem* IZ_PoolAllocate(IZ_Pool* pool, IZ_PoolAllocationArgs args) { | |||||
return new_item->value; | return new_item->value; | ||||
} | } | ||||
IZ_LIST_FILTER_FUNCTION(__current_item) bool IZ_PoolGetSameItem(IZ_ListNode* node, u64 _index) { | |||||
IZ_ListFilterFunctionArgs(IZ_PoolItem* __current_item) bool IZ_PoolGetSameItem(IZ_ListNode* node, u64 _index) { | |||||
return node->value == __current_item; | return node->value == __current_item; | ||||
} | } | ||||