From 597699243a6f935231ad83e63d22bf6ff9e4e547 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 1 Oct 2025 13:40:29 -0400 Subject: For structs and fixed-size ints, use `.has_value` instead of `.is_none` --- src/stdlib/integers.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/stdlib/integers.h') diff --git a/src/stdlib/integers.h b/src/stdlib/integers.h index 34195d23..7eafd134 100644 --- a/src/stdlib/integers.h +++ b/src/stdlib/integers.h @@ -19,7 +19,7 @@ #define DEFINE_INT_TYPE(c_type, type_name) \ typedef struct { \ c_type value; \ - bool is_none : 1; \ + bool has_value : 1; \ } Optional##type_name##_t; \ Text_t type_name##$as_text(const void *i, bool colorize, const TypeInfo_t *type); \ Text_t type_name##$value_as_text(c_type i); \ @@ -69,10 +69,10 @@ DEFINE_INT_TYPE(int16_t, Int16) DEFINE_INT_TYPE(int8_t, Int8) #undef DEFINE_INT_TYPE -#define NONE_INT64 ((OptionalInt64_t){.is_none = true}) -#define NONE_INT32 ((OptionalInt32_t){.is_none = true}) -#define NONE_INT16 ((OptionalInt16_t){.is_none = true}) -#define NONE_INT8 ((OptionalInt8_t){.is_none = true}) +#define NONE_INT64 ((OptionalInt64_t){.has_value = false}) +#define NONE_INT32 ((OptionalInt32_t){.has_value = false}) +#define NONE_INT16 ((OptionalInt16_t){.has_value = false}) +#define NONE_INT8 ((OptionalInt8_t){.has_value = false}) #define Int64$abs(...) I64(labs(__VA_ARGS__)) #define Int32$abs(...) I32(abs(__VA_ARGS__)) -- cgit v1.2.3