From 0bf808356e0d05245b3e913cdd9bae31954579a0 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Tue, 23 Oct 2012 11:03:32 +0100 Subject: build: avoid compile warnings in factor.c on some systems * src/factor.c (factor_using_pollard_rho2): On some systems (like sparc) we need to promote all addmod2() parameters to uintmax_t to avoid warnings. --- src/factor.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/factor.c b/src/factor.c index 73c59e9b9..539a686e2 100644 --- a/src/factor.c +++ b/src/factor.c @@ -1532,7 +1532,7 @@ factor_using_pollard_rho2 (uintmax_t n1, uintmax_t n0, unsigned long int a, { x0 = mulredc2 (&r1m, x1, x0, x1, x0, n1, n0, ni); x1 = r1m; - addmod2 (x1, x0, x1, x0, 0, a, n1, n0); + addmod2 (x1, x0, x1, x0, 0, (uintmax_t) a, n1, n0); submod2 (t1, t0, z1, z0, x1, x0, n1, n0); P0 = mulredc2 (&r1m, P1, P0, t1, t0, n1, n0, ni); @@ -1555,7 +1555,7 @@ factor_using_pollard_rho2 (uintmax_t n1, uintmax_t n0, unsigned long int a, { x0 = mulredc2 (&r1m, x1, x0, x1, x0, n1, n0, ni); x1 = r1m; - addmod2 (x1, x0, x1, x0, 0, a, n1, n0); + addmod2 (x1, x0, x1, x0, 0, (uintmax_t) a, n1, n0); } y1 = x1; y0 = x0; } @@ -1565,7 +1565,7 @@ factor_using_pollard_rho2 (uintmax_t n1, uintmax_t n0, unsigned long int a, { y0 = mulredc2 (&r1m, y1, y0, y1, y0, n1, n0, ni); y1 = r1m; - addmod2 (y1, y0, y1, y0, 0, a, n1, n0); + addmod2 (y1, y0, y1, y0, 0, (uintmax_t) a, n1, n0); submod2 (t1, t0, z1, z0, y1, y0, n1, n0); g0 = gcd2_odd (&g1, t1, t0, n1, n0); -- cgit v1.2.3-70-g09d2