From f4e38fd061a158ecb94881273c6db6e6a332f61d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 17 Aug 2025 20:35:09 -0400 Subject: =?UTF-8?q?Switch=20from=20using=20dollar=20signs=20as=20namespace?= =?UTF-8?q?=20delimiters=20to=20using=20=E3=80=85,=20=E3=83=BD,=20and=20?= =?UTF-8?q?=E3=80=87.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stdlib/optionals.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/stdlib/optionals.c') diff --git a/src/stdlib/optionals.c b/src/stdlib/optionals.c index ead9428a..9aaf5400 100644 --- a/src/stdlib/optionals.c +++ b/src/stdlib/optionals.c @@ -18,12 +18,12 @@ public PUREFUNC bool is_none(const void *obj, const TypeInfo_t *non_optional_typ return *(bool*)dest; } -PUREFUNC public uint64_t Optional$hash(const void *obj, const TypeInfo_t *type) +PUREFUNC public uint64_t Optionalヽhash(const void *obj, const TypeInfo_t *type) { return is_none(obj, type->OptionalInfo.type) ? 0 : generic_hash(obj, type->OptionalInfo.type); } -PUREFUNC public int32_t Optional$compare(const void *x, const void *y, const TypeInfo_t *type) +PUREFUNC public int32_t Optionalヽcompare(const void *x, const void *y, const TypeInfo_t *type) { if (x == y) return 0; bool x_is_null = is_none(x, type->OptionalInfo.type); @@ -33,7 +33,7 @@ PUREFUNC public int32_t Optional$compare(const void *x, const void *y, const Typ else return generic_compare(x, y, type->OptionalInfo.type); } -PUREFUNC public bool Optional$equal(const void *x, const void *y, const TypeInfo_t *type) +PUREFUNC public bool Optionalヽequal(const void *x, const void *y, const TypeInfo_t *type) { if (x == y) return true; @@ -44,17 +44,17 @@ PUREFUNC public bool Optional$equal(const void *x, const void *y, const TypeInfo else return generic_equal(x, y, type->OptionalInfo.type); } -public Text_t Optional$as_text(const void *obj, bool colorize, const TypeInfo_t *type) +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("?")); + return Textヽconcat(generic_as_text(obj, colorize, type->OptionalInfo.type), Text("?")); if (is_none(obj, type->OptionalInfo.type)) return colorize ? Text("\x1b[31mnone\x1b[m") : Text("none"); return generic_as_text(obj, colorize, type->OptionalInfo.type); } -public void Optional$serialize(const void *obj, FILE *out, Table_t *pointers, const TypeInfo_t *type) +public void Optionalヽserialize(const void *obj, FILE *out, Table_t *pointers, const TypeInfo_t *type) { bool has_value = !is_none(obj, type->OptionalInfo.type); assert(fputc((int)has_value, out) != EOF); @@ -62,7 +62,7 @@ public void Optional$serialize(const void *obj, FILE *out, Table_t *pointers, co _serialize(obj, out, pointers, type->OptionalInfo.type); } -public void Optional$deserialize(FILE *in, void *outval, List_t *pointers, const TypeInfo_t *type) +public void Optionalヽdeserialize(FILE *in, void *outval, List_t *pointers, const TypeInfo_t *type) { bool has_value = (bool)fgetc(in); const TypeInfo_t *nonnull = type->OptionalInfo.type; @@ -76,9 +76,9 @@ public void Optional$deserialize(FILE *in, void *outval, List_t *pointers, const *(List_t*)outval = (List_t){.length=-1}; else if (nonnull->tag == TableInfo) *(Table_t*)outval = (Table_t){.entries={.length=-1}}; - else if (nonnull == &Num$info) + else if (nonnull == &Numヽinfo) *(double*)outval = (double)NAN; - else if (nonnull == &Num32$info) + else if (nonnull == &Num32ヽinfo) *(float*)outval = (float)NAN; else if (nonnull->tag == StructInfo || (nonnull->tag == OpaqueInfo && type->size > nonnull->size)) memset(outval + type->size, -1, (size_t)(type->size - nonnull->size)); -- cgit v1.2.3