Skip to content

Commit 6d63370

Browse files
committed
explicit operator precedence
1 parent 3841062 commit 6d63370

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

bn_mp_read_radix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* SPDX-License-Identifier: Unlicense
1313
*/
1414

15-
#define MP_TOUPPER(c) ((c) >= 'a' && (c) <= 'z' ? (c) + 'A' - 'a' : (c))
15+
#define MP_TOUPPER(c) ((((c) >= 'a') && ((c) <= 'z')) ? (((c) + 'A') - 'a') : (c))
1616

1717
/* read a string [ASCII] in a given radix */
1818
int mp_read_radix(mp_int *a, const char *str, int radix)

tommath_private.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ extern const size_t mp_s_rmap_reverse_sz;
9090
int func_name (mp_int * a, type b) \
9191
{ \
9292
int x = 0; \
93-
int res = mp_grow(a, (CHAR_BIT * sizeof(type) + DIGIT_BIT - 1) / DIGIT_BIT); \
93+
int new_size = (((CHAR_BIT * sizeof(type)) + DIGIT_BIT) - 1) / DIGIT_BIT; \
94+
int res = mp_grow(a, new_size); \
9495
if (res == MP_OKAY) { \
9596
mp_zero(a); \
9697
while (b) { \

0 commit comments

Comments
 (0)