summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2012-10-23 11:03:32 +0100
committerPádraig Brady <P@draigBrady.com>2012-10-23 13:03:08 +0100
commit0bf808356e0d05245b3e913cdd9bae31954579a0 (patch)
tree7dc3cbcda74ebb1d2c153fbec948f834be949eb2 /src
parent585c9873677670cec89af0514920c33b2fbf7804 (diff)
downloadcoreutils-0bf808356e0d05245b3e913cdd9bae31954579a0.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/factor.c6
1 files changed, 3 insertions, 3 deletions
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);