explicit operator precedence

This commit is contained in:
Francois Perrad 2019-03-26 18:51:35 +01:00
parent 3841062016
commit 6d63370370
2 changed files with 3 additions and 2 deletions

View File

@ -12,7 +12,7 @@
* SPDX-License-Identifier: Unlicense
*/
#define MP_TOUPPER(c) ((c) >= 'a' && (c) <= 'z' ? (c) + 'A' - 'a' : (c))
#define MP_TOUPPER(c) ((((c) >= 'a') && ((c) <= 'z')) ? (((c) + 'A') - 'a') : (c))
/* read a string [ASCII] in a given radix */
int mp_read_radix(mp_int *a, const char *str, int radix)

View File

@ -90,7 +90,8 @@ extern const size_t mp_s_rmap_reverse_sz;
int func_name (mp_int * a, type b) \
{ \
int x = 0; \
int res = mp_grow(a, (CHAR_BIT * sizeof(type) + DIGIT_BIT - 1) / DIGIT_BIT); \
int new_size = (((CHAR_BIT * sizeof(type)) + DIGIT_BIT) - 1) / DIGIT_BIT; \
int res = mp_grow(a, new_size); \
if (res == MP_OKAY) { \
mp_zero(a); \
while (b) { \