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

ruby-changes:3096

From: ko1@a...
Date: 24 Dec 2007 17:19:53 +0900
Subject: [ruby-changes:3096] akr - Ruby:r14588 (trunk): * include/ruby/intern.h, random.c, array.c:

akr	2007-12-24 17:19:28 +0900 (Mon, 24 Dec 2007)

  New Revision: 14588

  Modified files:
    trunk/ChangeLog
    trunk/array.c
    trunk/include/ruby/intern.h
    trunk/random.c

  Log:
    * include/ruby/intern.h, random.c, array.c:
      change exported name.
      genrand_int32 -> rb_genrand_int32.
      genrand_real -> rb_genrand_real.
      [ruby-core:14335]


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/array.c?r1=14588&r2=14587
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14588&r2=14587
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/random.c?r1=14588&r2=14587
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/intern.h?r1=14588&r2=14587

Index: array.c
===================================================================
--- array.c	(revision 14587)
+++ array.c	(revision 14588)
@@ -2896,7 +2896,7 @@
     rb_ary_modify(ary);
     ary_iter_check(ary);
     while (i) {
-	long j = genrand_real()*i;
+	long j = rb_genrand_real()*i;
 	VALUE tmp = RARRAY_PTR(ary)[--i];
 	RARRAY_PTR(ary)[i] = RARRAY_PTR(ary)[j];
 	RARRAY_PTR(ary)[j] = tmp;
@@ -2939,7 +2939,7 @@
 
     i = RARRAY_LEN(ary);
     if (i == 0) return Qnil;
-    j = genrand_real()*i;
+    j = rb_genrand_real()*i;
     return RARRAY_PTR(ary)[j];
 }
 
Index: include/ruby/intern.h
===================================================================
--- include/ruby/intern.h	(revision 14587)
+++ include/ruby/intern.h	(revision 14588)
@@ -442,8 +442,8 @@
 VALUE rb_range_new(VALUE, VALUE, int);
 VALUE rb_range_beg_len(VALUE, long*, long*, long, int);
 /* random.c */
-unsigned long genrand_int32(void);
-double genrand_real(void);
+unsigned long rb_genrand_int32(void);
+double rb_genrand_real(void);
 /* re.c */
 #define rb_memcmp memcmp
 int rb_memcicmp(const void*,const void*,long);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14587)
+++ ChangeLog	(revision 14588)
@@ -1,3 +1,11 @@
+Mon Dec 24 17:12:57 2007  Tanaka Akira  <akr@f...>
+
+	* include/ruby/intern.h, random.c, array.c:
+	  change exported name.
+	  genrand_int32 -> rb_genrand_int32.
+	  genrand_real -> rb_genrand_real.
+	  [ruby-core:14335]
+
 Mon Dec 24 17:06:37 2007  NAKAMURA, Hiroshi  <nahi@r...>
 
 	* {lib,test}/{soap,wsdl,xsd}: removed soap4r along to the discussion
Index: random.c
===================================================================
--- random.c	(revision 14587)
+++ random.c	(revision 14588)
@@ -145,7 +145,7 @@
 }
 
 /* generates a random number on [0,0xffffffff]-interval */
-unsigned long
+static unsigned long
 genrand_int32(void)
 {
     unsigned long y;
@@ -163,7 +163,7 @@
 }
 
 /* generates a random number on [0,1) with 53-bit resolution*/
-double
+static double
 genrand_real(void)
 { 
     unsigned long a=genrand_int32()>>5, b=genrand_int32()>>6; 
@@ -188,6 +188,18 @@
 #include <fcntl.h>
 #endif
 
+unsigned long
+rb_genrand_int32(void)
+{
+    return genrand_int32();
+}
+
+double
+rb_genrand_real(void)
+{
+    return genrand_real();
+}
+
 static VALUE saved_seed = INT2FIX(0);
 
 static VALUE

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

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