diff options
-rw-r--r-- | tests/reuse.c | 4 | ||||
-rw-r--r-- | tests/tabs.c | 4 | ||||
-rw-r--r-- | tests/tadd.c | 5 | ||||
-rw-r--r-- | tests/tagm.c | 5 | ||||
-rw-r--r-- | tests/tcan_round.c | 7 | ||||
-rw-r--r-- | tests/tcmp.c | 4 | ||||
-rw-r--r-- | tests/tcmp2.c | 5 | ||||
-rw-r--r-- | tests/tcmp_ui.c | 4 | ||||
-rw-r--r-- | tests/tdiv.c | 4 | ||||
-rw-r--r-- | tests/tdiv_ui.c | 2 | ||||
-rw-r--r-- | tests/tdump.c | 5 | ||||
-rw-r--r-- | tests/teq.c | 5 | ||||
-rw-r--r-- | tests/texp.c | 3 | ||||
-rw-r--r-- | tests/tget_str.c | 3 | ||||
-rw-r--r-- | tests/tlog.c | 5 | ||||
-rw-r--r-- | tests/tlog2.c | 4 | ||||
-rw-r--r-- | tests/tmul.c | 5 | ||||
-rw-r--r-- | tests/tmul_2exp.c | 20 | ||||
-rw-r--r-- | tests/tmul_ui.c | 5 | ||||
-rw-r--r-- | tests/tout_str.c | 3 | ||||
-rw-r--r-- | tests/tpi.c | 4 | ||||
-rw-r--r-- | tests/tpow.c | 4 | ||||
-rw-r--r-- | tests/trandom.c | 4 | ||||
-rw-r--r-- | tests/tset_d.c | 6 | ||||
-rw-r--r-- | tests/tset_f.c | 5 | ||||
-rw-r--r-- | tests/tset_q.c | 4 | ||||
-rw-r--r-- | tests/tset_si.c | 5 | ||||
-rw-r--r-- | tests/tset_str.c | 3 | ||||
-rw-r--r-- | tests/tset_z.c | 5 | ||||
-rw-r--r-- | tests/tsin_cos.c | 3 | ||||
-rw-r--r-- | tests/tsqrt.c | 4 | ||||
-rw-r--r-- | tests/tsqrt_ui.c | 4 | ||||
-rw-r--r-- | tests/tswap.c | 4 | ||||
-rw-r--r-- | tests/ttrunc.c | 4 | ||||
-rw-r--r-- | tests/tui_div.c | 5 | ||||
-rw-r--r-- | tests/tui_sub.c | 5 |
36 files changed, 107 insertions, 64 deletions
diff --git a/tests/reuse.c b/tests/reuse.c index d8214acb8..4b5647617 100644 --- a/tests/reuse.c +++ b/tests/reuse.c @@ -357,7 +357,8 @@ void test3a (char *foo, mp_prec_t prec, mp_rnd_t rnd) mpfr_clear (res2); } -int main () +int +main (void) { testfunc = mpfr_add; test3 ("mpfr_add", 53, GMP_RNDN); testfunc = mpfr_add_ui; test2ui ("mpfr_add_ui", 53, GMP_RNDN); @@ -382,5 +383,6 @@ int main () testfunc = mpfr_ui_div; testui2 ("mpfr_ui_div", 53, GMP_RNDN); testfunc = mpfr_ui_sub; testui2 ("mpfr_ui_sub", 53, GMP_RNDN); testfunc = mpfr_trunc; test2 ("mpfr_trunc", 53, GMP_RNDN); + return 0; } diff --git a/tests/tabs.c b/tests/tabs.c index 341ea516a..d56385b1b 100644 --- a/tests/tabs.c +++ b/tests/tabs.c @@ -29,7 +29,8 @@ MA 02111-1307, USA. */ extern int isnan(); -int main(int argc, char *argv[]) +int +main (int argc, char *argv[]) { mpfr_t x; int n, k, rnd; double d, dd; #ifdef __mips @@ -85,5 +86,6 @@ int main(int argc, char *argv[]) } mpfr_clear(x); + return 0; } diff --git a/tests/tadd.c b/tests/tadd.c index 562d9b853..c06752146 100644 --- a/tests/tadd.c +++ b/tests/tadd.c @@ -368,7 +368,8 @@ void check_same () #define check53(x, y, r, z) check(x, y, r, 53, 53, 53, z) #define check53nan(x, y, r) checknan(x, y, r, 53, 53, 53); -int main(argc,argv) int argc; char *argv[]; +int +main (int argc, char *argv[]) { int prec, rnd_mode; #ifdef TEST @@ -605,6 +606,6 @@ int main(argc,argv) int argc; char *argv[]; check5(x, rnd); } #endif + return 0; } - diff --git a/tests/tagm.c b/tests/tagm.c index e6c411677..c18d847f6 100644 --- a/tests/tagm.c +++ b/tests/tagm.c @@ -142,7 +142,9 @@ void slave (int N, int p) } -int main(int argc, char* argv[]) { +int +main (int argc, char* argv[]) +{ int N; if (argc==3) { /* tagm N p : N calculus with precision p*/ @@ -178,5 +180,6 @@ int main(int argc, char* argv[]) { } /* TODO : tests des infinis dans tagm.c */ + return 0; } diff --git a/tests/tcan_round.c b/tests/tcan_round.c index 4d5fd0cb5..2717afdd2 100644 --- a/tests/tcan_round.c +++ b/tests/tcan_round.c @@ -24,7 +24,8 @@ MA 02111-1307, USA. */ #include "gmp.h" #include "mpfr.h" -int main() +int +main (void) { mpfr_t x; @@ -41,8 +42,6 @@ int main() fprintf(stderr, "Error in mpfr_can_round\n"); exit(1); } mpfr_clear(x); + return 0; } - - - diff --git a/tests/tcmp.c b/tests/tcmp.c index 3d033314d..3229c3b0f 100644 --- a/tests/tcmp.c +++ b/tests/tcmp.c @@ -31,7 +31,8 @@ MA 02111-1307, USA. */ extern int isnan(); -int main() +int +main (void) { double x, y; mpfr_t xx, yy; @@ -149,5 +150,6 @@ int main() } mpfr_clear(xx); mpfr_clear(yy); + return 0; } diff --git a/tests/tcmp2.c b/tests/tcmp2.c index 4ddb16bea..dc3406f3d 100644 --- a/tests/tcmp2.c +++ b/tests/tcmp2.c @@ -82,7 +82,8 @@ void special () mpfr_clear(x); mpfr_clear(y); } -int main() +int +main (void) { int i,j; double x=1.0, y, z; #ifdef __mips @@ -107,6 +108,6 @@ int main() if (x<y) { z=x; x=y; y=z; } if (y != 0.0 && y != -0.0) tcmp2(x, y, -1); } + return 0; } - diff --git a/tests/tcmp_ui.c b/tests/tcmp_ui.c index ce0eb2ca5..a6f246f02 100644 --- a/tests/tcmp_ui.c +++ b/tests/tcmp_ui.c @@ -25,7 +25,8 @@ MA 02111-1307, USA. */ #include "gmp.h" #include "mpfr.h" -int main() +int +main (void) { mpfr_t x; unsigned long i; long s; @@ -66,5 +67,6 @@ int main() } mpfr_clear(x); + return 0; } diff --git a/tests/tdiv.c b/tests/tdiv.c index b97e5d1b4..b2867826d 100644 --- a/tests/tdiv.c +++ b/tests/tdiv.c @@ -164,7 +164,8 @@ void check_convergence () mpfr_clear(x); mpfr_clear(y); } -int main(int argc, char *argv[]) +int +main (int argc, char *argv[]) { int N; @@ -218,5 +219,6 @@ int main(int argc, char *argv[]) check4(n, d, rand() % 4, 53, 0.0); } #endif + return 0; } diff --git a/tests/tdiv_ui.c b/tests/tdiv_ui.c index df6294793..b579bbb2f 100644 --- a/tests/tdiv_ui.c +++ b/tests/tdiv_ui.c @@ -51,7 +51,7 @@ void check (double d, unsigned long u, mp_rnd_t rnd, double e) } int -main(int argc, char **argv) +main (int argc, char **argv) { mpfr_t x; #ifdef TEST diff --git a/tests/tdump.c b/tests/tdump.c index 17b000496..c6d1daf3f 100644 --- a/tests/tdump.c +++ b/tests/tdump.c @@ -24,7 +24,8 @@ MA 02111-1307, USA. */ #include "gmp.h" #include "mpfr.h" -int main() +int +main (void) { mpfr_t z; @@ -33,6 +34,6 @@ int main() mpfr_dump(z, GMP_RNDD); printf(" ^--- 0.e1 printed above is ok\n"); mpfr_clear(z); + return 0; } - diff --git a/tests/teq.c b/tests/teq.c index b5a3ff6f0..821a69260 100644 --- a/tests/teq.c +++ b/tests/teq.c @@ -60,7 +60,8 @@ void teq (mpfr_t x) mpfr_clear(y); } -int main() +int +main (void) { int j; mpfr_t x; @@ -71,6 +72,6 @@ int main() teq (x); } mpfr_clear (x); + return 0; } - diff --git a/tests/texp.c b/tests/texp.c index a441c2ea7..e306c7ea8 100644 --- a/tests/texp.c +++ b/tests/texp.c @@ -190,7 +190,7 @@ void compare_exp2_exp3 (int n) } int -main(int argc, char **argv) +main (int argc, char *argv[]) { #ifdef TEST int i, N, s=0, e, maxe=0; double d, lo, hi; @@ -256,5 +256,6 @@ main(int argc, char **argv) } if (N) printf("mean error=%1.2e max error=%d\n", (double)s/(double)N,maxe); #endif + return 0; } diff --git a/tests/tget_str.c b/tests/tget_str.c index b2b505b57..0a4041f27 100644 --- a/tests/tget_str.c +++ b/tests/tget_str.c @@ -87,7 +87,7 @@ void check_small () } int -main(int argc, char **argv) +main (int argc, char *argv[]) { #ifdef TEST int i; double d; @@ -107,5 +107,6 @@ main(int argc, char **argv) check3(2.14478198760196000000e+16, GMP_RNDN, "21448"); check3(7.02293374921793516813e-84, GMP_RNDN, "70229"); check3(-6.7274500420134077e-87, GMP_RNDN, "-67275"); + return 0; } diff --git a/tests/tlog.c b/tests/tlog.c index 7c0a32d5f..68263b637 100644 --- a/tests/tlog.c +++ b/tests/tlog.c @@ -256,7 +256,9 @@ void special () mpfr_clear (y); } -int main(int argc, char *argv[]) { +int +main (int argc, char *argv[]) +{ int N=0; srand48(getpid()); @@ -339,5 +341,6 @@ int main(int argc, char *argv[]) { check2(7.34302197248998461006e+43,GMP_RNDZ,1.01004909469513179942e+02); check2(6.09969788341579732815e+00,GMP_RNDD,1.80823924264386204363e+00); } + return 0; } diff --git a/tests/tlog2.c b/tests/tlog2.c index afa730748..e0ea712d5 100644 --- a/tests/tlog2.c +++ b/tests/tlog2.c @@ -25,7 +25,8 @@ MA 02111-1307, USA. */ /* tlog2 [prec] [rnd] [0 = no print] */ -int main(argc, argv) int argc; char *argv[]; +int +main(int argc, char *argv[]) { mpfr_t x; int p; unsigned char rnd; @@ -40,5 +41,6 @@ int main(argc, argv) int argc; char *argv[]; fprintf(stderr, "mpfr_const_log2 failed for prec=53\n"); exit(1); } mpfr_clear(x); + return 0; } diff --git a/tests/tmul.c b/tests/tmul.c index 9af97a998..905f8b240 100644 --- a/tests/tmul.c +++ b/tests/tmul.c @@ -163,7 +163,8 @@ void check_sign () mpfr_clear(a); mpfr_clear(b); } -int main (int argc, char *argv[]) +int +main (int argc, char *argv[]) { #ifdef TEST double x, y, z; int i, prec, rnd_mode; @@ -212,6 +213,6 @@ int main (int argc, char *argv[]) } } #endif + return 0; } - diff --git a/tests/tmul_2exp.c b/tests/tmul_2exp.c index f5b9490c6..20e902fd6 100644 --- a/tests/tmul_2exp.c +++ b/tests/tmul_2exp.c @@ -30,7 +30,7 @@ MA 02111-1307, USA. */ and with mpfr with 53 bits of precision */ int -main(argc,argv) int argc; char *argv[]; +main (int argc, char *argv[]) { double x, z; mpfr_t w; unsigned long k; @@ -52,22 +52,20 @@ main(argc,argv) int argc; char *argv[]; if (x != (z = mpfr_get_d(w)/1024)) { fprintf(stderr, "%f != %f\n", x, z); - return (-1); + return -1; } - + mpfr_set_d(w, x, 0); - mpfr_div_2exp(w, w, 10, GMP_RNDZ); + mpfr_div_2exp(w, w, 10, GMP_RNDZ); if (x != (z = mpfr_get_d(w)*1024)) { - fprintf(stderr, "%f != %f\n", x, z); - mpfr_clear(w); - return (-1); + fprintf(stderr, "%f != %f\n", x, z); + mpfr_clear(w); + return -1; } } - + mpfr_clear(w); - mpfr_clear(w); - return (0); + return 0; } - diff --git a/tests/tmul_ui.c b/tests/tmul_ui.c index e226b35ba..0684ce365 100644 --- a/tests/tmul_ui.c +++ b/tests/tmul_ui.c @@ -26,7 +26,7 @@ MA 02111-1307, USA. */ #include "mpfr-impl.h" int -main(int argc, char **argv) +main (int argc, char *argv[]) { mpfr_t x, y; @@ -104,5 +104,6 @@ main(int argc, char **argv) } mpfr_clear(x); mpfr_clear(y); - return(0); + + return 0; } diff --git a/tests/tout_str.c b/tests/tout_str.c index 2b5cc4c66..868407f3c 100644 --- a/tests/tout_str.c +++ b/tests/tout_str.c @@ -98,7 +98,7 @@ void check_large () } int -main(int argc, char **argv) +main (int argc, char *argv[]) { int i,N=10000,r,p; double d; @@ -132,5 +132,6 @@ main(int argc, char **argv) p = 2 + rand()%35; check(d, r, p); } + return 0; } diff --git a/tests/tpi.c b/tests/tpi.c index 692008ebf..bdaa15e30 100644 --- a/tests/tpi.c +++ b/tests/tpi.c @@ -25,7 +25,8 @@ MA 02111-1307, USA. */ /* tpi [prec] [rnd] [0 = no print] */ -int main(argc, argv) int argc; char *argv[]; +int +main (int argc, char *argv[]) { mpfr_t x; int p; unsigned char rnd; @@ -40,5 +41,6 @@ int main(argc, argv) int argc; char *argv[]; fprintf(stderr, "mpfr_const_pi failed for prec=53\n"); exit(1); } mpfr_clear(x); + return 0; } diff --git a/tests/tpow.c b/tests/tpow.c index 4bad9b73f..c61780330 100644 --- a/tests/tpow.c +++ b/tests/tpow.c @@ -59,8 +59,10 @@ void check_pow_ui () mpfr_clear (b); } -int main () +int +main (void) { check_pow_ui (); + return 0; } diff --git a/tests/trandom.c b/tests/trandom.c index 7229bd46f..c6377457a 100644 --- a/tests/trandom.c +++ b/tests/trandom.c @@ -164,7 +164,8 @@ void test_urandomb (unsigned long nbtests, unsigned long prec, int verbose) return; } -int main (int argc, char **argv) +int +main (int argc, char *argv[]) { unsigned long nbtests, prec; int verbose = 0; @@ -179,4 +180,3 @@ int main (int argc, char **argv) return 0; } - diff --git a/tests/tset_d.c b/tests/tset_d.c index 2ab6eb1b2..3c35305d5 100644 --- a/tests/tset_d.c +++ b/tests/tset_d.c @@ -29,7 +29,7 @@ MA 02111-1307, USA. */ extern int isnan(); int -main (int argc, char **argv) +main (int argc, char *argv[]) { mpfr_t x,y,z; unsigned long k,n; double d, dd; #ifdef __mips @@ -76,10 +76,10 @@ main (int argc, char **argv) "Mismatch on : %1.18g != %1.18g\n", d, mpfr_get_d(x)); mpfr_print_raw(x); putchar('\n'); exit(1); - } + } } mpfr_clear(x); mpfr_clear(y); mpfr_clear(z); + return 0; } - diff --git a/tests/tset_f.c b/tests/tset_f.c index 82b09ad76..ea0106c7c 100644 --- a/tests/tset_f.c +++ b/tests/tset_f.c @@ -30,7 +30,7 @@ MA 02111-1307, USA. */ #endif int -main() +main (void) { mpfr_t x, u; mpf_t y, z; unsigned long k, pr; @@ -77,5 +77,6 @@ main() } mpf_clear(y); mpf_clear(z); - return(0); + + return 0; } diff --git a/tests/tset_q.c b/tests/tset_q.c index d833378cd..7d6890a8c 100644 --- a/tests/tset_q.c +++ b/tests/tset_q.c @@ -48,7 +48,8 @@ void check(long int n, long int d, mp_rnd_t rnd, double y) mpfr_clear(x); mpq_clear(q); } -int main() +int +main (void) { #ifdef TEST long int i, n; @@ -74,5 +75,6 @@ int main() check(75504803, 400207282, GMP_RNDU, 1.8866424074712365155e-1); check(643562308, 23100894, GMP_RNDD, 2.7858762002890447462e1); check(632549085, 1831935802, GMP_RNDN, 3.4528998467600230393e-1); + return 0; } diff --git a/tests/tset_si.c b/tests/tset_si.c index 0d20cbe4c..2922c60b9 100644 --- a/tests/tset_si.c +++ b/tests/tset_si.c @@ -27,7 +27,7 @@ MA 02111-1307, USA. */ #include "time.h" int -main(int argc, char **argv) +main (int argc, char *argv[]) { mpfr_t x; long k, z, d; unsigned long zl, dl, N; @@ -86,5 +86,6 @@ main(int argc, char **argv) } mpfr_clear(x); - return(0); + + return 0; } diff --git a/tests/tset_str.c b/tests/tset_str.c index 5ea2b18d0..7043999a0 100644 --- a/tests/tset_str.c +++ b/tests/tset_str.c @@ -28,7 +28,7 @@ MA 02111-1307, USA. */ #include <time.h> int -main(int argc, char **argv) +main (int argc, char *argv[]) { mpfr_t x, y; unsigned long k, bd, nc, i; char *str, *str2; mp_exp_t e; int base, logbase, prec, baseprec; @@ -140,5 +140,6 @@ main(int argc, char **argv) } mpfr_clear(x); mpfr_clear(y); + return 0; } diff --git a/tests/tset_z.c b/tests/tset_z.c index ae069f38f..80adff1bf 100644 --- a/tests/tset_z.c +++ b/tests/tset_z.c @@ -56,7 +56,8 @@ void check_large () /* tset_z z rnd prec */ -int main(int argc, char *argv[]) +int +main (int argc, char *argv[]) { long j; @@ -65,6 +66,6 @@ int main(int argc, char *argv[]) check(0, 0); for (j=0; j<1000000; j++) check(lrand48(), rand()%4); + return 0; } - diff --git a/tests/tsin_cos.c b/tests/tsin_cos.c index 01c7c395f..5a6b04299 100644 --- a/tests/tsin_cos.c +++ b/tests/tsin_cos.c @@ -111,7 +111,8 @@ void check53cos (double x, double cos_x, mp_rnd_t rnd_mode) } /* tsin_cos prec [N] performs N tests with prec bits */ -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { if (argc > 1) { large_test (atoi (argv[1]), (argc > 2) ? atoi (argv[2]) : 1); diff --git a/tests/tsqrt.c b/tests/tsqrt.c index 940ffbd44..7cd61a0f6 100644 --- a/tests/tsqrt.c +++ b/tests/tsqrt.c @@ -192,7 +192,8 @@ void special () mpfr_clear (z); } -int main() +int +main (void) { double a; #ifdef TEST @@ -280,5 +281,6 @@ int main() check4(a*6703494707970582.0, GMP_RNDD, "1.3853ee10c9c98@13"); check4(a*8010323124937260.0, GMP_RNDD, "1.556abe212b56e@13"); check4(a*2.0*8010776873384260.0, GMP_RNDD, "1.e2d9a51977e6d@13"); + return 0; } diff --git a/tests/tsqrt_ui.c b/tests/tsqrt_ui.c index f803e5317..b1a4628fb 100644 --- a/tests/tsqrt_ui.c +++ b/tests/tsqrt_ui.c @@ -54,7 +54,8 @@ void check (unsigned long a, mp_rnd_t rnd_mode, double Q) mpfr_clear(q); } -int main() +int +main (void) { #ifdef TEST int i; unsigned long a; @@ -75,5 +76,6 @@ int main() #endif check(0, GMP_RNDN, 0.0); check(2116118, GMP_RNDU, 1.45468828276026215e3); + return 0; } diff --git a/tests/tswap.c b/tests/tswap.c index 1cdbcd3ac..ef90cb417 100644 --- a/tests/tswap.c +++ b/tests/tswap.c @@ -22,7 +22,8 @@ MA 02111-1307, USA. */ #include "gmp.h" #include "mpfr.h" -int main() +int +main (void) { mpfr_t u, v; @@ -38,5 +39,6 @@ int main() } mpfr_clear (u); mpfr_clear (v); + return 0; } diff --git a/tests/ttrunc.c b/tests/ttrunc.c index 41987170d..47dce74fe 100644 --- a/tests/ttrunc.c +++ b/tests/ttrunc.c @@ -27,7 +27,8 @@ MA 02111-1307, USA. */ #define SIZEX 100 -int main() +int +main (void) { int j, k; mpfr_t x, y, z, t, y2, z2, t2; @@ -141,4 +142,3 @@ int main() return 0; } - diff --git a/tests/tui_div.c b/tests/tui_div.c index b3e812378..c40698960 100644 --- a/tests/tui_div.c +++ b/tests/tui_div.c @@ -54,7 +54,8 @@ void check (unsigned long y, double x, mp_rnd_t rnd_mode, double z1) mpfr_clear(xx); mpfr_clear(zz); } -int main(argc,argv) int argc; char *argv[]; +int +main (int argc, char *argv[]) { #ifdef TEST double x; unsigned long y, N; int i,rnd_mode,rnd; @@ -93,6 +94,6 @@ int main(argc,argv) int argc; char *argv[]; 1.3178666932321966062e285); check(1476599377, -2.14191393656148625995e+305, GMP_RNDD, -6.8938315017943889615e-297); + return 0; } - diff --git a/tests/tui_sub.c b/tests/tui_sub.c index 9456e7d10..a5747a453 100644 --- a/tests/tui_sub.c +++ b/tests/tui_sub.c @@ -54,7 +54,8 @@ void check (unsigned long y, double x, mp_rnd_t rnd_mode, double z1) mpfr_clear(xx); mpfr_clear(zz); } -int main(argc,argv) int argc; char *argv[]; +int +main (int argc, char *argv[]) { #ifdef TEST double x; unsigned long y, N; int i,rnd_mode,rnd; @@ -94,6 +95,6 @@ int main(argc,argv) int argc; char *argv[]; 1.0849682612928422704e187); check(293607738, -1.9967571564050541e-5, GMP_RNDU, 2.9360773800002003e8); check(354270183, 2.9469161763489528e3, GMP_RNDN, 3.5426723608382362e8); + return 0; } - |