From e1ae187681633ec8d4dfc515d99497384ac531f7 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 6 Jul 2018 06:18:50 -0700 Subject: hash: C++ maintenance. * hash.c (hash_buf): Make size parameter unsigned. This eliminates a signed/unsigned comparison error from the GNU C++ compiler. (equal_hash): Use c_unum to get the buffer length. Should that be negative, c_unum will throw. --- hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hash.c b/hash.c index e8b9a593..2a0769fa 100644 --- a/hash.c +++ b/hash.c @@ -137,7 +137,7 @@ static u32_t hash_c_str(const wchar_t *str, u32_t seed) return acc; } -static u32_t hash_buf(const mem_t *ptr, cnum size, u32_t seed) +static u32_t hash_buf(const mem_t *ptr, ucnum size, u32_t seed) { const u32_t *buf = coerce(const u32_t *, ptr); int count = hash_str_limit; @@ -268,7 +268,7 @@ cnum equal_hash(val obj, int *count, ucnum seed) + 32 * (equal_hash(obj->rn.to, count, seed) & (NUM_MAX / 16))) & NUM_MAX; case BUF: - return hash_buf(obj->b.data, c_num(obj->b.len), seed); + return hash_buf(obj->b.data, c_unum(obj->b.len), seed); } internal_error("unhandled case in equal function"); -- cgit v1.2.3