diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-10-01 13:40:29 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-10-01 13:40:29 -0400 |
| commit | 597699243a6f935231ad83e63d22bf6ff9e4e547 (patch) | |
| tree | edd50fcdad4324680d9e2df7beeaaf93fb162938 /src/stdlib/integers.h | |
| parent | 1b307918c9f0ee6cf3dd074e0b9d9db1ffd35fb8 (diff) | |
For structs and fixed-size ints, use `.has_value` instead of `.is_none`
Diffstat (limited to 'src/stdlib/integers.h')
| -rw-r--r-- | src/stdlib/integers.h | 10 |
1 files changed, 5 insertions, 5 deletions
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__)) |
