summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-01-24 11:09:21 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-01-24 11:09:21 +0000
commit4f6d1b61eb0bb4861da8feb9afecc1e48070b99f (patch)
tree95f5597fd0d2fa9a752935da5ebd6821525c2d7e
parent1a5e30f5a19efbf9b68df7cf2e443cbcb1520a32 (diff)
downloadmpfr-4f6d1b61eb0bb4861da8feb9afecc1e48070b99f.tar.gz
[src] Replaced some MPFR_ASSERTN's by MPFR_STAT_STATIC_ASSERT (from the
detection by mpfrlint). Note: the MPFR_ASSERTN's concerning relations between the MPFR exponent type and the long type have not been replaced because these tests may fail with the non-standard _MPFR_EXP_FORMAT = 4 on some platforms (e.g. 32-bit ones), and we still want to be able to build MPFR in this case in order to test it; this needs to be fixed. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8896 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--src/cot.c2
-rw-r--r--src/fpif.c2
-rw-r--r--src/pow.c2
-rw-r--r--src/print_rnd_mode.c2
-rw-r--r--src/rec_sqrt.c2
-rw-r--r--src/strtofr.c2
-rw-r--r--src/urandom.c2
7 files changed, 7 insertions, 7 deletions
diff --git a/src/cot.c b/src/cot.c
index ec80eaaca..28736aaec 100644
--- a/src/cot.c
+++ b/src/cot.c
@@ -54,7 +54,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
{ \
int two2emin; \
int signx = MPFR_SIGN(x); \
- MPFR_ASSERTN (MPFR_EMIN_MIN + MPFR_EMAX_MAX == 0); \
+ MPFR_STAT_STATIC_ASSERT (MPFR_EMIN_MIN + MPFR_EMAX_MAX == 0); \
if ((two2emin = mpfr_get_exp (x) == __gmpfr_emin + 1 && \
mpfr_powerof2_raw (x))) \
{ \
diff --git a/src/fpif.c b/src/fpif.c
index 3b804f7a9..5e9f14bad 100644
--- a/src/fpif.c
+++ b/src/fpif.c
@@ -548,7 +548,7 @@ mpfr_fpif_import (mpfr_t x, FILE *fh)
return -1;
if (precision > MPFR_PREC_MAX)
return -1;
- MPFR_ASSERTN (MPFR_PREC_MIN <= 8);
+ MPFR_STAT_STATIC_ASSERT (MPFR_PREC_MIN <= 8);
if (precision < MPFR_PREC_MIN)
precision = MPFR_PREC_MIN;
mpfr_set_prec (x, precision);
diff --git a/src/pow.c b/src/pow.c
index dfdea3572..45d1ff92a 100644
--- a/src/pow.c
+++ b/src/pow.c
@@ -364,7 +364,7 @@ mpfr_pow_general (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y,
* obtain the correct result and exceptions by replacing z by
* nextabove(z).
*/
- MPFR_ASSERTN (MPFR_PREC_MIN > 1);
+ MPFR_STAT_STATIC_ASSERT (MPFR_PREC_MIN > 1);
mpfr_nextabove (z);
}
MPFR_CLEAR_FLAGS ();
diff --git a/src/print_rnd_mode.c b/src/print_rnd_mode.c
index b58f9e48b..609b3c518 100644
--- a/src/print_rnd_mode.c
+++ b/src/print_rnd_mode.c
@@ -27,7 +27,7 @@ mpfr_print_rnd_mode (mpfr_rnd_t rnd_mode)
{
/* If we forget to update this function after a new rounding mode
is added, this will be detected by the following assertion. */
- MPFR_ASSERTN (MPFR_RND_MAX == MPFR_RNDA + 1);
+ MPFR_STAT_STATIC_ASSERT (MPFR_RND_MAX == MPFR_RNDA + 1);
switch (rnd_mode)
{
case MPFR_RNDD:
diff --git a/src/rec_sqrt.c b/src/rec_sqrt.c
index b4d95e3df..9adcfd801 100644
--- a/src/rec_sqrt.c
+++ b/src/rec_sqrt.c
@@ -163,7 +163,7 @@ mpfr_mpn_rec_sqrt (mpfr_limb_ptr x, mpfr_prec_t p,
MPFR_ASSERTD((a[an - 1] & MPFR_LIMB_HIGHBIT) != 0);
/* We should have enough bits in one limb and GMP_NUMB_BITS should be even.
Since that does not depend on MPFR, we always check this. */
- MPFR_ASSERTN((GMP_NUMB_BITS >= 12) && ((GMP_NUMB_BITS & 1) == 0));
+ MPFR_STAT_STATIC_ASSERT (GMP_NUMB_BITS >= 12 && (GMP_NUMB_BITS & 1) == 0);
/* {a, an} and {x, n} should not overlap */
MPFR_ASSERTD((a + an <= x) || (x + n <= a));
MPFR_ASSERTD(p >= 11);
diff --git a/src/strtofr.c b/src/strtofr.c
index 1b760a004..339bbc316 100644
--- a/src/strtofr.c
+++ b/src/strtofr.c
@@ -821,7 +821,7 @@ mpfr_strtofr (mpfr_t x, const char *string, char **end, int base,
MPFR_SET_ZERO (x);
MPFR_SET_POS (x);
- MPFR_ASSERTN (MPFR_MAX_BASE >= 62);
+ MPFR_STAT_STATIC_ASSERT (MPFR_MAX_BASE >= 62);
res = parse_string (x, &pstr, &string, base);
/* If res == 0, then it was exact (NAN or INF),
so it is also the ternary value */
diff --git a/src/urandom.c b/src/urandom.c
index 4d7f5aecb..677944932 100644
--- a/src/urandom.c
+++ b/src/urandom.c
@@ -75,7 +75,7 @@ mpfr_urandom (mpfr_ptr rop, gmp_randstate_t rstate, mpfr_rnd_t rnd_mode)
/* Exponent */
#define DRAW_BITS 8 /* we draw DRAW_BITS at a time */
cnt = DRAW_BITS;
- MPFR_ASSERTN(DRAW_BITS <= GMP_NUMB_BITS);
+ MPFR_STAT_STATIC_ASSERT (DRAW_BITS <= GMP_NUMB_BITS);
while (cnt == DRAW_BITS)
{
/* generate DRAW_BITS in rp[0] */