diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-09-29 00:18:39 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-09-29 00:18:39 +0900 |
| commit | 29a9e698e33f89c18cd8f9622bd503aa55df2f51 (patch) | |
| tree | e83110a7db0edaa3a6c191abe850ed7b657f766e /src/numeric.c | |
| parent | 381850280c036116adaffe42cc420da9c71d28a2 (diff) | |
| parent | 999ce87129fb9216ae746140aa716a764a79b354 (diff) | |
| download | mruby-29a9e698e33f89c18cd8f9622bd503aa55df2f51.tar.gz mruby-29a9e698e33f89c18cd8f9622bd503aa55df2f51.zip | |
Merge pull request #3815 from dabroz/fix-warnings
Fix MSVC 14.0 warnings
Diffstat (limited to 'src/numeric.c')
| -rw-r--r-- | src/numeric.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/numeric.c b/src/numeric.c index afb8415a0..8c7d448bd 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -877,7 +877,7 @@ static mrb_value flo_or(mrb_state *mrb, mrb_value x); static mrb_value flo_xor(mrb_state *mrb, mrb_value x); #define bit_op(x,y,op1,op2) do {\ if (mrb_fixnum_p(y)) return mrb_fixnum_value(mrb_fixnum(x) op2 mrb_fixnum(y));\ - return flo_ ## op1(mrb, mrb_float_value(mrb, mrb_fixnum(x)));\ + return flo_ ## op1(mrb, mrb_float_value(mrb, (mrb_float)mrb_fixnum(x)));\ } while(0) /* 15.2.8.3.9 */ @@ -951,7 +951,7 @@ lshift(mrb_state *mrb, mrb_int val, mrb_int width) (val < (MRB_INT_MIN >> width))) { goto bit_overflow; } - return mrb_fixnum_value(val * (1u << width)); + return mrb_fixnum_value(val * ((mrb_int)1 << width)); } bit_overflow: @@ -1162,7 +1162,7 @@ fix_minus(mrb_state *mrb, mrb_value self) MRB_API mrb_value -mrb_fixnum_to_str(mrb_state *mrb, mrb_value x, int base) +mrb_fixnum_to_str(mrb_state *mrb, mrb_value x, mrb_int base) { char buf[MRB_INT_BIT+1]; char *b = buf + sizeof buf; |
