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

ruby-changes:31751

From: akr <ko1@a...>
Date: Sun, 24 Nov 2013 22:27:28 +0900 (JST)
Subject: [ruby-changes:31751] akr:r43830 (trunk): * bignum.c (bigxor_int): Apply BIGLO for long in a BDIGIT expression.

akr	2013-11-24 22:27:14 +0900 (Sun, 24 Nov 2013)

  New Revision: 43830

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

  Log:
    * bignum.c (bigxor_int): Apply BIGLO for long in a BDIGIT expression.
      (bigor_int): Ditto.
      (bigand_int): Ditto.

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43829)
+++ ChangeLog	(revision 43830)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Nov 24 22:24:19 2013  Tanaka Akira  <akr@f...>
+
+	* bignum.c (bigxor_int): Apply BIGLO for long in a BDIGIT expression.
+	  (bigor_int): Ditto.
+	  (bigand_int): Ditto.
+
 Sun Nov 24 18:13:23 2013  Tanaka Akira  <akr@f...>
 
 	* include/ruby/defines.h (SIZEOF_ACTUAL_BDIGIT): Defined.
Index: bignum.c
===================================================================
--- bignum.c	(revision 43829)
+++ bignum.c	(revision 43830)
@@ -6445,7 +6445,7 @@ bigand_int(VALUE x, long xn, BDIGIT hibi https://github.com/ruby/ruby/blob/trunk/bignum.c#L6445
 
 #if SIZEOF_BDIGITS >= SIZEOF_LONG
     i = 1;
-    zds[0] = xds[0] & y;
+    zds[0] = xds[0] & BIGLO(y);
 #else
     for (i=0; i < xn; i++) {
         if (y == 0 || y == -1) break;
@@ -6551,7 +6551,7 @@ bigor_int(VALUE x, long xn, BDIGIT hibit https://github.com/ruby/ruby/blob/trunk/bignum.c#L6551
 
 #if SIZEOF_BDIGITS >= SIZEOF_LONG
     i = 1;
-    zds[0] = xds[0] | y;
+    zds[0] = xds[0] | BIGLO(y);
     if (i < zn)
         goto y_is_fixed_point;
     goto finish;
@@ -6674,7 +6674,7 @@ bigxor_int(VALUE x, long xn, BDIGIT hibi https://github.com/ruby/ruby/blob/trunk/bignum.c#L6674
 
 #if SIZEOF_BDIGITS >= SIZEOF_LONG
     i = 1;
-    zds[0] = xds[0] ^ y;
+    zds[0] = xds[0] ^ BIGLO(y);
 #else
     for (i = 0; i < xn; i++) {
         zds[i] = xds[i] ^ BIGLO(y);

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

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