Skip to content

Commit 96ece82

Browse files
authored
Merge pull request #215 from fperrad/20190409_lint
some linting
2 parents 2033fb9 + 42193f8 commit 96ece82

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

bn_mp_balance_mul.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ int mp_balance_mul(const mp_int *a, const mp_int *b, mp_int *c)
1414

1515
nblocks = MAX(a->used, b->used) / MIN(a->used, b->used);
1616
bsize = MIN(a->used, b->used) ;
17-
e = MP_OKAY;
1817

1918
if ((e = mp_init_size(&a0, bsize + 2)) != MP_OKAY) {
2019
return e;

bn_mp_decr.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ int mp_decr(mp_int *a)
2323
return MP_OKAY;
2424
} else if (a->dp[0] > 1uL) {
2525
a->dp[0]--;
26-
if (a->dp[0] == 0) {
26+
if (a->dp[0] == 0u) {
2727
mp_zero(a);
2828
}
2929
return MP_OKAY;
30+
} else {
31+
return mp_sub_d(a, 1uL,a);
3032
}
31-
return mp_sub_d(a, 1uL,a);
3233
}
3334
#endif

bn_mp_incr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ int mp_incr(mp_int *a)
2323
} else if (a->dp[0] < MP_MASK) {
2424
a->dp[0]++;
2525
return MP_OKAY;
26+
} else {
27+
return mp_add_d(a, 1uL,a);
2628
}
27-
return mp_add_d(a, 1uL,a);
2829
}
2930
#endif

bn_mp_mul.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ int mp_mul(const mp_int *a, const mp_int *b, mp_int *c)
2727
* was actually slower on the author's machine, but YMMV.
2828
*/
2929
if ((MIN(len_a, len_b) < KARATSUBA_MUL_CUTOFF)
30-
|| ((MAX(len_a, len_b)) / 2 < KARATSUBA_MUL_CUTOFF)) {
30+
|| ((MAX(len_a, len_b) / 2) < KARATSUBA_MUL_CUTOFF)) {
3131
goto GO_ON;
3232
}
3333
/*

tommath_private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ int func_name (mp_int * a, type b) \
8080
while (b != 0u) { \
8181
a->dp[x++] = ((mp_digit)b & MP_MASK); \
8282
if ((CHAR_BIT * sizeof (b)) <= DIGIT_BIT) { break; } \
83-
b >>= ((CHAR_BIT * sizeof (b)) <= DIGIT_BIT ? 0 : DIGIT_BIT); \
83+
b >>= (((CHAR_BIT * sizeof (b)) <= DIGIT_BIT) ? 0 : DIGIT_BIT); \
8484
} \
8585
a->used = x; \
8686
} \

0 commit comments

Comments
 (0)