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/optionals.h | |
| parent | 0cfae753aa131f949253f3fba1e3a36c2bde6ac0 (diff) | |
Convert to using more zero values for `none`
Diffstat (limited to 'src/stdlib/optionals.h')
| -rw-r--r-- | src/stdlib/optionals.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stdlib/optionals.h b/src/stdlib/optionals.h index 145fda60..9c875bd1 100644 --- a/src/stdlib/optionals.h +++ b/src/stdlib/optionals.h @@ -9,12 +9,12 @@ #include "types.h" #include "util.h" -#define NONE_LIST ((List_t){.length = -1}) +#define NONE_LIST ((List_t){.data = NULL}) #define NONE_BOOL ((OptionalBool_t)2) #define NONE_INT ((OptionalInt_t){.small = 0}) -#define NONE_TABLE ((OptionalTable_t){.entries.length = -1}) +#define NONE_TABLE ((OptionalTable_t){.entries.data = NULL}) #define NONE_CLOSURE ((OptionalClosure_t){.fn = NULL}) -#define NONE_TEXT ((OptionalText_t){.length = -1}) +#define NONE_TEXT ((OptionalText_t){.tag = TEXT_NONE}) #define NONE_PATH ((Path_t){.type = PATH_NONE}) PUREFUNC bool is_none(const void *obj, const TypeInfo_t *non_optional_type); |
