aboutsummaryrefslogtreecommitdiff
path: root/src/stdlib/optionals.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-08-17 20:35:09 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-08-17 20:35:09 -0400
commitf4e38fd061a158ecb94881273c6db6e6a332f61d (patch)
tree9179cb312dcc1b24d806dfb65694c25580d1ed8b /src/stdlib/optionals.c
parent602cedd03b0c3d6ef176efafb08f51bde9bfe543 (diff)
Switch from using dollar signs as namespace delimiters to using 々, ヽ, andunicode-identifiers
〇.
Diffstat (limited to 'src/stdlib/optionals.c')
-rw-r--r--src/stdlib/optionals.c18
1 files changed, 9 insertions, 9 deletions
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));