summaryrefslogtreecommitdiffstats
path: root/random.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-22 23:52:20 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-22 23:52:20 +0000
commit6fd39ed1cc223e164c730ad9127a50a25003aa50 (patch)
tree15eb8ab2275a5152c26c3f57d4327571da78e5a2 /random.c
parent736cfb21e9bf1914800f210cce0068bba7d96dc8 (diff)
downloadruby-6fd39ed1cc223e164c730ad9127a50a25003aa50.tar.gz
ruby-6fd39ed1cc223e164c730ad9127a50a25003aa50.tar.xz
ruby-6fd39ed1cc223e164c730ad9127a50a25003aa50.zip
* random.c (random_{state,left}): internal/debug use.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/random.c b/random.c
index ddaaedc5a..c3fce9531 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);
}