Skip to content

Commit b3a4341

Browse files
committed
explicit operator precedence
1 parent 2b41c95 commit b3a4341

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

bn_conversion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#define MP_SET_SIGNED(name, uname, w) \
2121
void name(mp_int * a, int##w##_t b) \
2222
{ \
23-
uname(a, b < 0 ? -(uint##w##_t)b : (uint##w##_t)b); \
23+
uname(a, (b < 0) ? -(uint##w##_t)b : (uint##w##_t)b); \
2424
if (b < 0) { a->sign = MP_NEG; } \
2525
}
2626
#define MP_INIT_INT(name , set, type) \
@@ -49,7 +49,7 @@
4949
int##w##_t name(const mp_int* a) \
5050
{ \
5151
uint64_t res = mag(a); \
52-
return a->sign == MP_NEG ? (int##w##_t)-res : (int##w##_t)res; \
52+
return (a->sign == MP_NEG) ? (int##w##_t)-res : (int##w##_t)res;\
5353
}
5454

5555
#ifdef BN_MP_SET_U32_C

bn_deprecated.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ unsigned long mp_get_int(const mp_int *a)
176176
#ifdef BN_MP_GET_LONG_C
177177
unsigned long mp_get_long(const mp_int *a)
178178
{
179-
return sizeof(long) > sizeof(int32_t) ? (unsigned long)mp_get_mag64(a) : (unsigned long)mp_get_mag32(a);
179+
return (sizeof(long) > sizeof(int32_t)) ? (unsigned long)mp_get_mag64(a) : (unsigned long)mp_get_mag32(a);
180180
}
181181
#endif
182182
#ifdef BN_MP_GET_LONG_LONG_C

0 commit comments

Comments
 (0)