aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--bignum.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 8210ac2975..3b504f685d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Sep 1 13:02:24 2013 Tanaka Akira <akr@fsij.org>
+
+ * bignum.c: Remove BITSPERDIG >= INT_MAX test. The static assertion,
+ SIZEOF_BDIGITS <= sizeof(BDIGIT) is enough.
+
Sun Sep 1 11:38:26 2013 Tanaka Akira <akr@fsij.org>
* bignum.c (maxpow_in_bdigit): Removed.
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)