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

ruby-changes:29564

From: akr <ko1@a...>
Date: Tue, 25 Jun 2013 12:47:02 +0900 (JST)
Subject: [ruby-changes:29564] akr:r41616 (trunk): * bignum.c (integer_unpack_single_bdigit): Use "1 + ~u" instead of

akr	2013-06-25 12:46:52 +0900 (Tue, 25 Jun 2013)

  New Revision: 41616

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

  Log:
    * bignum.c (integer_unpack_single_bdigit): Use "1 + ~u" instead of
      "-u" to suppress warning (C4146) by Visual Studio.
      Reported by ko1 via IRC.

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41615)
+++ ChangeLog	(revision 41616)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jun 25 12:42:57 2013  Tanaka Akira  <akr@f...>
+
+	* bignum.c (integer_unpack_single_bdigit): Use "1 + ~u" instead of
+	  "-u" to suppress warning (C4146) by Visual Studio.
+	  Reported by ko1 via IRC.
+
 Tue Jun 25 12:28:57 2013  Tanaka Akira  <akr@f...>
 
 	* bignum.c (big2ulong): Add code specialized for SIZEOF_LONG <=
Index: bignum.c
===================================================================
--- bignum.c	(revision 41615)
+++ bignum.c	(revision 41616)
@@ -1351,7 +1351,7 @@ integer_unpack_single_bdigit(BDIGIT u, s https://github.com/ruby/ruby/blob/trunk/bignum.c#L1351
             ((u >> (size * CHAR_BIT - 1)) ? -1 : 1);
         if (sign < 0) {
             u |= LSHIFTX(BDIGMAX, size * CHAR_BIT);
-            u = BIGLO(-u);
+            u = BIGLO(1 + ~u);
         }
     }
     else

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

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