From 3b5bf3b6ab23c6a5157919490cc07787614f95b8 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Mon, 24 Mar 2025 17:59:33 -0500 Subject: Add a warning to ll.h about how dlinkedlist functions are X_ALLOC functions --- src/ll.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ll.c') diff --git a/src/ll.c b/src/ll.c index 4e018f2..1fa8773 100644 --- a/src/ll.c +++ b/src/ll.c @@ -4,6 +4,7 @@ #include #include #include +#include typedef struct dll { void *data; @@ -118,7 +119,8 @@ int dlinkedlist_xxxend(dlinkedlist * const ll, void *data, dll_freecb fcb, char break; default: - abort(); + XALLOC_EXIT(" got an invalid op token when it shouldn't be possible to recieve one"); + // Technically not an alloc, but also there's no reason I can't reuse a perfectly good macro } ll->size++; @@ -172,7 +174,7 @@ int dlinkedlist_insert(dlinkedlist * const ll, void *data, dll_freecb fcb, int i dllnode *new = dllnode_init(data, fcb); dllnode *current = dlinkedlist_getnode(ll, index); if(!current) - abort(); + XALLOC_EXIT(" somehow managed to pull a null node from dlinkedlist_getnode(... , ... , ... , %d)", , (index)); current->prev->next = new; new->prev = current->prev; -- cgit v1.2.3