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

ruby-changes:42529

From: mrkn <ko1@a...>
Date: Fri, 15 Apr 2016 22:58:03 +0900 (JST)
Subject: [ruby-changes:42529] mrkn:r54603 (trunk): rename rb_rational_add -> rb_rational_plus

mrkn	2016-04-15 23:54:39 +0900 (Fri, 15 Apr 2016)

  New Revision: 54603

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54603

  Log:
    rename rb_rational_add -> rb_rational_plus
    
    * rational.c (rb_rational_plus): rename from rb_rational_add
      to be aligned with rb_fix_plus.
    
    * array.c (rb_ary_sum): ditto.
    
    * internal.h: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/array.c
    trunk/internal.h
    trunk/rational.c
Index: internal.h
===================================================================
--- internal.h	(revision 54602)
+++ internal.h	(revision 54603)
@@ -1204,7 +1204,7 @@ rb_pid_t rb_fork_ruby(int *status); https://github.com/ruby/ruby/blob/trunk/internal.h#L1204
 void rb_last_status_clear(void);
 
 /* rational.c */
-VALUE rb_rational_add(VALUE self, VALUE other);
+VALUE rb_rational_plus(VALUE self, VALUE other);
 VALUE rb_lcm(VALUE x, VALUE y);
 VALUE rb_rational_reciprocal(VALUE x);
 VALUE rb_cstr_to_rat(const char *, int);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 54602)
+++ ChangeLog	(revision 54603)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Apr 15 23:52:00 2016  Kenta Murata  <mrkn@m...>
+
+	* rational.c (rb_rational_plus): rename from rb_rational_add
+	  to be aligned with rb_fix_plus.
+
+	* array.c (rb_ary_sum): ditto.
+
+	* internal.h: ditto.
+
 Fri Apr 15 23:42:00 2016  Kenta Murata  <mrkn@m...>
 
 	* rational.c (rb_rational_add): rename from nurat_add.
Index: rational.c
===================================================================
--- rational.c	(revision 54602)
+++ rational.c	(revision 54603)
@@ -742,7 +742,7 @@ f_addsub(VALUE self, VALUE anum, VALUE a https://github.com/ruby/ruby/blob/trunk/rational.c#L742
  *    Rational(20, 9) + 9.8              #=> 12.022222222222222
  */
 VALUE
-rb_rational_add(VALUE self, VALUE other)
+rb_rational_plus(VALUE self, VALUE other)
 {
     if (RB_TYPE_P(other, T_FIXNUM) || RB_TYPE_P(other, T_BIGNUM)) {
 	{
@@ -2538,7 +2538,7 @@ Init_Rational(void) https://github.com/ruby/ruby/blob/trunk/rational.c#L2538
     rb_define_method(rb_cRational, "numerator", nurat_numerator, 0);
     rb_define_method(rb_cRational, "denominator", nurat_denominator, 0);
 
-    rb_define_method(rb_cRational, "+", rb_rational_add, 1);
+    rb_define_method(rb_cRational, "+", rb_rational_plus, 1);
     rb_define_method(rb_cRational, "-", nurat_sub, 1);
     rb_define_method(rb_cRational, "*", nurat_mul, 1);
     rb_define_method(rb_cRational, "/", nurat_div, 1);
Index: array.c
===================================================================
--- array.c	(revision 54602)
+++ array.c	(revision 54603)
@@ -5762,7 +5762,7 @@ rb_ary_sum(int argc, VALUE *argv, VALUE https://github.com/ruby/ruby/blob/trunk/array.c#L5762
                 v = rb_to_float(v);
                 goto float_value;
             }
-            v = rb_rational_add(e, v);
+            v = rb_rational_plus(e, v);
         }
         return v;
     }

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

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