From 06b398489e312050bc13ef6ddaca52e77a8b119b Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 14 Mar 2016 22:52:52 +0000 Subject: [PATCH] py/parsenum: Fix compiler warnings for no decl and signed comparison. --- py/parsenum.c | 2 +- py/parsenumbase.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/py/parsenum.c b/py/parsenum.c index c73ae54a16..0915098d6b 100644 --- a/py/parsenum.c +++ b/py/parsenum.c @@ -81,7 +81,7 @@ mp_obj_t mp_parse_num_integer(const char *restrict str_, size_t len, int base, m for (; str < top; str++) { // get next digit as a value mp_uint_t dig = *str; - if (unichar_isdigit(dig) && dig - '0' < base) { + if (unichar_isdigit(dig) && (int)dig - '0' < base) { // 0-9 digit dig = dig - '0'; } else if (base == 16) { diff --git a/py/parsenumbase.c b/py/parsenumbase.c index 8d057af187..73a3372f0a 100644 --- a/py/parsenumbase.c +++ b/py/parsenumbase.c @@ -24,7 +24,9 @@ * THE SOFTWARE. */ -#include "py/parsenum.h" +#include "py/mpconfig.h" +#include "py/misc.h" +#include "py/parsenumbase.h" // find real radix base, and strip preceding '0x', '0o' and '0b' // puts base in *base, and returns number of bytes to skip the prefix