From 0c83d031ff793f364b86bcf557584580edfe66a5 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 22 Jun 2024 13:25:24 +0200 Subject: Rename lots of things to make my life easier --- src/strview.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/strview.c') diff --git a/src/strview.c b/src/strview.c index f9b80e4..70e78f0 100644 --- a/src/strview.c +++ b/src/strview.c @@ -1,13 +1,14 @@ #include +#include "common.h" #include "strview.h" #include "types.h" uint64_t -strview_hash(struct strview sv) +strview_hash(strview_t sv) { uint64_t h = 0x100; - for (size_t i = 0; i < sv.len; i++) { + for (size_t i = 0; likely(i < sv.len); i++) { h ^= sv.p[i]; h *= 1111111111111111111u; } @@ -15,9 +16,8 @@ strview_hash(struct strview sv) } uchar * -svtocstr(uchar *dst, struct strview src) +svtocstr(uchar *dst, strview_t src) { - memcpy(dst, src.p, src.len); - dst[src.len] = 0; + ((uchar *)memcpy(dst, src.p, src.len))[src.len] = 0; return dst; } -- cgit v1.2.3