aboutsummaryrefslogtreecommitdiff
path: root/list/include/list.h
diff options
context:
space:
mode:
author3gg <3gg@shellblade.net>2025-06-30 15:29:44 -0700
committer3gg <3gg@shellblade.net>2025-06-30 15:29:44 -0700
commit25a367862dbdfb0fdfdfc6f619af3f0a7e0fe79f (patch)
tree60269cf9a704c059495f52c3ad5a23794b2698c3 /list/include/list.h
parent9b3ba8c80360c09dd32ee9645c536161b5dd0cff (diff)
Use nullptr
Diffstat (limited to 'list/include/list.h')
-rw-r--r--list/include/list.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/list/include/list.h b/list/include/list.h
index 24291e1..aadcb88 100644
--- a/list/include/list.h
+++ b/list/include/list.h
@@ -23,7 +23,7 @@ static inline void* alloc(size_t size) {
23 23
24/// Create a new empty list. 24/// Create a new empty list.
25#define make_list(type) \ 25#define make_list(type) \
26 (type##_list) { 0 } 26 (type##_list) { nullptr }
27 27
28/// Delete the list. 28/// Delete the list.
29#define del_list(list) \ 29#define del_list(list) \
@@ -32,7 +32,7 @@ static inline void* alloc(size_t size) {
32 node = node->next; \ 32 node = node->next; \
33 free(cur); \ 33 free(cur); \
34 } \ 34 } \
35 list.head = 0; 35 list.head = nullptr;
36 36
37/// Prepend a value to the list. 37/// Prepend a value to the list.
38#define list_add(list, value) \ 38#define list_add(list, value) \
@@ -76,10 +76,10 @@ static inline void* alloc(size_t size) {
76 node->next->prev = node->prev; \ 76 node->next->prev = node->prev; \
77 } \ 77 } \
78 if (list.head == node) { \ 78 if (list.head == node) { \
79 list.head = 0; \ 79 list.head = nullptr; \
80 } \ 80 } \
81 free(node); \ 81 free(node); \
82 node = 0; \ 82 node = nullptr; \
83 } 83 }
84 84
85/// Iterate over all the items in the list. 85/// Iterate over all the items in the list.