aboutsummaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
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);
}