File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 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 */
1818int mp_read_radix (mp_int * a , const char * str , int radix )
Original file line number Diff line number Diff line change @@ -90,10 +90,11 @@ extern const size_t mp_s_rmap_reverse_sz;
9090int 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); \
96- while (b) { \
97+ while (b != 0u) { \
9798 a->dp[x++] = ((mp_digit)b & MP_MASK); \
9899 b >>= DIGIT_BIT; \
99100 } \
You can’t perform that action at this time.
0 commit comments