diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-25 03:46:52 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-25 03:46:52 +0000 |
commit | 8dcdfe36b7c3c084764604f14b67b04fb3f4be01 (patch) | |
tree | 815b725bb149b308eda39e8939c14937ad2ce671 | |
parent | 26dd237449561f92920e4b9af1b4868f401e4e71 (diff) |
* bignum.c (integer_unpack_single_bdigit): Use "1 + ~u" instead of
"-u" to suppress warning (C4146) by Visual Studio.
Reported by ko1 via IRC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | bignum.c | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Tue Jun 25 12:42:57 2013 Tanaka Akira <[email protected]> + + * 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 <[email protected]> * bignum.c (big2ulong): Add code specialized for SIZEOF_LONG <= @@ -1351,7 +1351,7 @@ integer_unpack_single_bdigit(BDIGIT u, size_t size, int flags, BDIGIT *dp) ((u >> (size * CHAR_BIT - 1)) ? -1 : 1); if (sign < 0) { u |= LSHIFTX(BDIGMAX, size * CHAR_BIT); - u = BIGLO(-u); + u = BIGLO(1 + ~u); } } else |