literal suffix
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
diff --git a/bn_mp_div_d.c b/bn_mp_div_d.c
index 33bee91..b9d718b 100644
--- a/bn_mp_div_d.c
+++ b/bn_mp_div_d.c
@@ -29,7 +29,7 @@ mp_err mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d)
}
/* power of two ? */
- if ((b & (b-1)) == 0u) {
+ if ((b & (b - 1u)) == 0u) {
ix = 1;
while ((ix < MP_DIGIT_BIT) && (b != (((mp_digit)1)<<ix))) {
ix++;
diff --git a/bn_mp_to_radix.c b/bn_mp_to_radix.c
index 6e99777..6b03ee7 100644
--- a/bn_mp_to_radix.c
+++ b/bn_mp_to_radix.c
@@ -16,7 +16,7 @@ mp_err mp_to_radix(const mp_int *a, char *str, size_t maxlen, int radix)
char *_s = str;
/* check range of the maxlen, radix */
- if ((maxlen < 2) || (radix < 2) || (radix > 64)) {
+ if ((maxlen < 2u) || (radix < 2) || (radix > 64)) {
return MP_VAL;
}
@@ -46,7 +46,7 @@ mp_err mp_to_radix(const mp_int *a, char *str, size_t maxlen, int radix)
digs = 0;
while (!MP_IS_ZERO(&t)) {
- if (--maxlen < 1) {
+ if (--maxlen < 1u) {
/* no more room */
err = MP_VAL;
break;
diff --git a/tommath_private.h b/tommath_private.h
index 4c25fa0..b565042 100644
--- a/tommath_private.h
+++ b/tommath_private.h
@@ -143,7 +143,7 @@ extern void MP_FREE(void *mem, size_t size);
/* feature detection macro */
#define MP_STRINGIZE(x) MP__STRINGIZE(x)
#define MP__STRINGIZE(x) ""#x""
-#define MP_HAS(x) (sizeof(MP_STRINGIZE(BN_##x##_C)) == 1)
+#define MP_HAS(x) (sizeof(MP_STRINGIZE(BN_##x##_C)) == 1u)
/* TODO: Remove private_mp_word as soon as deprecated mp_word is removed from tommath. */
#undef mp_word