* random.c (init_randomseed): remove "initial" argument. It never
be used from outside of this function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7104a473ea
commit
12e059b18c
@ -1,3 +1,8 @@
|
|||||||
|
Thu Oct 22 00:19:07 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* random.c (init_randomseed): remove "initial" argument. It never
|
||||||
|
be used from outside of this function.
|
||||||
|
|
||||||
Thu Oct 22 00:12:33 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
Thu Oct 22 00:12:33 2015 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
* lib/securerandom.rb (SecureRandom::gen_random): use /dev/urandom
|
* lib/securerandom.rb (SecureRandom::gen_random): use /dev/urandom
|
||||||
|
7
random.c
7
random.c
@ -1453,9 +1453,11 @@ static union {
|
|||||||
} sipseed;
|
} sipseed;
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
init_randomseed(struct MT *mt, uint32_t initial[DEFAULT_SEED_CNT])
|
init_randomseed(struct MT *mt)
|
||||||
{
|
{
|
||||||
|
uint32_t initial[DEFAULT_SEED_CNT];
|
||||||
VALUE seed;
|
VALUE seed;
|
||||||
|
|
||||||
fill_random_seed(initial);
|
fill_random_seed(initial);
|
||||||
init_by_array(mt, initial, DEFAULT_SEED_CNT);
|
init_by_array(mt, initial, DEFAULT_SEED_CNT);
|
||||||
seed = make_seed_value(initial);
|
seed = make_seed_value(initial);
|
||||||
@ -1467,9 +1469,8 @@ void
|
|||||||
Init_RandomSeed(void)
|
Init_RandomSeed(void)
|
||||||
{
|
{
|
||||||
rb_random_t *r = &default_rand;
|
rb_random_t *r = &default_rand;
|
||||||
uint32_t initial[DEFAULT_SEED_CNT];
|
|
||||||
struct MT *mt = &r->mt;
|
struct MT *mt = &r->mt;
|
||||||
VALUE seed = init_randomseed(mt, initial);
|
VALUE seed = init_randomseed(mt);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
hashseed = genrand_int32(mt);
|
hashseed = genrand_int32(mt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user