summaryrefslogtreecommitdiff
path: root/tests/tsub_ui.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2008-02-15 17:38:31 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2008-02-15 17:38:31 +0000
commitc8ed1926e59eda68441ebf8f91e5a9268892cdf9 (patch)
tree58123ad4f453b7758f9846448db8204ecc552c99 /tests/tsub_ui.c
parentdad2bf1ef4af25fe87fe24f7ac295fb292987d6d (diff)
downloadmpfr-c8ed1926e59eda68441ebf8f91e5a9268892cdf9.tar.gz
For the terminating null pointer of the functions mpfr_inits,
mpfr_inits2, mpfr_clears, always use the type mpfr_ptr (no longer void *). Updated the description of these functions in the manual (mpfr.texi). The reason is that the C standard does not guarantee that (void *) 0 has the same representation as a null pointer to a structure (and even the same size). In most C implementations, the representations are the same, but one never knows (dynamical checking is also always possible)... The change has been done with: perl -pi -e \ 's/(mpfr_(clear|init)s.*)\(void *\*\) *0\)/$1(mpfr_ptr) 0)/' **/*.c under zsh. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5290 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tsub_ui.c')
-rw-r--r--tests/tsub_ui.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/tsub_ui.c b/tests/tsub_ui.c
index 3dadacbd8..9ddb0ae45 100644
--- a/tests/tsub_ui.c
+++ b/tests/tsub_ui.c
@@ -32,7 +32,7 @@ check3 (const char *xs, unsigned long y, mp_rnd_t rnd_mode, const char *zs)
{
mpfr_t xx,zz;
- mpfr_inits2 (53, xx, zz, (void *) 0);
+ mpfr_inits2 (53, xx, zz, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs);
mpfr_sub_ui (zz, xx, y, rnd_mode);
if (mpfr_cmp_str1(zz, zs))
@@ -43,7 +43,7 @@ check3 (const char *xs, unsigned long y, mp_rnd_t rnd_mode, const char *zs)
xs, y, mpfr_print_rnd_mode (rnd_mode));
exit (1);
}
- mpfr_clears (xx, zz, (void *) 0);
+ mpfr_clears (xx, zz, (mpfr_ptr) 0);
}
/* FastTwoSum: if EXP(x) >= EXP(y), u = o(x+y), v = o(u-x), w = o(y-v),
@@ -57,7 +57,7 @@ check_two_sum (mp_prec_t p)
mp_rnd_t rnd;
int inexact;
- mpfr_inits2 (p, y, u, v, w, (void *) 0);
+ mpfr_inits2 (p, y, u, v, w, (mpfr_ptr) 0);
do
{
x = randlimb ();
@@ -83,7 +83,7 @@ check_two_sum (mp_prec_t p)
printf ("inexact = %d\n", inexact);
exit (1);
}
- mpfr_clears (y, u, v, w, (void *) 0);
+ mpfr_clears (y, u, v, w, (mpfr_ptr) 0);
}
static void