aboutsummaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2025-07-22 08:59:24 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2025-07-22 08:59:24 +0200
commit13fdee74dc28f0b068503843c6e14071a7c339f2 (patch)
tree323f35e351394c89faeaf61cccad716ba4e4fb1a /string.c
parente02bfc1854effe0bb55ea6d4320e2b1902eaeae3 (diff)
feat: More integer types
Diffstat (limited to 'string.c')
-rw-r--r--string.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/string.c b/string.c
index d788f58..2c4e749 100644
--- a/string.c
+++ b/string.c
@@ -7,12 +7,12 @@
#include "memory.h"
// Returns 1 if strings are equal, 0 otherwise
-int Str_equals(Str a, Str b) {
+i32 Str_equals(Str a, Str b) {
return (a.len == b.len) && (!a.len || !memcmp(a.data, b.data, a.len));
}
-uint64_t Str_hash64(Str s) {
- uint64_t h = 0x100;
+u64 Str_hash64(Str s) {
+ u64 h = 0x100;
for (size i = 0; i < s.len; i++) {
h ^= s.data[i] & 255;
h *= 1111111111111111111;
@@ -29,6 +29,6 @@ Str *Str_copy(Arena *a, byte *data, size len) {
return str;
}
-int Str_fprint(FILE *w, Str s) {
- return fprintf(w, "%.*s", (int)s.len, s.data);
+i32 Str_fprint(FILE *w, Str s) {
+ return fprintf(w, "%.*s", (i32)s.len, s.data);
}