diff options
author | Kevin Ryde <user42@zip.com.au> | 2002-07-17 03:29:28 +0200 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2002-07-17 03:29:28 +0200 |
commit | 57f1782423a3d7ff78ce6c83bcb6bc125e1d5945 (patch) | |
tree | c1b014faa789ff1ff06c56109a854f433a7da5b3 /tests/refmpz.c | |
parent | 310169dfb1738f7302c6342c6252b53509befc1a (diff) | |
download | gmp-57f1782423a3d7ff78ce6c83bcb6bc125e1d5945.tar.gz |
* tests/refmpz.c (refmpz_hamdist): Ensure mp_size_t parameters are
that type, for the benefit of hpux ia64 bundled cc ABI=64.
Diffstat (limited to 'tests/refmpz.c')
-rw-r--r-- | tests/refmpz.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/refmpz.c b/tests/refmpz.c index 1d71b1dff..24d1832f9 100644 --- a/tests/refmpz.c +++ b/tests/refmpz.c @@ -48,7 +48,7 @@ refmpz_combit (mpz_ptr r, unsigned long bit) unsigned long refmpz_hamdist (mpz_srcptr x, mpz_srcptr y) { - mp_size_t tsize; + mp_size_t xsize, ysize, tsize; mp_ptr xp, yp; unsigned long ret; @@ -56,15 +56,17 @@ refmpz_hamdist (mpz_srcptr x, mpz_srcptr y) || (SIZ(y) < 0 && SIZ(x) >= 0)) return ULONG_MAX; - tsize = MAX (ABSIZ(x), ABSIZ(y)); + xsize = ABSIZ(x); + ysize = ABSIZ(y); + tsize = MAX (xsize, ysize); xp = refmpn_malloc_limbs (tsize); refmpn_zero (xp, tsize); - refmpn_copy (xp, PTR(x), ABSIZ(x)); - + refmpn_copy (xp, PTR(x), xsize); + yp = refmpn_malloc_limbs (tsize); refmpn_zero (yp, tsize); - refmpn_copy (yp, PTR(y), ABSIZ(y)); + refmpn_copy (yp, PTR(y), ysize); if (SIZ(x) < 0) refmpn_neg_n (xp, xp, tsize); |