[Gmp-commit] /var/hg/gmp: Minor: Use consistent ->_mp_d notation in mini-gmp ...
mercurial at gmplib.org
mercurial at gmplib.org
Tue Jan 15 22:44:29 CET 2013
details: /var/hg/gmp/rev/02e38b8208d8
changeset: 15281:02e38b8208d8
user: Niels M?ller <nisse at lysator.liu.se>
date: Tue Jan 15 22:44:27 2013 +0100
description:
Minor: Use consistent ->_mp_d notation in mini-gmp test files.
diffstat:
ChangeLog | 3 +++
mini-gmp/tests/t-invert.c | 4 ++--
mini-gmp/tests/t-str.c | 4 ++--
3 files changed, 7 insertions(+), 4 deletions(-)
diffs (54 lines):
diff -r f130ae5dcdf2 -r 02e38b8208d8 ChangeLog
--- a/ChangeLog Tue Jan 15 22:37:28 2013 +0100
+++ b/ChangeLog Tue Jan 15 22:44:27 2013 +0100
@@ -1,5 +1,8 @@
2013-01-15 Niels Möller <nisse at lysator.liu.se>
+ * mini-gmp/tests/t-str.c (main): Use x->_mp_d rather than x[0]._mp_d.
+ * mini-gmp/tests/t-invert.c (main): Likewise.
+
* mini-gmp/tests/t-mul.c (main): Test mpn_mul_n and mpn_sqr.
* mini-gmp/tests/hex-random.h (enum hex_random_op): New value
diff -r f130ae5dcdf2 -r 02e38b8208d8 mini-gmp/tests/t-invert.c
--- a/mini-gmp/tests/t-invert.c Tue Jan 15 22:37:28 2013 +0100
+++ b/mini-gmp/tests/t-invert.c Tue Jan 15 22:44:27 2013 +0100
@@ -53,7 +53,7 @@
mini_urandomb (u, GMP_LIMB_BITS);
mpz_setbit (u, GMP_LIMB_BITS -1);
- mpz_set_ui (m, mpn_invert_limb (u[0]._mp_d[0]));
+ mpz_set_ui (m, mpn_invert_limb (u->_mp_d[0]));
mpz_setbit (m, GMP_LIMB_BITS);
mpz_mul (p, m, u);
@@ -79,7 +79,7 @@
mini_urandomb (u, 2*GMP_LIMB_BITS);
mpz_setbit (u, 2*GMP_LIMB_BITS -1);
- mpz_set_ui (m, mpn_invert_3by2 (u[0]._mp_d[1], u[0]._mp_d[0]));
+ mpz_set_ui (m, mpn_invert_3by2 (u->_mp_d[1], u[0]._mp_d[0]));
mpz_setbit (m, GMP_LIMB_BITS);
diff -r f130ae5dcdf2 -r 02e38b8208d8 mini-gmp/tests/t-str.c
--- a/mini-gmp/tests/t-str.c Tue Jan 15 22:37:28 2013 +0100
+++ b/mini-gmp/tests/t-str.c Tue Jan 15 22:44:27 2013 +0100
@@ -114,7 +114,7 @@
mp_size_t tn = mpz_size (a);
assert (tn <= MAXLIMBS);
- mpn_copyi (t, a[0]._mp_d, tn);
+ mpn_copyi (t, a->_mp_d, tn);
bn = mpn_get_str (bp, base, t, tn);
if (bn != arn)
@@ -160,7 +160,7 @@
}
}
tn = mpn_set_str (t, bp, bn, base);
- if (tn != mpz_size (a) || mpn_cmp (t, a[0]._mp_d, tn))
+ if (tn != mpz_size (a) || mpn_cmp (t, a->_mp_d, tn))
{
fprintf (stderr, "mpn_set_str failed:\n");
fprintf (stderr, "r = %s\n", rp);
More information about the gmp-commit
mailing list