diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-08-25 16:58:01 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-08-25 16:58:01 +0900 |
| commit | 471288f37d18e640f98029fabcdcb7ee16b95d93 (patch) | |
| tree | 0624dcf5f681c61b4f59b8e15441f02c9d0cab62 /mrbgems/mruby-compiler/core/codegen.c | |
| parent | d79dbd92f9104712c6cf41ab3c029dec318a757d (diff) | |
| download | mruby-471288f37d18e640f98029fabcdcb7ee16b95d93.tar.gz mruby-471288f37d18e640f98029fabcdcb7ee16b95d93.zip | |
Reduce integer casting warnings.
Diffstat (limited to 'mrbgems/mruby-compiler/core/codegen.c')
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index 075945b3b..a835a563e 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -400,7 +400,7 @@ genjmp2(codegen_scope *s, mrb_code i, uint16_t a, int pc, int val) } else { gen_B(s, i); - gen_B(s, a); + gen_B(s, (uint8_t)a); pos = s->pc; gen_S(s, pc); } @@ -494,10 +494,10 @@ gen_addsub(codegen_scope *s, uint8_t op, uint16_t dst, uint16_t idx) if (data.b >= 128) goto normal; s->pc = s->lastpc; if (op == OP_ADD) { - genop_3(s, OP_ADDI, dst, idx, data.b); + genop_3(s, OP_ADDI, dst, idx, (uint8_t)data.b); } else { - genop_3(s, OP_SUBI, dst, idx, data.b); + genop_3(s, OP_SUBI, dst, idx, (uint8_t)data.b); } break; default: @@ -2441,7 +2441,7 @@ codegen(codegen_scope *s, node *tree, int val) #endif if (i == -1) genop_1(s, OP_LOADI__1, cursp()); else if (i >= -0xffff) { - genop_2(s, OP_LOADINEG, cursp(), -i); + genop_2(s, OP_LOADINEG, cursp(), (uint16_t)-i); } else { int off = new_lit(s, mrb_fixnum_value(i)); |
