[前][次][番号順一覧][スレッド一覧]

ruby-changes:12543

From: nobu <ko1@a...>
Date: Thu, 23 Jul 2009 08:52:42 +0900 (JST)
Subject: [ruby-changes:12543] Ruby:r24251 (trunk): * random.c (random_{state,left}): internal/debug use.

nobu	2009-07-23 08:52:20 +0900 (Thu, 23 Jul 2009)

  New Revision: 24251

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24251

  Log:
    * random.c (random_{state,left}): internal/debug use.

  Modified files:
    trunk/ChangeLog
    trunk/random.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24250)
+++ ChangeLog	(revision 24251)
@@ -1,3 +1,7 @@
+Thu Jul 23 08:52:12 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* random.c (random_{state,left}): internal/debug use.
+
 Wed Jul 22 19:29:26 2009  Yukihiro Matsumoto  <matz@r...>
 
 	* test/ruby/test_module.rb (TestModule#test_alias): warning
@@ -3,5 +7,5 @@
 	  message updated.
 
-Thu Jul 23 00:39:25 2009    <nobu@r...>
+Thu Jul 23 00:39:25 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* common.mk (class.o): depends on vm_core.h.
Index: random.c
===================================================================
--- random.c	(revision 24250)
+++ random.c	(revision 24251)
@@ -516,6 +516,7 @@
     return rb_big_norm(bigo);
 }
 
+/* :nodoc: */
 static VALUE
 random_state(VALUE obj)
 {
@@ -523,12 +524,14 @@
     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 @@
     return INT2FIX(rnd->mt.left);
 }
 
+/* :nodoc: */
 static VALUE
 random_s_left(VALUE klass)
 {
@@ -1049,13 +1053,13 @@
     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);
 }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]