From f8faa5e8fe58638af854df11f47ac9d553c938fc Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 22 Jul 2009 23:52:20 +0000 Subject: [PATCH] * 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 --- ChangeLog | 6 +++++- random.c | 12 ++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c1a7a8594..9a38517540 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,13 @@ +Thu Jul 23 08:52:12 2009 Nobuyoshi Nakada + + * random.c (random_{state,left}): internal/debug use. + Wed Jul 22 19:29:26 2009 Yukihiro Matsumoto * test/ruby/test_module.rb (TestModule#test_alias): warning message updated. -Thu Jul 23 00:39:25 2009 +Thu Jul 23 00:39:25 2009 Nobuyoshi Nakada * common.mk (class.o): depends on vm_core.h. diff --git a/random.c b/random.c index ddaaedc5a8..c3fce95311 100644 --- a/random.c +++ b/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); }