summaryrefslogtreecommitdiff
path: root/src/init2.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2012-06-25 16:52:37 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2012-06-25 16:52:37 +0000
commit58d07a8e7571b95fa6c8bf48f596b35f0a894210 (patch)
tree633d841dae84731f3849f8c04f7022c3e1c33ca9 /src/init2.c
parent35bde4fc99e73c78133e342257d07986d9d8d6b3 (diff)
downloadmpfr-58d07a8e7571b95fa6c8bf48f596b35f0a894210.tar.gz
[src/init2.c] Replaced classic assertions by static assertions.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8242 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/init2.c')
-rw-r--r--src/init2.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/init2.c b/src/init2.c
index d3ac1cd3f..f93d8dcef 100644
--- a/src/init2.c
+++ b/src/init2.c
@@ -30,21 +30,21 @@ mpfr_init2 (mpfr_ptr x, mpfr_prec_t p)
/* Check if we can represent the number of limbs
* associated to the maximum of mpfr_prec_t*/
- MPFR_ASSERTN( MP_SIZE_T_MAX >= (MPFR_PREC_MAX/BYTES_PER_MP_LIMB) );
+ MPFR_STAT_STATIC_ASSERT( MP_SIZE_T_MAX >= (MPFR_PREC_MAX/BYTES_PER_MP_LIMB) );
/* Check for correct GMP_NUMB_BITS and BYTES_PER_MP_LIMB */
- MPFR_ASSERTN( GMP_NUMB_BITS == BYTES_PER_MP_LIMB * CHAR_BIT
- && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB );
-
+ MPFR_STAT_STATIC_ASSERT( GMP_NUMB_BITS == BYTES_PER_MP_LIMB * CHAR_BIT
+ && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB );
+ /* Check for mp_bits_per_limb (a global variable inside GMP library) */
MPFR_ASSERTN (mp_bits_per_limb == GMP_NUMB_BITS);
/* Check for correct EXP NAN, ZERO & INF in both mpfr.h and mpfr-impl.h */
- MPFR_ASSERTN( __MPFR_EXP_NAN == MPFR_EXP_NAN );
- MPFR_ASSERTN( __MPFR_EXP_ZERO == MPFR_EXP_ZERO );
- MPFR_ASSERTN( __MPFR_EXP_INF == MPFR_EXP_INF );
+ MPFR_STAT_STATIC_ASSERT( __MPFR_EXP_NAN == MPFR_EXP_NAN );
+ MPFR_STAT_STATIC_ASSERT( __MPFR_EXP_ZERO == MPFR_EXP_ZERO );
+ MPFR_STAT_STATIC_ASSERT( __MPFR_EXP_INF == MPFR_EXP_INF );
- MPFR_ASSERTN( MPFR_EMAX_MAX <= (MPFR_EXP_MAX >> 1) );
- MPFR_ASSERTN( MPFR_EMIN_MIN >= -(MPFR_EXP_MAX >> 1) );
+ MPFR_STAT_STATIC_ASSERT( MPFR_EMAX_MAX <= (MPFR_EXP_MAX >> 1) );
+ MPFR_STAT_STATIC_ASSERT( MPFR_EMIN_MIN >= -(MPFR_EXP_MAX >> 1) );
/* p=1 is not allowed since the rounding to nearest even rule requires at
least two bits of mantissa: the neighbours of 3/2 are 1*2^0 and 1*2^1,