summaryrefslogtreecommitdiff
path: root/tests/tsin_cos.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/tsin_cos.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/tsin_cos.c')
-rw-r--r--tests/tsin_cos.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/tsin_cos.c b/tests/tsin_cos.c
index cbedbe3ad..424011908 100644
--- a/tests/tsin_cos.c
+++ b/tests/tsin_cos.c
@@ -50,7 +50,7 @@ check53 (const char *xs, const char *sin_xs, const char *cos_xs,
{
mpfr_t xx, s, c;
- mpfr_inits2 (53, xx, s, c, (void *) 0);
+ mpfr_inits2 (53, xx, s, c, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs); /* should be exact */
mpfr_sin_cos (s, c, xx, rnd_mode);
if (mpfr_cmp_str1 (s, sin_xs))
@@ -71,7 +71,7 @@ check53 (const char *xs, const char *sin_xs, const char *cos_xs,
printf(", expected %s\n", cos_xs);
exit (1);
}
- mpfr_clears (xx, s, c, (void *) 0);
+ mpfr_clears (xx, s, c, (mpfr_ptr) 0);
}
static void
@@ -79,7 +79,7 @@ check53sin (const char *xs, const char *sin_xs, mp_rnd_t rnd_mode)
{
mpfr_t xx, s, c;
- mpfr_inits2 (53, xx, s, c, (void *) 0);
+ mpfr_inits2 (53, xx, s, c, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs); /* should be exact */
mpfr_sin_cos (s, c, xx, rnd_mode);
if (mpfr_cmp_str1 (s, sin_xs))
@@ -91,7 +91,7 @@ check53sin (const char *xs, const char *sin_xs, mp_rnd_t rnd_mode)
printf(", expected %s\n", sin_xs);
exit (1);
}
- mpfr_clears (xx, s, c, (void *) 0);
+ mpfr_clears (xx, s, c, (mpfr_ptr) 0);
}
static void
@@ -99,7 +99,7 @@ check53cos (const char *xs, const char *cos_xs, mp_rnd_t rnd_mode)
{
mpfr_t xx, c, s;
- mpfr_inits2 (53, xx, s, c, (void *) 0);
+ mpfr_inits2 (53, xx, s, c, (mpfr_ptr) 0);
mpfr_set_str1 (xx, xs); /* should be exact */
mpfr_sin_cos (s, c, xx, rnd_mode);
if (mpfr_cmp_str1 (c, cos_xs))
@@ -111,7 +111,7 @@ check53cos (const char *xs, const char *cos_xs, mp_rnd_t rnd_mode)
printf(", expected %s\n", cos_xs);
exit (1);
}
- mpfr_clears (xx, s, c, (void *) 0);
+ mpfr_clears (xx, s, c, (mpfr_ptr) 0);
}
static void
@@ -258,7 +258,7 @@ tiny (void)
mpfr_t x, s, c;
int i, inex;
- mpfr_inits2 (64, x, s, c, (void *) 0);
+ mpfr_inits2 (64, x, s, c, (mpfr_ptr) 0);
for (i = -1; i <= 1; i += 2)
{
@@ -270,7 +270,7 @@ tiny (void)
MPFR_ASSERTN (!mpfr_nan_p (c) && mpfr_cmp_ui (c, 1) == 0);
}
- mpfr_clears (x, s, c, (void *) 0);
+ mpfr_clears (x, s, c, (mpfr_ptr) 0);
}
/* bug found in nightly tests */