diff options
author | Damien George <damien.p.george@gmail.com> | 2015-01-16 17:47:07 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-01-16 17:47:07 +0000 |
commit | 963a5a3e82ded7ee75adae72ae7cb14796fa150e (patch) | |
tree | 78402c85b98c1c8f1889d7af7dc6f4828a8f55a5 /py/showbc.c | |
parent | f12ea7c7ed1ef97ee48c4356dbbc808cc2bdee4a (diff) | |
download | micropython-963a5a3e82ded7ee75adae72ae7cb14796fa150e.tar.gz micropython-963a5a3e82ded7ee75adae72ae7cb14796fa150e.zip |
py, unix: Allow to compile with -Wsign-compare.
See issue #699.
Diffstat (limited to 'py/showbc.c')
-rw-r--r-- | py/showbc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/showbc.c b/py/showbc.c index 7c55d8cc83..51a1671f69 100644 --- a/py/showbc.c +++ b/py/showbc.c @@ -81,7 +81,7 @@ void mp_bytecode_print(const void *descr, mp_uint_t n_total_args, const byte *ip // bytecode prelude: arg names (as qstr objects) printf("arg names:"); - for (int i = 0; i < n_total_args; i++) { + for (mp_uint_t i = 0; i < n_total_args; i++) { printf(" %s", qstr_str(MP_OBJ_QSTR_VALUE(*(mp_obj_t*)ip))); ip += sizeof(mp_obj_t); } @@ -539,7 +539,7 @@ const byte *mp_bytecode_print_str(const byte *ip) { void mp_bytecode_print2(const byte *ip, mp_uint_t len) { mp_showbc_code_start = ip; - while (ip - mp_showbc_code_start < len) { + while (ip < len + mp_showbc_code_start) { printf("%02u ", (uint)(ip - mp_showbc_code_start)); ip = mp_bytecode_print_str(ip); printf("\n"); |