Merge pull request #365 from fperrad/20191010_lint some linting
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
diff --git a/bn_mp_to_ubin.c b/bn_mp_to_ubin.c
index 5e4a5da..1681ca7 100644
--- a/bn_mp_to_ubin.c
+++ b/bn_mp_to_ubin.c
@@ -19,7 +19,7 @@ mp_err mp_to_ubin(const mp_int *a, unsigned char *buf, size_t maxlen, size_t *wr
return err;
}
- for (x = count; x --> 0;) {
+ for (x = count; x --> 0u;) {
#ifndef MP_8BIT
buf[x] = (unsigned char)(t.dp[0] & 255u);
#else
diff --git a/tommath.h b/tommath.h
index 1e0192b..a8ad230 100644
--- a/tommath.h
+++ b/tommath.h
@@ -385,8 +385,8 @@ mp_err mp_unpack(mp_int *rop, size_t count, mp_order order, size_t size, mp_endi
/* pack binary data */
size_t mp_pack_count(const mp_int *a, size_t nails, size_t size) MP_WUR;
-mp_err mp_pack(void *rop, size_t maxcount, size_t *writtencount, mp_order order, size_t size, mp_endian endian,
- size_t nails, const mp_int *op) MP_WUR;
+mp_err mp_pack(void *rop, size_t maxcount, size_t *written, mp_order order, size_t size,
+ mp_endian endian, size_t nails, const mp_int *op) MP_WUR;
/* ---> digit manipulation <--- */
diff --git a/tommath_private.h b/tommath_private.h
index 869f613..7c167a5 100644
--- a/tommath_private.h
+++ b/tommath_private.h
@@ -240,7 +240,7 @@ MP_DEPRECATED(s_mp_reverse) void bn_reverse(unsigned char *s, int len);
do{\
int16_t n = 0x1; \
char *p = (char *)&n; \
- x = (p[0] == 1) ? MP_LITTLE_ENDIAN : MP_BIG_ENDIAN; \
+ x = (p[0] == '\x01') ? MP_LITTLE_ENDIAN : MP_BIG_ENDIAN; \
} while (0)
/* code-generating macros */