mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* random.c (random_{state,left}): internal/debug use.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7a5d48f6ab
commit
f8faa5e8fe
2 changed files with 13 additions and 5 deletions
|
@ -1,9 +1,13 @@
|
|||
Thu Jul 23 08:52:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* random.c (random_{state,left}): internal/debug use.
|
||||
|
||||
Wed Jul 22 19:29:26 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* test/ruby/test_module.rb (TestModule#test_alias): warning
|
||||
message updated.
|
||||
|
||||
Thu Jul 23 00:39:25 2009 <nobu@ruby-lang.org>
|
||||
Thu Jul 23 00:39:25 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* common.mk (class.o): depends on vm_core.h.
|
||||
|
||||
|
|
12
random.c
12
random.c
|
@ -516,6 +516,7 @@ mt_state(const struct MT *mt)
|
|||
return rb_big_norm(bigo);
|
||||
}
|
||||
|
||||
/* :nodoc: */
|
||||
static VALUE
|
||||
random_state(VALUE obj)
|
||||
{
|
||||
|
@ -523,12 +524,14 @@ random_state(VALUE obj)
|
|||
return mt_state(&rnd->mt);
|
||||
}
|
||||
|
||||
/* :nodoc: */
|
||||
static VALUE
|
||||
random_s_state(VALUE klass)
|
||||
{
|
||||
return mt_state(&default_rand.rnd.mt);
|
||||
}
|
||||
|
||||
/* :nodoc: */
|
||||
static VALUE
|
||||
random_left(VALUE obj)
|
||||
{
|
||||
|
@ -536,6 +539,7 @@ random_left(VALUE obj)
|
|||
return INT2FIX(rnd->mt.left);
|
||||
}
|
||||
|
||||
/* :nodoc: */
|
||||
static VALUE
|
||||
random_s_left(VALUE klass)
|
||||
{
|
||||
|
@ -1049,13 +1053,13 @@ Init_Random(void)
|
|||
rb_define_method(rb_cRandom, "initialize_copy", random_copy, 1);
|
||||
rb_define_method(rb_cRandom, "marshal_dump", random_dump, 0);
|
||||
rb_define_method(rb_cRandom, "marshal_load", random_load, 1);
|
||||
rb_define_method(rb_cRandom, "state", random_state, 0);
|
||||
rb_define_method(rb_cRandom, "left", random_left, 0);
|
||||
rb_define_private_method(rb_cRandom, "state", random_state, 0);
|
||||
rb_define_private_method(rb_cRandom, "left", random_left, 0);
|
||||
rb_define_method(rb_cRandom, "==", random_equal, 1);
|
||||
|
||||
rb_define_singleton_method(rb_cRandom, "srand", rb_f_srand, -1);
|
||||
rb_define_singleton_method(rb_cRandom, "rand", rb_f_rand, -1);
|
||||
rb_define_singleton_method(rb_cRandom, "new_seed", random_seed, 0);
|
||||
rb_define_singleton_method(rb_cRandom, "state", random_s_state, 0);
|
||||
rb_define_singleton_method(rb_cRandom, "left", random_s_left, 0);
|
||||
rb_define_private_method(CLASS_OF(rb_cRandom), "state", random_s_state, 0);
|
||||
rb_define_private_method(CLASS_OF(rb_cRandom), "left", random_s_left, 0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue