diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-11 12:39:56 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-11 12:39:56 -0400 |
| commit | 30d39378c721aa6506c5aa038f6da9bf98cb1527 (patch) | |
| tree | 5051263c667915bfd9178bbfdf691afb54088e3f /builtins/functions.c | |
| parent | 210179ee672a0c3799328a54e886f574b3823e3d (diff) | |
Optional C Strings
Diffstat (limited to 'builtins/functions.c')
| -rw-r--r-- | builtins/functions.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtins/functions.c b/builtins/functions.c index ed0889d4..e506fe1c 100644 --- a/builtins/functions.c +++ b/builtins/functions.c @@ -118,7 +118,7 @@ PUREFUNC public uint64_t generic_hash(const void *obj, const TypeInfo *type) errx(1, "Optional hash not implemented"); } case EmptyStructInfo: return 0; - case CustomInfo: case StructInfo: case EnumInfo: // These all share the same info + case CustomInfo: case StructInfo: case EnumInfo: case CStringInfo: // These all share the same info if (!type->CustomInfo.hash) goto hash_data; return type->CustomInfo.hash(obj, type); @@ -143,7 +143,7 @@ PUREFUNC public int32_t generic_compare(const void *x, const void *y, const Type errx(1, "Optional compare not implemented"); } case EmptyStructInfo: return 0; - case CustomInfo: case StructInfo: case EnumInfo: // These all share the same info + case CustomInfo: case StructInfo: case EnumInfo: case CStringInfo: // These all share the same info if (!type->CustomInfo.compare) goto compare_data; return type->CustomInfo.compare(x, y, type); @@ -167,7 +167,7 @@ PUREFUNC public bool generic_equal(const void *x, const void *y, const TypeInfo case OptionalInfo: { errx(1, "Optional equal not implemented"); } - case CustomInfo: case StructInfo: case EnumInfo: // These all share the same info + case CustomInfo: case StructInfo: case EnumInfo: case CStringInfo: // These all share the same info if (!type->CustomInfo.equal) goto use_generic_compare; return type->CustomInfo.equal(x, y, type); @@ -191,7 +191,7 @@ public Text_t generic_as_text(const void *obj, bool colorize, const TypeInfo *ty case EmptyStructInfo: return colorize ? Text$concat(Text("\x1b[0;1m"), Text$from_str(type->EmptyStructInfo.name), Text("\x1b[m()")) : Text$concat(Text$from_str(type->EmptyStructInfo.name), Text("()")); - case CustomInfo: case StructInfo: case EnumInfo: // These all share the same info + case CustomInfo: case StructInfo: case EnumInfo: case CStringInfo: // These all share the same info if (!type->CustomInfo.as_text) fail("No text function provided for type!\n"); return type->CustomInfo.as_text(obj, colorize, type); |
