From dc9f9c1958d72c5770e0dcc5a4d6df47dad71c22 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Fri, 3 Oct 2025 20:03:04 -0500 Subject: [PATCH] feat(list): add link type defines --- storm/list/TSList.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/storm/list/TSList.hpp b/storm/list/TSList.hpp index bcc98f7..94aaf0a 100644 --- a/storm/list/TSList.hpp +++ b/storm/list/TSList.hpp @@ -8,6 +8,11 @@ #include #include +#define STORM_LIST_LINK_AFTER 1 +#define STORM_LIST_LINK_BEFORE 2 +#define STORM_LIST_HEAD STORM_LIST_LINK_AFTER +#define STORM_LIST_TAIL STORM_LIST_LINK_BEFORE + #define STORM_LIST(T) TSList> template @@ -124,7 +129,7 @@ void TSList::LinkNode(T* ptr, uint32_t linktype, T* existingptr) { TSLink* v8; switch (linktype) { - case 1: + case STORM_LIST_LINK_AFTER: // After existingptr v5->m_prevlink = v7; v5->m_next = v7->m_next; @@ -133,7 +138,7 @@ void TSList::LinkNode(T* ptr, uint32_t linktype, T* existingptr) { break; - case 2: + case STORM_LIST_LINK_BEFORE: // Before existingptr v8 = v7->m_prevlink; v5->m_prevlink = v7->m_prevlink; @@ -151,12 +156,12 @@ void TSList::LinkNode(T* ptr, uint32_t linktype, T* existingptr) { template void TSList::LinkToHead(T* ptr) { - this->LinkNode(ptr, 1, nullptr); + this->LinkNode(ptr, STORM_LIST_HEAD, nullptr); } template void TSList::LinkToTail(T* ptr) { - this->LinkNode(ptr, 2, nullptr); + this->LinkNode(ptr, STORM_LIST_TAIL, nullptr); } template