Skip to content
Snippets Groups Projects
Commit 1f92ffb5 authored by Damien George's avatar Damien George
Browse files

py/emitinlinethumb: Allow to compile with -Wsign-compare.

parent 723d598d
No related branches found
No related tags found
No related merge requests found
...@@ -117,7 +117,7 @@ STATIC bool emit_inline_thumb_label(emit_inline_asm_t *emit, mp_uint_t label_num ...@@ -117,7 +117,7 @@ STATIC bool emit_inline_thumb_label(emit_inline_asm_t *emit, mp_uint_t label_num
assert(label_num < emit->max_num_labels); assert(label_num < emit->max_num_labels);
if (emit->pass == MP_PASS_CODE_SIZE) { if (emit->pass == MP_PASS_CODE_SIZE) {
// check for duplicate label on first pass // check for duplicate label on first pass
for (int i = 0; i < emit->max_num_labels; i++) { for (uint i = 0; i < emit->max_num_labels; i++) {
if (emit->label_lookup[i] == label_id) { if (emit->label_lookup[i] == label_id) {
return false; return false;
} }
...@@ -318,7 +318,7 @@ STATIC int get_arg_label(emit_inline_asm_t *emit, const char *op, mp_parse_node_ ...@@ -318,7 +318,7 @@ STATIC int get_arg_label(emit_inline_asm_t *emit, const char *op, mp_parse_node_
return 0; return 0;
} }
qstr label_qstr = MP_PARSE_NODE_LEAF_ARG(pn); qstr label_qstr = MP_PARSE_NODE_LEAF_ARG(pn);
for (int i = 0; i < emit->max_num_labels; i++) { for (uint i = 0; i < emit->max_num_labels; i++) {
if (emit->label_lookup[i] == label_qstr) { if (emit->label_lookup[i] == label_qstr) {
return i; return i;
} }
...@@ -537,7 +537,7 @@ STATIC void emit_inline_thumb_op(emit_inline_asm_t *emit, qstr op, mp_uint_t n_a ...@@ -537,7 +537,7 @@ STATIC void emit_inline_thumb_op(emit_inline_asm_t *emit, qstr op, mp_uint_t n_a
cc = cc_name_table[i].cc; cc = cc_name_table[i].cc;
} }
} }
if (cc == -1) { if (cc == (mp_uint_t)-1) {
goto unknown_op; goto unknown_op;
} }
int label_num = get_arg_label(emit, op_str, pn_args[0]); int label_num = get_arg_label(emit, op_str, pn_args[0]);
...@@ -555,7 +555,7 @@ STATIC void emit_inline_thumb_op(emit_inline_asm_t *emit, qstr op, mp_uint_t n_a ...@@ -555,7 +555,7 @@ STATIC void emit_inline_thumb_op(emit_inline_asm_t *emit, qstr op, mp_uint_t n_a
break; break;
} }
} }
if (cc == -1) { if (cc == (mp_uint_t)-1) {
goto unknown_op; goto unknown_op;
} }
const char *os = op_str + 2; const char *os = op_str + 2;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment