From 6fe40011a8a4f443248962a1dd6d9f590270a15a Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 1 Sep 2013 04:03:32 +0000 Subject: * bignum.c: Remove BITSPERDIG >= INT_MAX test. The static assertion, SIZEOF_BDIGITS <= sizeof(BDIGIT) is enough. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bignum.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'bignum.c') diff --git a/bignum.c b/bignum.c index 7120f4e3aa..fc1ac8cb55 100644 --- a/bignum.c +++ b/bignum.c @@ -64,7 +64,7 @@ STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGITS % SIZEOF_LONG == 0); # define HOST_BIGENDIAN_P 0 #endif #define ALIGNOF(type) ((int)offsetof(struct { char f1; type f2; }, f2)) -/* (sizeof(d) * CHAR_BIT <= (n) ? 0 : (n)) is same as n but suppress a warning, C4293, by Visual Studio. */ +/* (!LSHIFTABLE(d, n) ? 0 : (n)) is same as n but suppress a warning, C4293, by Visual Studio. */ #define LSHIFTABLE(d, n) ((n) < sizeof(d) * CHAR_BIT) #define LSHIFTX(d, n) (!LSHIFTABLE(d, n) ? 0 : ((d) << (!LSHIFTABLE(d, n) ? 0 : (n)))) #define CLEAR_LOWBITS(d, numbits) ((d) & LSHIFTX(~((d)*0), (numbits))) @@ -73,9 +73,6 @@ STATIC_ASSERT(sizeof_long_and_sizeof_bdigit, SIZEOF_BDIGITS % SIZEOF_LONG == 0); #define BDIGITS(x) (RBIGNUM_DIGITS(x)) #define BITSPERDIG (SIZEOF_BDIGITS*CHAR_BIT) -#if BITSPERDIG >= INT_MAX -# error incredible BDIGIT -#endif #define BIGRAD ((BDIGIT_DBL)1 << BITSPERDIG) #define BIGRAD_HALF ((BDIGIT)(BIGRAD >> 1)) #define BDIGIT_MSB(d) (((d) & BIGRAD_HALF) != 0) -- cgit v1.2.3