From 6583fe9b389a6b4698f9364945885e6783506886 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 1 Oct 2025 12:43:00 -0400 Subject: Convert to using more zero values for `none` --- src/stdlib/lists.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/stdlib/lists.h') diff --git a/src/stdlib/lists.h b/src/stdlib/lists.h index 1386b2fa..457fed52 100644 --- a/src/stdlib/lists.h +++ b/src/stdlib/lists.h @@ -9,6 +9,10 @@ #include "types.h" #include "util.h" +extern char _EMPTY_LIST_SENTINEL; +#define EMPTY_LIST ((List_t){.data = &_EMPTY_LIST_SENTINEL}) +#define EMPTY_ATOMIC_LIST ((List_t){.data = &_EMPTY_LIST_SENTINEL, .atomic = 1}) + // Convert negative indices to back-indexed without branching: index0 = index + (index < 0)*(len+1)) - 1 #define List_get_checked(list_expr, index_expr, item_type, start, end) \ ({ \ -- cgit v1.2.3