diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-01 17:36:35 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-01 17:36:35 +0900 |
| commit | a657117e4e5fbde4434661794f80a93dde55d70d (patch) | |
| tree | d80d2968b7f3762266b1177fc4b2c37af2ed963f /mrbgems/mruby-compiler/core | |
| parent | 20c0c6330f38c6a1a969a06bc5a3bf56d39f466f (diff) | |
| download | mruby-a657117e4e5fbde4434661794f80a93dde55d70d.tar.gz mruby-a657117e4e5fbde4434661794f80a93dde55d70d.zip | |
Avoid warning in MSVC compilation.
Diffstat (limited to 'mrbgems/mruby-compiler/core')
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index efd20d908..98b215f6b 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -2378,9 +2378,9 @@ codegen(codegen_scope *s, node *tree, int val) #endif { if (i == -1) genop_1(s, OP_LOADI__1, cursp()); - else if (i < 0) genop_2(s, OP_LOADINEG, cursp(), -i); - else if (i < 8) genop_1(s, OP_LOADI_0 + i, cursp()); - else if (i <= 0xffff) genop_2(s, OP_LOADI, cursp(), i); + else if (i < 0) genop_2(s, OP_LOADINEG, cursp(), (uint16_t)-i); + else if (i < 8) genop_1(s, OP_LOADI_0 + (uint8_t)i, cursp()); + else if (i <= 0xffff) genop_2(s, OP_LOADI, cursp(), (uint16_t)i); else { int off = new_lit(s, mrb_fixnum_value(i)); genop_2(s, OP_LOADL, cursp(), off); |
