diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-06 06:52:35 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-06 06:52:35 +0000 |
commit | b9c1c5bb582ff0b76ff431621c569c07fd26acc7 (patch) | |
tree | 4b8b476d6ad097f396548be73565fcab752b339f | |
parent | 6785f77fae5c7f6053d5c36e7fdf7bd6b874d814 (diff) | |
download | ruby-b9c1c5bb582ff0b76ff431621c569c07fd26acc7.tar.gz |
random.c: sipseed_keys_t
* random.c (sipseed): separate type of keys to reduce use of the
magic number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | random.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1455,9 +1455,10 @@ random_s_rand(int argc, VALUE *argv, VALUE obj) #include "siphash.c" static st_index_t hashseed; +typedef uint8_t sipseed_keys_t[16]; static union { - uint8_t key[16]; - uint32_t u32[(16 * sizeof(uint8_t) - 1) / sizeof(uint32_t)]; + sipseed_keys_t key; + uint32_t u32[type_roomof(sipseed_keys_t, uint32_t)]; } sipseed; static void |