From 849fd423a759edf1b58b548a6148c177a6f8cd71 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 16 Aug 2025 15:26:29 -0400 Subject: Fix further issue with optionals --- src/stdlib/optionals.c | 2 -- src/stdlib/optionals.h | 2 +- src/stdlib/types.h | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/stdlib/optionals.c b/src/stdlib/optionals.c index 3c595893..ead9428a 100644 --- a/src/stdlib/optionals.c +++ b/src/stdlib/optionals.c @@ -15,8 +15,6 @@ public PUREFUNC bool is_none(const void *obj, const TypeInfo_t *non_optional_typ return non_optional_type->metamethods.is_none(obj, non_optional_type); const void *dest = (obj + non_optional_type->size); - if (non_optional_type->align > 0 && (int64_t)dest % non_optional_type->align) - dest += (non_optional_type->align - ((int64_t)dest % non_optional_type->align)); return *(bool*)dest; } diff --git a/src/stdlib/optionals.h b/src/stdlib/optionals.h index 2ffd5a50..5be52e93 100644 --- a/src/stdlib/optionals.h +++ b/src/stdlib/optionals.h @@ -18,7 +18,7 @@ #define NONE_TEXT ((OptionalText_t){.length=-1}) #define NONE_PATH ((Path_t){.type=PATH_NONE}) -PUREFUNC bool is_null(const void *obj, const TypeInfo_t *non_optional_type); +PUREFUNC bool is_none(const void *obj, const TypeInfo_t *non_optional_type); PUREFUNC uint64_t Optional$hash(const void *obj, const TypeInfo_t *type); PUREFUNC int32_t Optional$compare(const void *x, const void *y, const TypeInfo_t *type); PUREFUNC bool Optional$equal(const void *x, const void *y, const TypeInfo_t *type); diff --git a/src/stdlib/types.h b/src/stdlib/types.h index 03b397b7..60f1fcfd 100644 --- a/src/stdlib/types.h +++ b/src/stdlib/types.h @@ -94,7 +94,7 @@ Text_t Type$as_text(const void *typeinfo, bool colorize, const TypeInfo_t *type) t value; \ struct { \ char _padding[unpadded_size]; \ - Bool_t is_none:1; \ + Bool_t is_none; \ }; \ }; \ } name -- cgit v1.2.3