summaryrefslogtreecommitdiffstatshomepage
path: root/py/compile.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-20 11:55:10 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-20 11:55:10 +0000
commit50912e7f5dc579fd2917537046793dfa30decadf (patch)
tree541d6f7531d9d75e168fc914f226d15b4c7faf04 /py/compile.c
parent640e0b221e972f9a2da2d870bf3fc5a93c18f0ec (diff)
downloadmicropython-50912e7f5dc579fd2917537046793dfa30decadf.tar.gz
micropython-50912e7f5dc579fd2917537046793dfa30decadf.zip
py, unix, stmhal: Allow to compile with -Wshadow.
See issue #699.
Diffstat (limited to 'py/compile.c')
-rw-r--r--py/compile.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/py/compile.c b/py/compile.c
index 942dceb6d1..8d246c3758 100644
--- a/py/compile.c
+++ b/py/compile.c
@@ -1229,9 +1229,9 @@ STATIC void compile_decorated(compiler_t *comp, mp_parse_node_struct_t *pns) {
// compile the decorator function
compile_node(comp, name_nodes[0]);
- for (int i = 1; i < name_len; i++) {
- assert(MP_PARSE_NODE_IS_ID(name_nodes[i])); // should be
- EMIT_ARG(load_attr, MP_PARSE_NODE_LEAF_ARG(name_nodes[i]));
+ for (int j = 1; j < name_len; j++) {
+ assert(MP_PARSE_NODE_IS_ID(name_nodes[j])); // should be
+ EMIT_ARG(load_attr, MP_PARSE_NODE_LEAF_ARG(name_nodes[j]));
}
// 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) {
// process rest of elements
for (int i = 0; i < n; i++) {
- mp_parse_node_t pn = nodes[i];
- bool is_key_value = MP_PARSE_NODE_IS_STRUCT_KIND(pn, PN_dictorsetmaker_item);
- compile_node(comp, pn);
+ mp_parse_node_t pn_i = nodes[i];
+ bool is_key_value = MP_PARSE_NODE_IS_STRUCT_KIND(pn_i, PN_dictorsetmaker_item);
+ compile_node(comp, pn_i);
if (is_dict) {
if (!is_key_value) {
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
}
if (pass > MP_PASS_SCOPE) {
mp_int_t bytesize = MP_PARSE_NODE_LEAF_SMALL_INT(pn_arg[0]);
- for (uint i = 1; i < n_args; i++) {
- if (!MP_PARSE_NODE_IS_SMALL_INT(pn_arg[i])) {
+ for (uint j = 1; j < n_args; j++) {
+ if (!MP_PARSE_NODE_IS_SMALL_INT(pn_arg[j])) {
compile_syntax_error(comp, nodes[i], "inline assembler 'data' requires integer arguments");
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 {