diff options
author | Damien George <damien.p.george@gmail.com> | 2015-11-09 14:11:21 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-11-09 14:11:21 +0000 |
commit | 723d598d32e939f4c86a01f13a7769a4a7365627 (patch) | |
tree | 4de4f2558e35e5db9b05ee1bb4332124078e4511 | |
parent | 40274fec9c0f8e1ce06f999927f550106b9aa5e8 (diff) | |
download | micropython-723d598d32e939f4c86a01f13a7769a4a7365627.tar.gz micropython-723d598d32e939f4c86a01f13a7769a4a7365627.zip |
py/asmthumb: Allow to compile with -Wsign-compare and -Wunused-parameter.
-rw-r--r-- | py/asmthumb.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/py/asmthumb.c b/py/asmthumb.c index 16337f4d5e..8341c958e9 100644 --- a/py/asmthumb.c +++ b/py/asmthumb.c @@ -88,6 +88,7 @@ void asm_thumb_start_pass(asm_thumb_t *as, uint pass) { } void asm_thumb_end_pass(asm_thumb_t *as) { + (void)as; // could check labels are resolved... } @@ -402,7 +403,7 @@ void asm_thumb_b_label(asm_thumb_t *as, uint label) { mp_uint_t dest = get_label_dest(as, label); mp_int_t rel = dest - as->code_offset; rel -= 4; // account for instruction prefetch, PC is 4 bytes ahead of this instruction - if (dest != -1 && rel <= -4) { + if (dest != (mp_uint_t)-1 && rel <= -4) { // is a backwards jump, so we know the size of the jump on the first pass // calculate rel assuming 12 bit relative jump if (SIGNED_FIT12(rel)) { @@ -421,7 +422,7 @@ void asm_thumb_bcc_label(asm_thumb_t *as, int cond, uint label) { mp_uint_t dest = get_label_dest(as, label); mp_int_t rel = dest - as->code_offset; rel -= 4; // account for instruction prefetch, PC is 4 bytes ahead of this instruction - if (dest != -1 && rel <= -4) { + if (dest != (mp_uint_t)-1 && rel <= -4) { // is a backwards jump, so we know the size of the jump on the first pass // calculate rel assuming 9 bit relative jump if (SIGNED_FIT9(rel)) { |