From 6583fe9b389a6b4698f9364945885e6783506886 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 1 Oct 2025 12:43:00 -0400 Subject: Convert to using more zero values for `none` --- src/stdlib/datatypes.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/stdlib/datatypes.h') diff --git a/src/stdlib/datatypes.h b/src/stdlib/datatypes.h index 373cbc47..cbf09519 100644 --- a/src/stdlib/datatypes.h +++ b/src/stdlib/datatypes.h @@ -41,7 +41,7 @@ typedef struct { // structs can be passed in two 64-bit registers. C will handle doing the // bit arithmetic to extract the necessary values, which is cheaper than // spilling onto the stack and needing to retrieve data from the stack. - int64_t length : LIST_LENGTH_BITS; + uint64_t length : LIST_LENGTH_BITS; uint64_t free : LIST_FREE_BITS; bool atomic : LIST_ATOMIC_BITS; uint8_t data_refcount : LIST_REFCOUNT_BITS; @@ -73,11 +73,11 @@ typedef struct { void *fn, *userdata; } Closure_t; -enum text_type { TEXT_ASCII, TEXT_GRAPHEMES, TEXT_CONCAT, TEXT_BLOB }; +enum text_type { TEXT_NONE, TEXT_ASCII, TEXT_GRAPHEMES, TEXT_CONCAT, TEXT_BLOB }; typedef struct Text_s { - int64_t length : 54; // Number of grapheme clusters - uint8_t tag : 2; + uint64_t length : 53; // Number of grapheme clusters + uint8_t tag : 3; uint8_t depth : 8; union { struct { -- cgit v1.2.3