diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-10-01 12:43:00 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-10-01 12:43:00 -0400 |
| commit | 6583fe9b389a6b4698f9364945885e6783506886 (patch) | |
| tree | 0464456d177eab051b03f29a74218a45b301f174 /src/stdlib/lists.h | |
| parent | 0cfae753aa131f949253f3fba1e3a36c2bde6ac0 (diff) | |
Convert to using more zero values for `none`
Diffstat (limited to 'src/stdlib/lists.h')
| -rw-r--r-- | src/stdlib/lists.h | 4 |
1 files changed, 4 insertions, 0 deletions
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) \ ({ \ |
