summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-rational/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-01-12 16:25:30 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-01-12 16:25:30 +0900
commit1310368b3f78e9304b7231eb1d6408842340c6cf (patch)
tree5edd47ee2149c0528fbfaa5bf2a9c723d8452717 /mrbgems/mruby-rational/src
parenta8b8d316ab80b7cf569d6bc9cb8ba993a4e6c8bc (diff)
downloadmruby-1310368b3f78e9304b7231eb1d6408842340c6cf.tar.gz
mruby-1310368b3f78e9304b7231eb1d6408842340c6cf.zip
Silence Windows warnings (cast and `setmode`).
Diffstat (limited to 'mrbgems/mruby-rational/src')
-rw-r--r--mrbgems/mruby-rational/src/rational.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mrbgems/mruby-rational/src/rational.c b/mrbgems/mruby-rational/src/rational.c
index 173a416e8..5e25bfb99 100644
--- a/mrbgems/mruby-rational/src/rational.c
+++ b/mrbgems/mruby-rational/src/rational.c
@@ -160,8 +160,8 @@ rational_new_i(mrb_state *mrb, mrb_int n, mrb_int d)
static void
float_decode_internal(mrb_state *mrb, mrb_float f, mrb_float *rf, int *n)
{
- f = frexp_rat(f, n);
- f = ldexp_rat(f, RAT_MANT_DIG);
+ f = (mrb_float)frexp_rat(f, n);
+ f = (mrb_float)ldexp_rat(f, RAT_MANT_DIG);
*n -= RAT_MANT_DIG;
*rf = f;
}
@@ -188,7 +188,7 @@ rational_new_f(mrb_state *mrb, mrb_float f0)
else {
n = -n;
}
- return rational_new_i(mrb, f, ((mrb_int)1)<<n);
+ return rational_new_i(mrb, (mrb_int)f, ((mrb_int)1)<<n);
#else
mrb_int pow = 1;
if (n < 0) {
@@ -206,7 +206,7 @@ rational_new_f(mrb_state *mrb, mrb_float f0)
while (n--) {
pow *= FLT_RADIX;
}
- return rational_new(mrb, f*pow, 1);
+ return rational_new(mrb, (mrb_int)f*pow, 1);
}
#endif
}