diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-09-04 09:30:11 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-10-12 18:20:17 +0900 |
| commit | a127ded486b173b1b805da2c39d656c77d98c6cc (patch) | |
| tree | 7dd265068a0bbf9f5fb3e6e2386e88bd7e7ceb2c | |
| parent | fe3c3bb661aac19761dcb446935d605a946065b9 (diff) | |
| download | mruby-a127ded486b173b1b805da2c39d656c77d98c6cc.tar.gz mruby-a127ded486b173b1b805da2c39d656c77d98c6cc.zip | |
Fix warning from VC regarding implicit int conversion.
| -rw-r--r-- | mrbgems/mruby-eval/src/eval.c | 2 | ||||
| -rw-r--r-- | mrbgems/mruby-print/src/print.c | 8 | ||||
| -rw-r--r-- | mrbgems/mruby-rational/src/rational.c | 2 | ||||
| -rw-r--r-- | src/vm.c | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/mrbgems/mruby-eval/src/eval.c b/mrbgems/mruby-eval/src/eval.c index 4271954e5..34a438060 100644 --- a/mrbgems/mruby-eval/src/eval.c +++ b/mrbgems/mruby-eval/src/eval.c @@ -20,7 +20,7 @@ create_proc_from_string(mrb_state *mrb, const char *s, mrb_int len, mrb_value bi struct REnv *e; mrb_callinfo *ci; /* callinfo of eval caller */ struct RClass *target_class = NULL; - int bidx; + mrb_int bidx; if (!mrb_nil_p(binding)) { mrb_raise(mrb, E_ARGUMENT_ERROR, "Binding of eval must be nil."); diff --git a/mrbgems/mruby-print/src/print.c b/mrbgems/mruby-print/src/print.c index 74d736397..665f2a926 100644 --- a/mrbgems/mruby-print/src/print.c +++ b/mrbgems/mruby-print/src/print.c @@ -17,22 +17,22 @@ #endif static void -printstr(mrb_state *mrb, const char *p, size_t len) +printstr(mrb_state *mrb, const char *p, mrb_int len) { #if defined(_WIN32) if (isatty(fileno(stdout))) { DWORD written; - size_t wlen = MultiByteToWideChar(CP_UTF8, 0, p, len, NULL, 0); + int wlen = MultiByteToWideChar(CP_UTF8, 0, p, (int)len, NULL, 0); wchar_t* utf16 = (wchar_t*)mrb_malloc(mrb, (wlen+1) * sizeof(wchar_t)); if (MultiByteToWideChar(CP_UTF8, 0, p, len, utf16, wlen) > 0) { utf16[wlen] = 0; WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), - utf16, wlen, &written, NULL); + utf16, (DWORD)wlen, &written, NULL); } mrb_free(mrb, utf16); } else #endif - fwrite(p, len, 1, stdout); + fwrite(p, (size_t)len, 1, stdout); fflush(stdout); } diff --git a/mrbgems/mruby-rational/src/rational.c b/mrbgems/mruby-rational/src/rational.c index 06f198c98..d5dd7adc4 100644 --- a/mrbgems/mruby-rational/src/rational.c +++ b/mrbgems/mruby-rational/src/rational.c @@ -115,7 +115,7 @@ rational_new_f(mrb_state *mrb, mrb_float f0) if (f < 0) { neg = 1; f = -f; } while (f != floor(f)) { n <<= 1; f *= 2; } - d = f; + d = (mrb_int)f; /* continued fraction and check denominator each step */ for (i = 0; i < 64; i++) { @@ -223,7 +223,7 @@ mrb_stack_extend(mrb_state *mrb, mrb_int room) } static inline struct REnv* -uvenv(mrb_state *mrb, int up) +uvenv(mrb_state *mrb, mrb_int up) { const struct RProc *proc = mrb->c->ci->proc; struct REnv *e; |
