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

ruby-changes:34293

From: eregon <ko1@a...>
Date: Sat, 7 Jun 2014 18:16:33 +0900 (JST)
Subject: [ruby-changes:34293] eregon:r46374 (trunk): * numeric.c (bit_coerce): remove constant parameter `err'

eregon	2014-06-07 18:16:21 +0900 (Sat, 07 Jun 2014)

  New Revision: 46374

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

  Log:
    * numeric.c (bit_coerce): remove constant parameter `err'
      (always TRUE) of bit_coerce().

  Modified files:
    trunk/ChangeLog
    trunk/numeric.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46373)
+++ ChangeLog	(revision 46374)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jun  7 18:15:33 2014  Benoit Daloze  <eregontp@g...>
+
+	* numeric.c (bit_coerce): remove constant parameter `err'
+	  (always TRUE) of bit_coerce().
+
 Sat Jun  7 16:01:57 2014  Yutaka Kanemoto  <kanemoto@r...>
 
 	* cont.c (rb_fiber_struct): keep context.uc_stack.ss_sp and context.uc_stack.ss_size
Index: numeric.c
===================================================================
--- numeric.c	(revision 46373)
+++ numeric.c	(revision 46374)
@@ -3407,13 +3407,12 @@ fix_rev(VALUE num) https://github.com/ruby/ruby/blob/trunk/numeric.c#L3407
 }
 
 static int
-bit_coerce(VALUE *x, VALUE *y, int err)
+bit_coerce(VALUE *x, VALUE *y)
 {
     if (!FIXNUM_P(*y) && !RB_TYPE_P(*y, T_BIGNUM)) {
-	do_coerce(x, y, err);
+	do_coerce(x, y, TRUE);
 	if (!FIXNUM_P(*x) && !RB_TYPE_P(*x, T_BIGNUM)
 	    && !FIXNUM_P(*y) && !RB_TYPE_P(*y, T_BIGNUM)) {
-	    if (!err) return FALSE;
 	    coerce_failed(*x, *y);
 	}
     }
@@ -3423,7 +3422,7 @@ bit_coerce(VALUE *x, VALUE *y, int err) https://github.com/ruby/ruby/blob/trunk/numeric.c#L3422
 VALUE
 rb_num_coerce_bit(VALUE x, VALUE y, ID func)
 {
-    bit_coerce(&x, &y, TRUE);
+    bit_coerce(&x, &y);
     return rb_funcall(x, func, 1, y);
 }
 
@@ -3446,7 +3445,7 @@ fix_and(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/numeric.c#L3445
 	return rb_big_and(y, x);
     }
 
-    bit_coerce(&x, &y, TRUE);
+    bit_coerce(&x, &y);
     return rb_funcall(x, rb_intern("&"), 1, y);
 }
 
@@ -3469,7 +3468,7 @@ fix_or(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/numeric.c#L3468
 	return rb_big_or(y, x);
     }
 
-    bit_coerce(&x, &y, TRUE);
+    bit_coerce(&x, &y);
     return rb_funcall(x, rb_intern("|"), 1, y);
 }
 
@@ -3492,7 +3491,7 @@ fix_xor(VALUE x, VALUE y) https://github.com/ruby/ruby/blob/trunk/numeric.c#L3491
 	return rb_big_xor(y, x);
     }
 
-    bit_coerce(&x, &y, TRUE);
+    bit_coerce(&x, &y);
     return rb_funcall(x, rb_intern("^"), 1, y);
 }
 

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

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