Skip to content

Commit 1f92ffb

Browse files
committed
py/emitinlinethumb: Allow to compile with -Wsign-compare.
1 parent 723d598 commit 1f92ffb

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

py/emitinlinethumb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ STATIC bool emit_inline_thumb_label(emit_inline_asm_t *emit, mp_uint_t label_num
117117
assert(label_num < emit->max_num_labels);
118118
if (emit->pass == MP_PASS_CODE_SIZE) {
119119
// check for duplicate label on first pass
120-
for (int i = 0; i < emit->max_num_labels; i++) {
120+
for (uint i = 0; i < emit->max_num_labels; i++) {
121121
if (emit->label_lookup[i] == label_id) {
122122
return false;
123123
}
@@ -318,7 +318,7 @@ STATIC int get_arg_label(emit_inline_asm_t *emit, const char *op, mp_parse_node_
318318
return 0;
319319
}
320320
qstr label_qstr = MP_PARSE_NODE_LEAF_ARG(pn);
321-
for (int i = 0; i < emit->max_num_labels; i++) {
321+
for (uint i = 0; i < emit->max_num_labels; i++) {
322322
if (emit->label_lookup[i] == label_qstr) {
323323
return i;
324324
}
@@ -537,7 +537,7 @@ STATIC void emit_inline_thumb_op(emit_inline_asm_t *emit, qstr op, mp_uint_t n_a
537537
cc = cc_name_table[i].cc;
538538
}
539539
}
540-
if (cc == -1) {
540+
if (cc == (mp_uint_t)-1) {
541541
goto unknown_op;
542542
}
543543
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
555555
break;
556556
}
557557
}
558-
if (cc == -1) {
558+
if (cc == (mp_uint_t)-1) {
559559
goto unknown_op;
560560
}
561561
const char *os = op_str + 2;

0 commit comments

Comments
 (0)