aboutsummaryrefslogtreecommitdiff
path: root/list/include
diff options
context:
space:
mode:
Diffstat (limited to 'list/include')
-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.