Silence Windows warnings (cast and `setmode`).
MODIFY
mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
mrbgems/mruby-bin-mruby/tools/mruby/mruby.c
@@ -235,7 +235,7 @@ parse_args(mrb_state *mrb, int argc, char **argv, struct _args *args)
}
#if defined(_WIN32) || defined(_WIN64)
if (args->rfp == stdin) {
- setmode(_fileno(stdin), O_BINARY);
+ _setmode(_fileno(stdin), O_BINARY);
}
#endif
args->argv = (char **)mrb_realloc(mrb, args->argv, sizeof(char*) * (argc + 1));

MODIFY
mrbgems/mruby-rational/src/rational.c
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
}

MODIFY
src/load.c
src/load.c
@@ -96,7 +96,7 @@ read_irep_record_1(mrb_state *mrb, const uint8_t *bin, size_t *len, uint8_t flag
src += sizeof(uint16_t);
/* number of child irep */
- irep->rlen = (size_t)bin_to_uint16(src);
+ irep->rlen = (uint8_t)bin_to_uint16(src);
src += sizeof(uint16_t);
/* Binary Data Section */

Silence Windows warnings (cast and `setmode`).