aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/datatypes.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-07 00:46:26 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-07 00:46:26 -0400
commitef23faa3e6e003282e53fc08031ec4eb9a2e2aae (patch)
tree763944687f506e5dded02956ab3b45c456e16146 /src/stdlib/datatypes.h
parent3554c56b209a1544c69e189ddab3b19b4bf80ae6 (diff)
Add Byte.to() method and improved micro optimization of iterating over
fixed-width integer ranges
Diffstat (limited to 'src/stdlib/datatypes.h')
-rw-r--r--src/stdlib/datatypes.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/stdlib/datatypes.h b/src/stdlib/datatypes.h
index 950c9457..77c09ddb 100644
--- a/src/stdlib/datatypes.h
+++ b/src/stdlib/datatypes.h
@@ -111,4 +111,12 @@ typedef struct {
#define OptionalText_t Text_t
#define OptionalClosure_t Closure_t
+typedef struct {
+ Byte_t value;
+ bool is_none:1;
+} OptionalByte_t;
+
+#define NONE_BYTE ((OptionalByte_t){.is_none=true})
+
+
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0