ruby-changes:59657
From: Nobuyoshi <ko1@a...>
Date: Thu, 9 Jan 2020 19:05:56 +0900 (JST)
Subject: [ruby-changes:59657] 23fbee0311 (master): Renamed `seed` as `hash_salt`
https://git.ruby-lang.org/ruby.git/commit/?id=23fbee0311 From 23fbee0311d34da4f623a828bf0c015a90d8edc9 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 9 Jan 2020 17:26:01 +0900 Subject: Renamed `seed` as `hash_salt` The role of this is a so-called "salt" but not "seed", rename to get rid of confusion with other "seed" of PRNG. diff --git a/random.c b/random.c index 388a3e9..85e7012 100644 --- a/random.c +++ b/random.c @@ -1427,33 +1427,33 @@ random_s_rand(int argc, VALUE *argv, VALUE obj) https://github.com/ruby/ruby/blob/trunk/random.c#L1427 typedef struct { st_index_t hash; uint8_t sip[16]; -} seed_keys_t; +} hash_salt_t; static union { - seed_keys_t key; - uint32_t u32[type_roomof(seed_keys_t, uint32_t)]; -} seed; + hash_salt_t key; + uint32_t u32[type_roomof(hash_salt_t, uint32_t)]; +} hash_salt; static void init_seed(struct MT *mt) { int i; - for (i = 0; i < numberof(seed.u32); ++i) - seed.u32[i] = genrand_int32(mt); + for (i = 0; i < numberof(hash_salt.u32); ++i) + hash_salt.u32[i] = genrand_int32(mt); } NO_SANITIZE("unsigned-integer-overflow", extern st_index_t rb_hash_start(st_index_t h)); st_index_t rb_hash_start(st_index_t h) { - return st_hash_start(seed.key.hash + h); + return st_hash_start(hash_salt.key.hash + h); } st_index_t rb_memhash(const void *ptr, long len) { - sip_uint64_t h = sip_hash13(seed.key.sip, ptr, len); + sip_uint64_t h = sip_hash13(hash_salt.key.sip, ptr, len); #ifdef HAVE_UINT64_T return (st_index_t)h; #else -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/