py: Convert [u]int to mp_[u]int_t where appropriate.

Addressing issue #50.
This commit is contained in:
Damien George
2014-10-03 17:44:14 +00:00
parent 877dba3e1a
commit 42f3de924b
25 changed files with 58 additions and 80 deletions

View File

@@ -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;
}