diff options
author | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2013-01-25 08:40:26 +0100 |
---|---|---|
committer | Marco Bodrato <bodrato@mail.dm.unipi.it> | 2013-01-25 08:40:26 +0100 |
commit | 59995dcf6dfe4c366ed783930adc7818b9494f43 (patch) | |
tree | 6d9d4e17768bf6d3d8129285f45abf0d3e8a21d5 /mini-gmp | |
parent | 75cdc04caf91a73ec142306fcea92a969d99058d (diff) | |
download | gmp-59995dcf6dfe4c366ed783930adc7818b9494f43.tar.gz |
mini-gmp/tests/: Avoid a handful of warnings.
Diffstat (limited to 'mini-gmp')
-rw-r--r-- | mini-gmp/tests/t-comb.c | 1 | ||||
-rw-r--r-- | mini-gmp/tests/t-div.c | 6 | ||||
-rw-r--r-- | mini-gmp/tests/t-double.c | 4 | ||||
-rw-r--r-- | mini-gmp/tests/t-import.c | 12 | ||||
-rw-r--r-- | mini-gmp/tests/t-str.c | 10 |
5 files changed, 16 insertions, 17 deletions
diff --git a/mini-gmp/tests/t-comb.c b/mini-gmp/tests/t-comb.c index f67c219b9..2fe097d0d 100644 --- a/mini-gmp/tests/t-comb.c +++ b/mini-gmp/tests/t-comb.c @@ -54,7 +54,6 @@ bin_smallexaustive (unsigned int count) { mpz_t want; unsigned long n, k; - int tests; mpz_init (want); diff --git a/mini-gmp/tests/t-div.c b/mini-gmp/tests/t-div.c index 34a4f99ca..10b68a1c3 100644 --- a/mini-gmp/tests/t-div.c +++ b/mini-gmp/tests/t-div.c @@ -144,7 +144,7 @@ testmain (int argc, char **argv) mpz_mod (r, a, b); if (mpz_cmp (r, rr)) { - fprintf (stderr, "mpz_mod failed:\n", name[j]); + fprintf (stderr, "mpz_mod failed:\n"); dump ("a", a); dump ("b", b); dump ("r ", r); @@ -158,7 +158,7 @@ testmain (int argc, char **argv) mpz_mod (r, a, b); if (mpz_cmp (r, rr)) { - fprintf (stderr, "mpz_mod failed:\n", name[j]); + fprintf (stderr, "mpz_mod failed:\n"); dump ("a", a); dump ("b", b); dump ("r ", r); @@ -242,7 +242,7 @@ testmain (int argc, char **argv) mpz_mod_ui (r, a, mpz_get_ui (b)); if (mpz_cmp (r, rr)) { - fprintf (stderr, "mpz_mod failed:\n", name[j]); + fprintf (stderr, "mpz_mod failed:\n"); dump ("a", a); dump ("b", b); dump ("r ", r); diff --git a/mini-gmp/tests/t-double.c b/mini-gmp/tests/t-double.c index 188bf1327..c39e2ed00 100644 --- a/mini-gmp/tests/t-double.c +++ b/mini-gmp/tests/t-double.c @@ -108,7 +108,7 @@ testmain (int argc, char **argv) fprintf (stderr, "mpz_cmp_d (x, d) failed:\n"); goto dumperror; } - f = d + 1; + f = d + 1.0; if (f > d && ! (mpz_cmp_d (x, f) < 0)) { fprintf (stderr, "mpz_cmp_d (x, f) failed:\n"); @@ -135,7 +135,7 @@ testmain (int argc, char **argv) fprintf (stderr, "mpz_cmp_d (x, d) failed:\n"); goto dumperror; } - f = d - 1; + f = d - 1.0; if (f < d && ! (mpz_cmp_d (x, f) > 0)) { fprintf (stderr, "mpz_cmp_d (x, f) failed:\n"); diff --git a/mini-gmp/tests/t-import.c b/mini-gmp/tests/t-import.c index e9d11fa1f..2d9240645 100644 --- a/mini-gmp/tests/t-import.c +++ b/mini-gmp/tests/t-import.c @@ -73,8 +73,8 @@ testmain (int argc, char **argv) if (mpz_cmp (a, res)) { fprintf (stderr, "mpz_import failed:\n" - "in_count %d, out_count %d, endian = %d, order = %d\n", - in_count, out_count, endian, order); + "in_count %lu, out_count %lu, endian = %d, order = %d\n", + (unsigned long) in_count, (unsigned long) out_count, endian, order); dump ("a", a); dump ("res", res); abort (); @@ -89,15 +89,15 @@ testmain (int argc, char **argv) || output[1+in_count*size] != 17) { fprintf (stderr, "mpz_export failed:\n" - "in_count %d, out_count %d, endian = %d, order = %d\n", - in_count, out_count, endian, order); + "in_count %lu, out_count %lu, endian = %d, order = %d\n", + (unsigned long) in_count, (unsigned long) out_count, endian, order); dump_bytes ("input", input, in_count * size); dump_bytes ("output", output+1, out_count * size); if (output[0] != 17) fprintf (stderr, "Overwrite at -1, value %02x\n", output[0]); if (output[1+in_count*size] != 17) - fprintf (stderr, "Overwrite at %d, value %02x\n", - in_count*size, output[1+in_count*size]); + fprintf (stderr, "Overwrite at %lu, value %02x\n", + (unsigned long) (in_count*size), output[1+in_count*size]); abort (); } diff --git a/mini-gmp/tests/t-str.c b/mini-gmp/tests/t-str.c index ed00e5283..bd6152fed 100644 --- a/mini-gmp/tests/t-str.c +++ b/mini-gmp/tests/t-str.c @@ -213,8 +213,8 @@ testmain (int argc, char **argv) if (tn != rn) { fprintf (stderr, - "fread failed, expected %u bytes, got only %u.\n", - rn, tn); + "fread failed, expected %lu bytes, got only %lu.\n", + (unsigned long) rn, (unsigned long) tn); abort (); } @@ -258,8 +258,8 @@ testmain (int argc, char **argv) if (bn != arn) { fprintf (stderr, "mpn_get_str failed:\n"); - fprintf (stderr, "returned length: %d (bad)\n", bn); - fprintf (stderr, "expected: %d\n", arn); + fprintf (stderr, "returned length: %lu (bad)\n", (unsigned long) bn); + fprintf (stderr, "expected: %lu\n", (unsigned long) arn); fprintf (stderr, " base = %d\n", base); fprintf (stderr, "r = %s\n", ap); fprintf (stderr, " base = 16\n"); @@ -287,7 +287,7 @@ testmain (int argc, char **argv) if (bp[i] != value) { fprintf (stderr, "mpn_get_str failed:\n"); - fprintf (stderr, "digit %d: %d (bad)\n", i, bp[i]); + fprintf (stderr, "digit %lu: %d (bad)\n", (unsigned long) i, bp[i]); fprintf (stderr, "expected: %d\n", value); fprintf (stderr, " base = %d\n", base); fprintf (stderr, "r = %s\n", ap); |