From d576512c349b7bba4b9f7172f0a188ae756cdb51 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 14 Feb 2014 11:33:38 +0100 Subject: [PATCH] mp_balance_mul: fix compiler warnings --- bn_mp_balance_mul.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/bn_mp_balance_mul.c b/bn_mp_balance_mul.c index dcbb933..17ddedf 100644 --- a/bn_mp_balance_mul.c +++ b/bn_mp_balance_mul.c @@ -26,12 +26,12 @@ int mp_balance_mul (mp_int * a, mp_int * b, mp_int * c) * Ruby core; namely, function 'bigmul1_balance' * from 'bignum.c' */ - mp_int t1, t2, tmp; + mp_int t1, t2; long i, an, bn, r, n; - int res, olduse, min, max; + int res, min, max; int err = MP_MEM; - mp_digit *bds, *cds, *t1ds; + mp_digit *bds, *t1ds; an = a->used; bn = b->used; @@ -44,7 +44,6 @@ int mp_balance_mul (mp_int * a, mp_int * b, mp_int * c) } bds = b->dp; - cds = c->dp; t1ds = t1.dp; n = 0; @@ -70,17 +69,17 @@ int mp_balance_mul (mp_int * a, mp_int * b, mp_int * c) } register mp_digit u, *tmpx, *tmpt2, *tmpcn; - register int i; + register int j; tmpx = tmpcn = x.dp; tmpt2 = t2.dp; u = 0; - for (i = 0; i < min; i++) { + for (j = 0; j < min; j++) { *tmpcn = *tmpx++ + *tmpt2++ + u; u = *tmpcn >> ((mp_digit)DIGIT_BIT); *tmpcn++ &= MP_MASK; } if (min != max) { - for (; i < max; i++) { - *tmpcn = x.dp[i] + u; + for (; j < max; j++) { + *tmpcn = x.dp[j] + u; u = *tmpcn >> ((mp_digit)DIGIT_BIT); *tmpcn++ &= MP_MASK; }