From 25a367862dbdfb0fdfdfc6f619af3f0a7e0fe79f Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Mon, 30 Jun 2025 15:29:44 -0700 Subject: Use nullptr --- list/include/list.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'list/include/list.h') 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) { /// Create a new empty list. #define make_list(type) \ - (type##_list) { 0 } + (type##_list) { nullptr } /// Delete the list. #define del_list(list) \ @@ -32,7 +32,7 @@ static inline void* alloc(size_t size) { node = node->next; \ free(cur); \ } \ - list.head = 0; + list.head = nullptr; /// Prepend a value to the list. #define list_add(list, value) \ @@ -76,10 +76,10 @@ static inline void* alloc(size_t size) { node->next->prev = node->prev; \ } \ if (list.head == node) { \ - list.head = 0; \ + list.head = nullptr; \ } \ free(node); \ - node = 0; \ + node = nullptr; \ } /// Iterate over all the items in the list. -- cgit v1.2.3