summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2008-04-06 21:14:07 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2008-04-06 21:14:07 +0000
commit9096254e723f549b6d6491d5eddd08c05bbd8ebd (patch)
treedbe7cff2aa90259a59b14818d0113202a6d34c01 /tests
parente4f927434f16216f1497c6aa11cc4eee2e47ea5c (diff)
downloadmpfr-9096254e723f549b6d6491d5eddd08c05bbd8ebd.tar.gz
some other changes suggested by Patrick Pelissier for 16-bit portability
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5348 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r--tests/memory.c3
-rw-r--r--tests/tcmp2.c11
2 files changed, 8 insertions, 6 deletions
diff --git a/tests/memory.c b/tests/memory.c
index 41be9123f..62ec7373b 100644
--- a/tests/memory.c
+++ b/tests/memory.c
@@ -44,7 +44,7 @@ struct header {
struct header *next;
};
-static struct header *tests_memory_list = NULL;
+static struct header *tests_memory_list;
/* Return a pointer to a pointer to the found block (so it can be updated
when unlinking). */
@@ -169,6 +169,7 @@ tests_free (void *ptr, size_t size)
void
tests_memory_start (void)
{
+ tests_memory_list = NULL;
mp_set_memory_functions (tests_allocate, tests_reallocate, tests_free);
}
diff --git a/tests/tcmp2.c b/tests/tcmp2.c
index 7deacb96a..7696f78b9 100644
--- a/tests/tcmp2.c
+++ b/tests/tcmp2.c
@@ -57,7 +57,7 @@ worst_cases (void)
mpfr_init2 (y, 200);
mpfr_set_ui (y, 1, GMP_RNDN);
- for (i=1; i<MPFR_PREC(x); i++)
+ for (i = 1; i < MPFR_PREC(x); i++)
{
mpfr_set_ui (x, 1, GMP_RNDN);
mpfr_div_2exp (y, y, 1, GMP_RNDN); /* y = 1/2^i */
@@ -86,18 +86,18 @@ worst_cases (void)
}
}
- for (i=0; i<64; i++) /* |u| = i */
+ for (i = 0; i < 64; i++) /* |u| = i */
{
mpfr_random (x);
mpfr_set (y, x, GMP_RNDN);
set_bit (x, i + 1, 1);
set_bit (y, i + 1, 0);
- for (j=0; j<64; j++) /* |v| = j */
+ for (j = 0; j < 64; j++) /* |v| = j */
{
b = randlimb () % 2;
set_bit (x, i + j + 2, b);
set_bit (y, i + j + 2, b);
- for (k=0; k<64; k++)
+ for (k = 0; k < 64; k++)
{
if (k)
set_bit (x, i + j + k + 1, 0);
@@ -291,7 +291,8 @@ special (void)
int
main (void)
{
- int i, j;
+ int i;
+ long j;
double x, y, z;
tests_start_mpfr ();