From d43f7f36d691362ec4b12b26f1ab252d7be280cf Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 6 Oct 2022 21:38:05 -0700 Subject: hash: bugfix: don't trim seed to 32 bits. This relates to the November 2021 commit 9108e9f8f4434fb29200b08a4b576df47c407c01: hash: 64 bit string and buffer hashing and seeds. In the hash constructor, a 32 bit cast was left behind, needlessly reducing the seed value to 32 bits on 64 bit platforms. * hash.c (do_make_hash): Don't convert the ucnum value to u32_t; just store it. --- hash.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hash.c b/hash.c index 1a55e0c8..2f99a5ce 100644 --- a/hash.c +++ b/hash.c @@ -923,9 +923,8 @@ static val do_make_hash(hash_weak_opt_t wkopt, hash_type_t type, val seed) val table = vector(mod, nil); val hash = cobj(coerce(mem_t *, h), hash_cls, &hash_ops); - h->seed = convert(u32_t, c_unum(default_arg(seed, - if3(hash_seed_s, - hash_seed, zero)), self)); + h->seed = c_unum(default_arg(seed, if3(hash_seed_s, hash_seed, zero)), + self); h->wkopt = wkopt; h->modulus = c_unum(mod, self); h->count = 0; -- cgit v1.2.3