aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-25 10:36:14 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-25 10:36:14 +0000
commite4e5bc118e8abe96ff352dac2c7c62f9094a6e70 (patch)
tree08fce2e4e251596266245b2408bd194f96c339c6
parentb51a43e1c2608531bd8f25c606f9529aeba1c8a4 (diff)
downloadruby-e4e5bc118e8abe96ff352dac2c7c62f9094a6e70.tar.gz
* bignum.c (LSHIFTX): Revert r41611.
The redundant expression suppresses a warning, C4293, by Visual Studio. http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20130625T072854Z.log.html.gz#miniruby git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--bignum.c3
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index af01055e5b..8e864015b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Tue Jun 25 19:07:33 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c (LSHIFTX): Revert r41611.
+ The redundant expression suppresses a warning, C4293, by Visual
+ Studio.
+ http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20130625T072854Z.log.html.gz#miniruby
+
Tue Jun 25 19:03:00 2013 Tanaka Akira <akr@fsij.org>
* bignum.c (big2ulong): Add a cast.
diff --git a/bignum.c b/bignum.c
index 78fd02fb7a..f9cd368dee 100644
--- a/bignum.c
+++ b/bignum.c
@@ -39,7 +39,8 @@ static VALUE big_three = Qnil;
# define HOST_BIGENDIAN_P 0
#endif
#define ALIGNOF(type) ((int)offsetof(struct { char f1; type f2; }, f2))
-#define LSHIFTX(d, n) (sizeof(d) * CHAR_BIT <= (n) ? 0 : ((d) << (n)))
+/* (sizeof(d) * CHAR_BIT <= (n) ? 0 : (n)) is same as n but suppress a warning, C4293, by Visual Studio. */
+#define LSHIFTX(d, n) (sizeof(d) * CHAR_BIT <= (n) ? 0 : ((d) << (sizeof(d) * CHAR_BIT <= (n) ? 0 : (n))))
#define CLEAR_LOWBITS(d, numbits) ((d) & LSHIFTX(~((d)*0), (numbits)))
#define FILL_LOWBITS(d, numbits) ((d) | (LSHIFTX(((d)*0+1), (numbits))-1))