Commit 50912e7f authored by Damien George's avatar Damien George
Browse files

py, unix, stmhal: Allow to compile with -Wshadow.

See issue #699.
parent 640e0b22
...@@ -84,7 +84,7 @@ void mp_arg_parse_all(mp_uint_t n_pos, const mp_obj_t *pos, mp_map_t *kws, mp_ui ...@@ -84,7 +84,7 @@ void mp_arg_parse_all(mp_uint_t n_pos, const mp_obj_t *pos, mp_map_t *kws, mp_ui
pos_found++; pos_found++;
given_arg = pos[i]; given_arg = pos[i];
} else { } else {
mp_map_elem_t *kw = mp_map_lookup(kws, MP_OBJ_NEW_QSTR(allowed[i].qstr), MP_MAP_LOOKUP); mp_map_elem_t *kw = mp_map_lookup(kws, MP_OBJ_NEW_QSTR(allowed[i].qst), MP_MAP_LOOKUP);
if (kw == NULL) { if (kw == NULL) {
if (allowed[i].flags & MP_ARG_REQUIRED) { if (allowed[i].flags & MP_ARG_REQUIRED) {
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
...@@ -92,7 +92,7 @@ void mp_arg_parse_all(mp_uint_t n_pos, const mp_obj_t *pos, mp_map_t *kws, mp_ui ...@@ -92,7 +92,7 @@ void mp_arg_parse_all(mp_uint_t n_pos, const mp_obj_t *pos, mp_map_t *kws, mp_ui
} else { } else {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError,
"'%s' argument required", "'%s' argument required",
qstr_str(allowed[i].qstr))); qstr_str(allowed[i].qst)));
} }
} }
out_vals[i] = allowed[i].defval; out_vals[i] = allowed[i].defval;
......
...@@ -1229,9 +1229,9 @@ STATIC void compile_decorated(compiler_t *comp, mp_parse_node_struct_t *pns) { ...@@ -1229,9 +1229,9 @@ STATIC void compile_decorated(compiler_t *comp, mp_parse_node_struct_t *pns) {
// compile the decorator function // compile the decorator function
compile_node(comp, name_nodes[0]); compile_node(comp, name_nodes[0]);
for (int i = 1; i < name_len; i++) { for (int j = 1; j < name_len; j++) {
assert(MP_PARSE_NODE_IS_ID(name_nodes[i])); // should be assert(MP_PARSE_NODE_IS_ID(name_nodes[j])); // should be
EMIT_ARG(load_attr, MP_PARSE_NODE_LEAF_ARG(name_nodes[i])); EMIT_ARG(load_attr, MP_PARSE_NODE_LEAF_ARG(name_nodes[j]));
} }
// nodes[1] contains arguments to the decorator function, if any // nodes[1] contains arguments to the decorator function, if any
...@@ -2778,9 +2778,9 @@ STATIC void compile_atom_brace(compiler_t *comp, mp_parse_node_struct_t *pns) { ...@@ -2778,9 +2778,9 @@ STATIC void compile_atom_brace(compiler_t *comp, mp_parse_node_struct_t *pns) {
// process rest of elements // process rest of elements
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
mp_parse_node_t pn = nodes[i]; mp_parse_node_t pn_i = nodes[i];
bool is_key_value = MP_PARSE_NODE_IS_STRUCT_KIND(pn, PN_dictorsetmaker_item); bool is_key_value = MP_PARSE_NODE_IS_STRUCT_KIND(pn_i, PN_dictorsetmaker_item);
compile_node(comp, pn); compile_node(comp, pn_i);
if (is_dict) { if (is_dict) {
if (!is_key_value) { if (!is_key_value) {
compile_syntax_error(comp, (mp_parse_node_t)pns, "expecting key:value for dictionary"); compile_syntax_error(comp, (mp_parse_node_t)pns, "expecting key:value for dictionary");
...@@ -3489,12 +3489,12 @@ STATIC void compile_scope_inline_asm(compiler_t *comp, scope_t *scope, pass_kind ...@@ -3489,12 +3489,12 @@ STATIC void compile_scope_inline_asm(compiler_t *comp, scope_t *scope, pass_kind
} }
if (pass > MP_PASS_SCOPE) { if (pass > MP_PASS_SCOPE) {
mp_int_t bytesize = MP_PARSE_NODE_LEAF_SMALL_INT(pn_arg[0]); mp_int_t bytesize = MP_PARSE_NODE_LEAF_SMALL_INT(pn_arg[0]);
for (uint i = 1; i < n_args; i++) { for (uint j = 1; j < n_args; j++) {
if (!MP_PARSE_NODE_IS_SMALL_INT(pn_arg[i])) { if (!MP_PARSE_NODE_IS_SMALL_INT(pn_arg[j])) {
compile_syntax_error(comp, nodes[i], "inline assembler 'data' requires integer arguments"); compile_syntax_error(comp, nodes[i], "inline assembler 'data' requires integer arguments");
return; return;
} }
EMIT_INLINE_ASM_ARG(data, bytesize, MP_PARSE_NODE_LEAF_SMALL_INT(pn_arg[i])); EMIT_INLINE_ASM_ARG(data, bytesize, MP_PARSE_NODE_LEAF_SMALL_INT(pn_arg[j]));
} }
} }
} else { } else {
......
...@@ -215,6 +215,6 @@ mp_obj_t mp_module_get(qstr module_name) { ...@@ -215,6 +215,6 @@ mp_obj_t mp_module_get(qstr module_name) {
return el->value; return el->value;
} }
void mp_module_register(qstr qstr, mp_obj_t module) { void mp_module_register(qstr qst, mp_obj_t module) {
mp_map_lookup(&MP_STATE_VM(mp_loaded_modules_map), MP_OBJ_NEW_QSTR(qstr), MP_MAP_LOOKUP_ADD_IF_NOT_FOUND)->value = module; mp_map_lookup(&MP_STATE_VM(mp_loaded_modules_map), MP_OBJ_NEW_QSTR(qst), MP_MAP_LOOKUP_ADD_IF_NOT_FOUND)->value = module;
} }
...@@ -1243,15 +1243,15 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa ...@@ -1243,15 +1243,15 @@ mp_obj_t mp_obj_str_format(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwa
break; break;
case 's': { case 's': {
mp_uint_t len; mp_uint_t slen;
const char *s = mp_obj_str_get_data(arg, &len); const char *s = mp_obj_str_get_data(arg, &slen);
if (precision < 0) { if (precision < 0) {
precision = len; precision = slen;
} }
if (len > (mp_uint_t)precision) { if (slen > (mp_uint_t)precision) {
len = precision; slen = precision;
} }
pfenv_print_strn(&pfenv_vstr, s, len, flags, fill, width); pfenv_print_strn(&pfenv_vstr, s, slen, flags, fill, width);
break; break;
} }
...@@ -1379,9 +1379,9 @@ not_enough_args: ...@@ -1379,9 +1379,9 @@ not_enough_args:
switch (*str) { switch (*str) {
case 'c': case 'c':
if (MP_OBJ_IS_STR(arg)) { if (MP_OBJ_IS_STR(arg)) {
mp_uint_t len; mp_uint_t slen;
const char *s = mp_obj_str_get_data(arg, &len); const char *s = mp_obj_str_get_data(arg, &slen);
if (len != 1) { if (slen != 1) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError,
"%%c requires int or char")); "%%c requires int or char"));
} }
...@@ -1425,14 +1425,14 @@ not_enough_args: ...@@ -1425,14 +1425,14 @@ not_enough_args:
vstr_t *arg_vstr = vstr_new(); vstr_t *arg_vstr = vstr_new();
mp_obj_print_helper((void (*)(void*, const char*, ...))vstr_printf, mp_obj_print_helper((void (*)(void*, const char*, ...))vstr_printf,
arg_vstr, arg, *str == 'r' ? PRINT_REPR : PRINT_STR); arg_vstr, arg, *str == 'r' ? PRINT_REPR : PRINT_STR);
uint len = vstr_len(arg_vstr); uint vlen = vstr_len(arg_vstr);
if (prec < 0) { if (prec < 0) {
prec = len; prec = vlen;
} }
if (len > (uint)prec) { if (vlen > (uint)prec) {
len = prec; vlen = prec;
} }
pfenv_print_strn(&pfenv_vstr, vstr_str(arg_vstr), len, flags, ' ', width); pfenv_print_strn(&pfenv_vstr, vstr_str(arg_vstr), vlen, flags, ' ', width);
vstr_free(arg_vstr); vstr_free(arg_vstr);
break; break;
} }
......
...@@ -273,12 +273,12 @@ STATIC void push_result_node(parser_t *parser, mp_parse_node_t pn) { ...@@ -273,12 +273,12 @@ STATIC void push_result_node(parser_t *parser, mp_parse_node_t pn) {
return; return;
} }
if (parser->result_stack_top >= parser->result_stack_alloc) { if (parser->result_stack_top >= parser->result_stack_alloc) {
mp_parse_node_t *pn = m_renew_maybe(mp_parse_node_t, parser->result_stack, parser->result_stack_alloc, parser->result_stack_alloc + MICROPY_ALLOC_PARSE_RESULT_INC); mp_parse_node_t *stack = m_renew_maybe(mp_parse_node_t, parser->result_stack, parser->result_stack_alloc, parser->result_stack_alloc + MICROPY_ALLOC_PARSE_RESULT_INC);
if (pn == NULL) { if (stack == NULL) {
memory_error(parser); memory_error(parser);
return; return;
} }
parser->result_stack = pn; parser->result_stack = stack;
parser->result_stack_alloc += MICROPY_ALLOC_PARSE_RESULT_INC; parser->result_stack_alloc += MICROPY_ALLOC_PARSE_RESULT_INC;
} }
parser->result_stack[parser->result_stack_top++] = pn; parser->result_stack[parser->result_stack_top++] = pn;
......
...@@ -104,67 +104,67 @@ void mp_deinit(void) { ...@@ -104,67 +104,67 @@ void mp_deinit(void) {
#endif #endif
} }
mp_obj_t mp_load_const_int(qstr qstr) { mp_obj_t mp_load_const_int(qstr qst) {
DEBUG_OP_printf("load '%s'\n", qstr_str(qstr)); DEBUG_OP_printf("load '%s'\n", qstr_str(qst));
mp_uint_t len; mp_uint_t len;
const byte* data = qstr_data(qstr, &len); const byte* data = qstr_data(qst, &len);
return mp_parse_num_integer((const char*)data, len, 0); return mp_parse_num_integer((const char*)data, len, 0);
} }
mp_obj_t mp_load_const_dec(qstr qstr) { mp_obj_t mp_load_const_dec(qstr qst) {
DEBUG_OP_printf("load '%s'\n", qstr_str(qstr)); DEBUG_OP_printf("load '%s'\n", qstr_str(qst));
mp_uint_t len; mp_uint_t len;
const byte* data = qstr_data(qstr, &len); const byte* data = qstr_data(qst, &len);
return mp_parse_num_decimal((const char*)data, len, true, false); return mp_parse_num_decimal((const char*)data, len, true, false);
} }
mp_obj_t mp_load_const_str(qstr qstr) { mp_obj_t mp_load_const_str(qstr qst) {
DEBUG_OP_printf("load '%s'\n", qstr_str(qstr)); DEBUG_OP_printf("load '%s'\n", qstr_str(qst));
return MP_OBJ_NEW_QSTR(qstr); return MP_OBJ_NEW_QSTR(qst);
} }
mp_obj_t mp_load_const_bytes(qstr qstr) { mp_obj_t mp_load_const_bytes(qstr qst) {
DEBUG_OP_printf("load b'%s'\n", qstr_str(qstr)); DEBUG_OP_printf("load b'%s'\n", qstr_str(qst));
mp_uint_t len; mp_uint_t len;
const byte *data = qstr_data(qstr, &len); const byte *data = qstr_data(qst, &len);
return mp_obj_new_bytes(data, len); return mp_obj_new_bytes(data, len);
} }
mp_obj_t mp_load_name(qstr qstr) { mp_obj_t mp_load_name(qstr qst) {
// logic: search locals, globals, builtins // logic: search locals, globals, builtins
DEBUG_OP_printf("load name %s\n", qstr_str(qstr)); DEBUG_OP_printf("load name %s\n", qstr_str(qst));
// If we're at the outer scope (locals == globals), dispatch to load_global right away // If we're at the outer scope (locals == globals), dispatch to load_global right away
if (MP_STATE_CTX(dict_locals) != MP_STATE_CTX(dict_globals)) { if (MP_STATE_CTX(dict_locals) != MP_STATE_CTX(dict_globals)) {
mp_map_elem_t *elem = mp_map_lookup(&MP_STATE_CTX(dict_locals)->map, MP_OBJ_NEW_QSTR(qstr), MP_MAP_LOOKUP); mp_map_elem_t *elem = mp_map_lookup(&MP_STATE_CTX(dict_locals)->map, MP_OBJ_NEW_QSTR(qst), MP_MAP_LOOKUP);
if (elem != NULL) { if (elem != NULL) {
return elem->value; return elem->value;
} }
} }
return mp_load_global(qstr); return mp_load_global(qst);
} }
mp_obj_t mp_load_global(qstr qstr) { mp_obj_t mp_load_global(qstr qst) {
// logic: search globals, builtins // logic: search globals, builtins
DEBUG_OP_printf("load global %s\n", qstr_str(qstr)); DEBUG_OP_printf("load global %s\n", qstr_str(qst));
mp_map_elem_t *elem = mp_map_lookup(&MP_STATE_CTX(dict_globals)->map, MP_OBJ_NEW_QSTR(qstr), MP_MAP_LOOKUP); mp_map_elem_t *elem = mp_map_lookup(&MP_STATE_CTX(dict_globals)->map, MP_OBJ_NEW_QSTR(qst), MP_MAP_LOOKUP);
if (elem == NULL) { if (elem == NULL) {
#if MICROPY_CAN_OVERRIDE_BUILTINS #if MICROPY_CAN_OVERRIDE_BUILTINS
if (MP_STATE_VM(mp_module_builtins_override_dict) != NULL) { if (MP_STATE_VM(mp_module_builtins_override_dict) != NULL) {
// lookup in additional dynamic table of builtins first // lookup in additional dynamic table of builtins first
elem = mp_map_lookup(&MP_STATE_VM(mp_module_builtins_override_dict)->map, MP_OBJ_NEW_QSTR(qstr), MP_MAP_LOOKUP); elem = mp_map_lookup(&MP_STATE_VM(mp_module_builtins_override_dict)->map, MP_OBJ_NEW_QSTR(qst), MP_MAP_LOOKUP);
if (elem != NULL) { if (elem != NULL) {
return elem->value; return elem->value;
} }
} }
#endif #endif
elem = mp_map_lookup((mp_map_t*)&mp_module_builtins_globals.map, MP_OBJ_NEW_QSTR(qstr), MP_MAP_LOOKUP); elem = mp_map_lookup((mp_map_t*)&mp_module_builtins_globals.map, MP_OBJ_NEW_QSTR(qst), MP_MAP_LOOKUP);
if (elem == NULL) { if (elem == NULL) {
if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) { if (MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_TERSE) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_NameError, nlr_raise(mp_obj_new_exception_msg(&mp_type_NameError,
"name not defined")); "name not defined"));
} else { } else {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_NameError, nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_NameError,
"name '%s' is not defined", qstr_str(qstr))); "name '%s' is not defined", qstr_str(qst)));
} }
} }
} }
...@@ -185,26 +185,26 @@ mp_obj_t mp_load_build_class(void) { ...@@ -185,26 +185,26 @@ mp_obj_t mp_load_build_class(void) {
return (mp_obj_t)&mp_builtin___build_class___obj; return (mp_obj_t)&mp_builtin___build_class___obj;
} }
void mp_store_name(qstr qstr, mp_obj_t obj) { void mp_store_name(qstr qst, mp_obj_t obj) {
DEBUG_OP_printf("store name %s <- %p\n", qstr_str(qstr), obj); DEBUG_OP_printf("store name %s <- %p\n", qstr_str(qst), obj);
mp_obj_dict_store(MP_STATE_CTX(dict_locals), MP_OBJ_NEW_QSTR(qstr), obj); mp_obj_dict_store(MP_STATE_CTX(dict_locals), MP_OBJ_NEW_QSTR(qst), obj);
} }
void mp_delete_name(qstr qstr) { void mp_delete_name(qstr qst) {
DEBUG_OP_printf("delete name %s\n", qstr_str(qstr)); DEBUG_OP_printf("delete name %s\n", qstr_str(qst));
// TODO convert KeyError to NameError if qstr not found // TODO convert KeyError to NameError if qst not found
mp_obj_dict_delete(MP_STATE_CTX(dict_locals), MP_OBJ_NEW_QSTR(qstr)); mp_obj_dict_delete(MP_STATE_CTX(dict_locals), MP_OBJ_NEW_QSTR(qst));
} }
void mp_store_global(qstr qstr, mp_obj_t obj) { void mp_store_global(qstr qst, mp_obj_t obj) {
DEBUG_OP_printf("store global %s <- %p\n", qstr_str(qstr), obj); DEBUG_OP_printf("store global %s <- %p\n", qstr_str(qst), obj);
mp_obj_dict_store(MP_STATE_CTX(dict_globals), MP_OBJ_NEW_QSTR(qstr), obj); mp_obj_dict_store(MP_STATE_CTX(dict_globals), MP_OBJ_NEW_QSTR(qst), obj);
} }
void mp_delete_global(qstr qstr) { void mp_delete_global(qstr qst) {
DEBUG_OP_printf("delete global %s\n", qstr_str(qstr)); DEBUG_OP_printf("delete global %s\n", qstr_str(qst));
// TODO convert KeyError to NameError if qstr not found // TODO convert KeyError to NameError if qst not found
mp_obj_dict_delete(MP_STATE_CTX(dict_globals), MP_OBJ_NEW_QSTR(qstr)); mp_obj_dict_delete(MP_STATE_CTX(dict_globals), MP_OBJ_NEW_QSTR(qst));
} }
mp_obj_t mp_unary_op(mp_uint_t op, mp_obj_t arg) { mp_obj_t mp_unary_op(mp_uint_t op, mp_obj_t arg) {
......
...@@ -51,7 +51,7 @@ typedef union _mp_arg_val_t { ...@@ -51,7 +51,7 @@ typedef union _mp_arg_val_t {
} mp_arg_val_t; } mp_arg_val_t;
typedef struct _mp_arg_t { typedef struct _mp_arg_t {
qstr qstr; qstr qst;
mp_uint_t flags; mp_uint_t flags;
mp_arg_val_t defval; mp_arg_val_t defval;
} mp_arg_t; } mp_arg_t;
...@@ -70,21 +70,21 @@ static inline void mp_locals_set(mp_obj_dict_t *d) { MP_STATE_CTX(dict_locals) = ...@@ -70,21 +70,21 @@ static inline void mp_locals_set(mp_obj_dict_t *d) { MP_STATE_CTX(dict_locals) =
static inline mp_obj_dict_t *mp_globals_get(void) { return MP_STATE_CTX(dict_globals); } static inline mp_obj_dict_t *mp_globals_get(void) { return MP_STATE_CTX(dict_globals); }
static inline void mp_globals_set(mp_obj_dict_t *d) { MP_STATE_CTX(dict_globals) = d; } static inline void mp_globals_set(mp_obj_dict_t *d) { MP_STATE_CTX(dict_globals) = d; }
mp_obj_t mp_load_name(qstr qstr); mp_obj_t mp_load_name(qstr qst);
mp_obj_t mp_load_global(qstr qstr); mp_obj_t mp_load_global(qstr qst);
mp_obj_t mp_load_build_class(void); mp_obj_t mp_load_build_class(void);
void mp_store_name(qstr qstr, mp_obj_t obj); void mp_store_name(qstr qst, mp_obj_t obj);
void mp_store_global(qstr qstr, mp_obj_t obj); void mp_store_global(qstr qst, mp_obj_t obj);
void mp_delete_name(qstr qstr); void mp_delete_name(qstr qst);
void mp_delete_global(qstr qstr); void mp_delete_global(qstr qst);
mp_obj_t mp_unary_op(mp_uint_t op, mp_obj_t arg); mp_obj_t mp_unary_op(mp_uint_t op, mp_obj_t arg);
mp_obj_t mp_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs); mp_obj_t mp_binary_op(mp_uint_t op, mp_obj_t lhs, mp_obj_t rhs);
mp_obj_t mp_load_const_int(qstr qstr); mp_obj_t mp_load_const_int(qstr qst);
mp_obj_t mp_load_const_dec(qstr qstr); mp_obj_t mp_load_const_dec(qstr qst);
mp_obj_t mp_load_const_str(qstr qstr); mp_obj_t mp_load_const_str(qstr qst);
mp_obj_t mp_load_const_bytes(qstr qstr); mp_obj_t mp_load_const_bytes(qstr qst);
mp_obj_t mp_call_function_0(mp_obj_t fun); mp_obj_t mp_call_function_0(mp_obj_t fun);
mp_obj_t mp_call_function_1(mp_obj_t fun, mp_obj_t arg); mp_obj_t mp_call_function_1(mp_obj_t fun, mp_obj_t arg);
......
...@@ -43,9 +43,9 @@ extern const qstr mp_binary_op_method_name[]; ...@@ -43,9 +43,9 @@ extern const qstr mp_binary_op_method_name[];
#define DECODE_ULABEL do { unum = (ip[0] | (ip[1] << 8)); ip += 2; } while (0) #define DECODE_ULABEL do { unum = (ip[0] | (ip[1] << 8)); ip += 2; } while (0)
#define DECODE_SLABEL do { unum = (ip[0] | (ip[1] << 8)) - 0x8000; ip += 2; } while (0) #define DECODE_SLABEL do { unum = (ip[0] | (ip[1] << 8)) - 0x8000; ip += 2; } while (0)
#define DECODE_QSTR { \ #define DECODE_QSTR { \
qstr = 0; \ qst = 0; \
do { \ do { \
qstr = (qstr << 7) + (*ip & 0x7f); \ qst = (qst << 7) + (*ip & 0x7f); \
} while ((*ip++ & 0x80) != 0); \ } while ((*ip++ & 0x80) != 0); \
} }
#define DECODE_PTR do { \ #define DECODE_PTR do { \
...@@ -131,7 +131,7 @@ void mp_bytecode_print(const void *descr, mp_uint_t n_total_args, const byte *ip ...@@ -131,7 +131,7 @@ void mp_bytecode_print(const void *descr, mp_uint_t n_total_args, const byte *ip
const byte *mp_bytecode_print_str(const byte *ip) { const byte *mp_bytecode_print_str(const byte *ip) {
mp_uint_t unum; mp_uint_t unum;
qstr qstr; qstr qst;
switch (*ip++) { switch (*ip++) {
case MP_BC_LOAD_CONST_FALSE: case MP_BC_LOAD_CONST_FALSE:
...@@ -165,22 +165,22 @@ const byte *mp_bytecode_print_str(const byte *ip) { ...@@ -165,22 +165,22 @@ const byte *mp_bytecode_print_str(const byte *ip) {
case MP_BC_LOAD_CONST_INT: case MP_BC_LOAD_CONST_INT:
DECODE_QSTR; DECODE_QSTR;
printf("LOAD_CONST_INT %s", qstr_str(qstr)); printf("LOAD_CONST_INT %s", qstr_str(qst));
break; break;
case MP_BC_LOAD_CONST_DEC: case MP_BC_LOAD_CONST_DEC:
DECODE_QSTR; DECODE_QSTR;
printf("LOAD_CONST_DEC %s", qstr_str(qstr)); printf("LOAD_CONST_DEC %s", qstr_str(qst));
break; break;
case MP_BC_LOAD_CONST_BYTES: case MP_BC_LOAD_CONST_BYTES:
DECODE_QSTR; DECODE_QSTR;
printf("LOAD_CONST_BYTES %s", qstr_str(qstr)); printf("LOAD_CONST_BYTES %s", qstr_str(qst));
break; break;
case MP_BC_LOAD_CONST_STRING: case MP_BC_LOAD_CONST_STRING:
DECODE_QSTR; DECODE_QSTR;
printf("LOAD_CONST_STRING '%s'", qstr_str(qstr)); printf("LOAD_CONST_STRING '%s'", qstr_str(qst));
break; break;
case MP_BC_LOAD_CONST_OBJ: case MP_BC_LOAD_CONST_OBJ:
...@@ -205,7 +205,7 @@ const byte *mp_bytecode_print_str(const byte *ip) { ...@@ -205,7 +205,7 @@ const byte *mp_bytecode_print_str(const byte *ip) {
case MP_BC_LOAD_NAME: case MP_BC_LOAD_NAME:
DECODE_QSTR; DECODE_QSTR;
printf("LOAD_NAME %s", qstr_str(qstr)); printf("LOAD_NAME %s", qstr_str(qst));
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) { if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
printf(" (cache=%u)", *ip++); printf(" (cache=%u)", *ip++);
} }
...@@ -213,7 +213,7 @@ const byte *mp_bytecode_print_str(const byte *ip) { ...@@ -213,7 +213,7 @@ const byte *mp_bytecode_print_str(const byte *ip) {
case MP_BC_LOAD_GLOBAL: case MP_BC_LOAD_GLOBAL:
DECODE_QSTR; DECODE_QSTR;
printf("LOAD_GLOBAL %s", qstr_str(qstr)); printf("LOAD_GLOBAL %s", qstr_str(qst));
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) { if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
printf(" (cache=%u)", *ip++); printf(" (cache=%u)", *ip++);
} }
...@@ -221,7 +221,7 @@ const byte *mp_bytecode_print_str(const byte *ip) { ...@@ -221,7 +221,7 @@ const byte *mp_bytecode_print_str(const byte *ip) {
case MP_BC_LOAD_ATTR: case MP_BC_LOAD_ATTR:
DECODE_QSTR; DECODE_QSTR;
printf("LOAD_ATTR %s", qstr_str(qstr)); printf("LOAD_ATTR %s", qstr_str(qst));
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) { if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
printf(" (cache=%u)", *ip++); printf(" (cache=%u)", *ip++);
} }
...@@ -229,7 +229,7 @@ const byte *mp_bytecode_print_str(const byte *ip) { ...@@ -229,7 +229,7 @@ const byte *mp_bytecode_print_str(const byte *ip) {
case MP_BC_LOAD_METHOD: case MP_BC_LOAD_METHOD:
DECODE_QSTR; DECODE_QSTR;
printf("LOAD_METHOD %s", qstr_str(qstr)); printf("LOAD_METHOD %s", qstr_str(qst));
break; break;
case MP_BC_LOAD_BUILD_CLASS: case MP_BC_LOAD_BUILD_CLASS:
...@@ -252,17 +252,17 @@ const byte *mp_bytecode_print_str(const byte *ip) { ...@@ -252,17 +252,17 @@ const byte *mp_bytecode_print_str(const byte *ip) {
case MP_BC_STORE_NAME: case MP_BC_STORE_NAME:
DECODE_QSTR; DECODE_QSTR;
printf("STORE_NAME %s", qstr_str(qstr)); printf("STORE_NAME %s", qstr_str(qst));
break; break;
case MP_BC_STORE_GLOBAL: case MP_BC_STORE_GLOBAL:
DECODE_QSTR; DECODE_QSTR;
printf("STORE_GLOBAL %s", qstr_str(qstr)); printf("STORE_GLOBAL %s", qstr_str(qst));
break; break;
case MP_BC_STORE_ATTR: case MP_BC_STORE_ATTR:
DECODE_QSTR; DECODE_QSTR;
printf("STORE_ATTR %s", qstr_str(qstr)); printf("STORE_ATTR %s", qstr_str(qst));
if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) { if (MICROPY_OPT_CACHE_MAP_LOOKUP_IN_BYTECODE) {
printf(" (cache=%u)", *ip++); printf(" (cache=%u)", *ip++);
} }
...@@ -284,7 +284,7 @@ const byte *mp_bytecode_print_str(const byte *ip) { ...@@ -284,7 +284,7 @@ const byte *mp_bytecode_print_str(const byte *ip) {
case MP_BC_DELETE_NAME: case MP_BC_DELETE_NAME:
DECODE_QSTR; DECODE_QSTR;
printf("DELETE_NAME %s", qstr_str(qstr)); printf("DELETE_NAME %s", qstr_str(qst));
break; break;
case MP_BC_DUP_TOP: case MP_BC_DUP_TOP:
...@@ -502,12 +502,12 @@ const byte *mp_bytecode_print_str(const byte *ip) { ...@@ -502,12 +502,12 @@ const byte *mp_bytecode_print_str(const byte *ip) {
case MP_BC_IMPORT_NAME: case MP_BC_IMPORT_NAME:
DECODE_QSTR; DECODE_QSTR;
printf("IMPORT_NAME '%s'", qstr_str(qstr)); printf("IMPORT_NAME '%s'", qstr_str(qst));
break; break;
case MP_BC_IMPORT_FROM: case MP_BC_IMPORT_FROM:
DECODE_QSTR; DECODE_QSTR;
printf("IMPORT_FROM '%s'", qstr_str(qstr)); printf("IMPORT_FROM '%s'", qstr_str(qst));
break; break;
case MP_BC_IMPORT_STAR: case MP_BC_IMPORT_STAR:
......
...@@ -240,7 +240,7 @@ STATIC mp_obj_t poll_poll(uint n_args, const mp_obj_t *args) { ...@@ -240,7 +240,7 @@ STATIC mp_obj_t poll_poll(uint n_args, const mp_obj_t *args) {
if (n_ready > 0 || (timeout != -1 && HAL_GetTick() - start_tick >= timeout)) { if (n_ready > 0 || (timeout != -1 && HAL_GetTick() - start_tick >= timeout)) {
// one or more objects are ready, or we had a timeout // one or more objects are ready, or we had a timeout
mp_obj_list_t *ret_list = mp_obj_new_list(n_ready, NULL); mp_obj_list_t *ret_list = mp_obj_new_list(n_ready, NULL);