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 + + * 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 * 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))