use unsigned literal
This commit is contained in:
parent
81d5f0e39a
commit
a0b8ce68f7
@ -208,8 +208,8 @@ int mp_init_size(mp_int *a, int size);
|
||||
|
||||
/* ---> Basic Manipulations <--- */
|
||||
#define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
|
||||
#define mp_iseven(a) ((((a)->used > 0) && (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
|
||||
#define mp_isodd(a) ((((a)->used > 0) && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
|
||||
#define mp_iseven(a) ((((a)->used > 0) && (((a)->dp[0] & 1u) == 0u)) ? MP_YES : MP_NO)
|
||||
#define mp_isodd(a) ((((a)->used > 0) && (((a)->dp[0] & 1u) == 1u)) ? MP_YES : MP_NO)
|
||||
#define mp_isneg(a) (((a)->sign != MP_ZPOS) ? MP_YES : MP_NO)
|
||||
|
||||
/* set to zero */
|
||||
|
@ -88,14 +88,14 @@ int func_name (mp_int * a, type b) \
|
||||
mp_zero (a); \
|
||||
\
|
||||
/* set four bits at a time */ \
|
||||
for (x = 0; x < (sizeof(type) * 2); x++) { \
|
||||
for (x = 0; x < (sizeof(type) * 2u); x++) { \
|
||||
/* shift the number up four bits */ \
|
||||
if ((res = mp_mul_2d (a, 4, a)) != MP_OKAY) { \
|
||||
return res; \
|
||||
} \
|
||||
\
|
||||
/* OR in the top four bits of the source */ \
|
||||
a->dp[0] |= (b >> ((sizeof(type) * 8) - 4)) & 15; \
|
||||
a->dp[0] |= (b >> ((sizeof(type) * 8u) - 4u)) & 15u; \
|
||||
\
|
||||
/* shift the source up to the next four bits */ \
|
||||
b <<= 4; \
|
||||
|
Loading…
Reference in New Issue
Block a user