aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-21 13:00:53 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-21 13:00:53 -0500
commitf868d02b08688c04509d1abda5af89a182033d88 (patch)
treeaf64c48127e0edfebb348edabbccbcc402d2070b /stdlib
parent90573ba7a15bb47a11c1eb6f69ed04c01b69724d (diff)
Add `NULL` as a syntax for null values.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/optionals.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/stdlib/optionals.c b/stdlib/optionals.c
index 34f14f4b..b6a5989e 100644
--- a/stdlib/optionals.c
+++ b/stdlib/optionals.c
@@ -64,18 +64,14 @@ public PUREFUNC bool is_null(const void *obj, const TypeInfo_t *non_optional_typ
}
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wstack-protector"
public Text_t Optional$as_text(const void *obj, bool colorize, const TypeInfo_t *type)
{
if (!obj)
return Text$concat(generic_as_text(obj, colorize, type->OptionalInfo.type), Text("?"));
if (is_null(obj, type->OptionalInfo.type))
- return Text$concat(colorize ? Text("\x1b[31m!") : Text("!"), generic_as_text(NULL, false, type->OptionalInfo.type),
- colorize ? Text("\x1b[m") : Text(""));
- return Text$concat(generic_as_text(obj, colorize, type->OptionalInfo.type), colorize ? Text("\x1b[33m?\x1b[m") : Text("?"));
+ return colorize ? Text("\x1b[31mNULL\x1b[m") : Text("NULL");
+ return generic_as_text(obj, colorize, type->OptionalInfo.type);
}
-#pragma GCC diagnostic pop
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1