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.c | |
| parent | 0cfae753aa131f949253f3fba1e3a36c2bde6ac0 (diff) | |
Convert to using more zero values for `none`
Diffstat (limited to 'src/stdlib/optionals.c')
| -rw-r--r-- | src/stdlib/optionals.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stdlib/optionals.c b/src/stdlib/optionals.c index e9184e4d..41d38a19 100644 --- a/src/stdlib/optionals.c +++ b/src/stdlib/optionals.c @@ -64,8 +64,8 @@ void Optional$deserialize(FILE *in, void *outval, List_t *pointers, const TypeIn _deserialize(in, outval, pointers, nonnull); } else { if (nonnull->tag == TextInfo) *(Text_t *)outval = NONE_TEXT; - else if (nonnull->tag == ListInfo) *(List_t *)outval = (List_t){.length = -1}; - else if (nonnull->tag == TableInfo) *(Table_t *)outval = (Table_t){.entries = {.length = -1}}; + else if (nonnull->tag == ListInfo) *(List_t *)outval = NONE_LIST; + else if (nonnull->tag == TableInfo) *(Table_t *)outval = NONE_TABLE; else if (nonnull == &Num$info) *(double *)outval = (double)NAN; else if (nonnull == &Num32$info) *(float *)outval = (float)NAN; else if (nonnull->tag == StructInfo || (nonnull->tag == OpaqueInfo && type->size > nonnull->size)) |
