diff options
author | Damien George <damien.p.george@gmail.com> | 2014-10-03 17:44:14 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-10-03 17:44:14 +0000 |
commit | 42f3de924bc3e285490f5f293955bc6d7e5a0edf (patch) | |
tree | c33a59825957ca5561bb7bb5038575ff052d5245 /py/showbc.c | |
parent | 877dba3e1a76d151c0d93c88bcfaac62ecfe3799 (diff) |
py: Convert [u]int to mp_[u]int_t where appropriate.
Addressing issue #50.
Diffstat (limited to 'py/showbc.c')
-rw-r--r-- | py/showbc.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/py/showbc.c b/py/showbc.c index 67c5d7ade..c25cec85d 100644 --- a/py/showbc.c +++ b/py/showbc.c @@ -57,9 +57,7 @@ ip += sizeof(mp_uint_t); \ } while (0) -void mp_bytecode_print2(const byte *ip, int len); - -void mp_bytecode_print(const void *descr, const byte *ip, int len) { +void mp_bytecode_print(const void *descr, const byte *ip, mp_uint_t len) { const byte *ip_start = ip; // get code info size @@ -115,14 +113,13 @@ void mp_bytecode_print(const void *descr, const byte *ip, int len) { mp_bytecode_print2(ip, len - 0); } -void mp_bytecode_print2(const byte *ip, int len) { +void mp_bytecode_print2(const byte *ip, mp_uint_t len) { const byte *ip_start = ip; mp_uint_t unum; qstr qstr; while (ip - ip_start < len) { printf("%02u ", (uint)(ip - ip_start)); - int op = *ip++; - switch (op) { + switch (*ip++) { case MP_BC_LOAD_CONST_FALSE: printf("LOAD_CONST_FALSE"); break; @@ -520,7 +517,7 @@ void mp_bytecode_print2(const byte *ip, int len) { break; default: - printf("code %p, byte code 0x%02x not implemented\n", ip, op); + printf("code %p, byte code 0x%02x not implemented\n", ip, ip[-1]); assert(0); return; } |