diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2011-05-12 12:36:13 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2011-05-12 12:36:13 +0000 |
commit | 96e7f3fffaee46d9ce896161b7a54402d47afc4d (patch) | |
tree | bbff542658098085e2e7c803c091ab886781a325 /tests/tadd1sp.c | |
parent | a76828f172de1b273e921937941a0cc7b2ccf201 (diff) | |
download | mpfr-96e7f3fffaee46d9ce896161b7a54402d47afc4d.tar.gz |
Fixed printf's calls: support the case where mpfr_prec_t is not a long
(or unsigned long).
[merged changeset r7643 from the exp-int branch]
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7686 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tadd1sp.c')
-rw-r--r-- | tests/tadd1sp.c | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/tests/tadd1sp.c b/tests/tadd1sp.c index ce7f2aef7..1fd0c85a5 100644 --- a/tests/tadd1sp.c +++ b/tests/tadd1sp.c @@ -73,29 +73,33 @@ main (void) return 0; } -#define STD_ERROR \ - {\ - printf("ERROR: for %s and p=%lu and i=%d:\nB=",\ - mpfr_print_rnd_mode ((mpfr_rnd_t) r), p, i);\ - mpfr_print_binary(b);\ - printf("\nC="); mpfr_print_binary(c);\ - printf("\nadd1 : "); mpfr_print_binary(a1);\ - printf("\nadd1sp: "); mpfr_print_binary(a2);\ - putchar('\n');\ - exit(1);\ - } - -#define STD_ERROR2 \ - {\ - printf("ERROR: Wrong inexact flag for %s and p=%lu and i=%d:\nB=",\ - mpfr_print_rnd_mode ((mpfr_rnd_t) r), p, i);\ - mpfr_print_binary(b);\ - printf("\nC="); mpfr_print_binary(c);\ - printf("\nA="); mpfr_print_binary(a1);\ - printf("\nAdd1: %d. Add1sp: %d\n", \ - inexact1, inexact2); \ - exit(1);\ - } +#define STD_ERROR \ + do \ + { \ + printf("ERROR: for %s and p=%lu and i=%d:\nB=", \ + mpfr_print_rnd_mode ((mpfr_rnd_t) r), (unsigned long) p, i); \ + mpfr_print_binary(b); \ + printf("\nC="); mpfr_print_binary(c); \ + printf("\nadd1 : "); mpfr_print_binary(a1); \ + printf("\nadd1sp: "); mpfr_print_binary(a2); \ + putchar('\n'); \ + exit(1); \ + } \ + while (0) + +#define STD_ERROR2 \ + do \ + { \ + printf("ERROR: Wrong inexact flag for %s and p=%lu and i=%d:\nB=", \ + mpfr_print_rnd_mode ((mpfr_rnd_t) r), (unsigned long) p, i); \ + mpfr_print_binary(b); \ + printf("\nC="); mpfr_print_binary(c); \ + printf("\nA="); mpfr_print_binary(a1); \ + printf("\nAdd1: %d. Add1sp: %d\n", \ + inexact1, inexact2); \ + exit(1); \ + } \ + while (0) #define SET_PREC(_p) \ { \ |