diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-15 19:59:14 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-15 19:59:14 -0400 |
| commit | e5420471a7364a92521575e7abd3a29a9318001b (patch) | |
| tree | 6b7aaccff3d033fdc49cee41874071637fa8b68e /src/stdlib/c_strings.c | |
| parent | c3615dc92c667899af7a11b2b25201dad5502ee6 (diff) | |
Make some compatibility fixes to make sure the compiler can fully build
using TinyCC
Diffstat (limited to 'src/stdlib/c_strings.c')
| -rw-r--r-- | src/stdlib/c_strings.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/stdlib/c_strings.c b/src/stdlib/c_strings.c index dc777a7c..e74ccb68 100644 --- a/src/stdlib/c_strings.c +++ b/src/stdlib/c_strings.c @@ -24,8 +24,9 @@ public Text_t CString$as_text_simple(const char *str) return Text$format("%s", str); } -PUREFUNC public int32_t CString$compare(const void *x, const void *y, const TypeInfo_t*) +PUREFUNC public int32_t CString$compare(const void *x, const void *y, const TypeInfo_t *info) { + (void)info; if (x == y) return 0; @@ -40,27 +41,31 @@ PUREFUNC public bool CString$equal(const void *x, const void *y, const TypeInfo_ return CString$compare(x, y, type) == 0; } -PUREFUNC public uint64_t CString$hash(const void *c_str, const TypeInfo_t*) +PUREFUNC public uint64_t CString$hash(const void *c_str, const TypeInfo_t *info) { + (void)info; if (!*(const char**)c_str) return 0; return siphash24(*(void**)c_str, strlen(*(const char**)c_str)); } -PUREFUNC public bool CString$is_none(const void *c_str, const TypeInfo_t*) +PUREFUNC public bool CString$is_none(const void *c_str, const TypeInfo_t *info) { + (void)info; return *(const char**)c_str == NULL; } -static void CString$serialize(const void *obj, FILE *out, Table_t *pointers, const TypeInfo_t*) +static void CString$serialize(const void *obj, FILE *out, Table_t *pointers, const TypeInfo_t *info) { + (void)info; const char *str = *(const char **)obj; int64_t len = (int64_t)strlen(str); Int64$serialize(&len, out, pointers, &Int64$info); fwrite(str, sizeof(char), (size_t)len, out); } -static void CString$deserialize(FILE *in, void *out, List_t *pointers, const TypeInfo_t *) +static void CString$deserialize(FILE *in, void *out, List_t *pointers, const TypeInfo_t *info) { + (void)info; int64_t len = -1; Int64$deserialize(in, &len, pointers, &Int64$info); char *str = GC_MALLOC_ATOMIC((size_t)len+1); |
