diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2025-07-21 16:53:37 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2025-07-21 16:53:37 +0200 |
| commit | 85b0db24804e6a8a66f557ac8917596db5fc5d9f (patch) | |
| tree | 22cdfbf325fe7ecadc744a668f28c46b03e0f008 /string.c | |
| parent | 2d225abf3b482fa2bf8cf9a56b8caefcc5724447 (diff) | |
refactor: Better types
Diffstat (limited to 'string.c')
| -rw-r--r-- | string.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -13,17 +13,17 @@ int Str_equals(Str a, Str b) { uint64_t Str_hash64(Str s) { uint64_t h = 0x100; - for (ptrdiff_t i = 0; i < s.len; i++) { + for (size i = 0; i < s.len; i++) { h ^= s.data[i] & 255; h *= 1111111111111111111; } return h; } -Str* Str_copy(Arena *a, char *data, uintptr_t len) { +Str* Str_copy(Arena *a, byte *data, size len) { Str *str = new(a, Str, 1); str->len = len; - str->data = new (a, char, len); + str->data = new (a, byte, len); if (str->len) memcpy(str->data, data, len); return str; |
