Fix warning from VC regarding implicit int conversion.

parent fe3c3bb6
...@@ -20,7 +20,7 @@ create_proc_from_string(mrb_state *mrb, const char *s, mrb_int len, mrb_value bi ...@@ -20,7 +20,7 @@ create_proc_from_string(mrb_state *mrb, const char *s, mrb_int len, mrb_value bi
struct REnv *e; struct REnv *e;
mrb_callinfo *ci; /* callinfo of eval caller */ mrb_callinfo *ci; /* callinfo of eval caller */
struct RClass *target_class = NULL; struct RClass *target_class = NULL;
int bidx; mrb_int bidx;
if (!mrb_nil_p(binding)) { if (!mrb_nil_p(binding)) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "Binding of eval must be nil."); mrb_raise(mrb, E_ARGUMENT_ERROR, "Binding of eval must be nil.");
......
...@@ -17,22 +17,22 @@ ...@@ -17,22 +17,22 @@
#endif #endif
static void 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 defined(_WIN32)
if (isatty(fileno(stdout))) { if (isatty(fileno(stdout))) {
DWORD written; 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)); wchar_t* utf16 = (wchar_t*)mrb_malloc(mrb, (wlen+1) * sizeof(wchar_t));
if (MultiByteToWideChar(CP_UTF8, 0, p, len, utf16, wlen) > 0) { if (MultiByteToWideChar(CP_UTF8, 0, p, len, utf16, wlen) > 0) {
utf16[wlen] = 0; utf16[wlen] = 0;
WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE),
utf16, wlen, &written, NULL); utf16, (DWORD)wlen, &written, NULL);
} }
mrb_free(mrb, utf16); mrb_free(mrb, utf16);
} else } else
#endif #endif
fwrite(p, len, 1, stdout); fwrite(p, (size_t)len, 1, stdout);
fflush(stdout); fflush(stdout);
} }
......
...@@ -115,7 +115,7 @@ rational_new_f(mrb_state *mrb, mrb_float f0) ...@@ -115,7 +115,7 @@ rational_new_f(mrb_state *mrb, mrb_float f0)
if (f < 0) { neg = 1; f = -f; } if (f < 0) { neg = 1; f = -f; }
while (f != floor(f)) { n <<= 1; f *= 2; } while (f != floor(f)) { n <<= 1; f *= 2; }
d = f; d = (mrb_int)f;
/* continued fraction and check denominator each step */ /* continued fraction and check denominator each step */
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
......
...@@ -223,7 +223,7 @@ mrb_stack_extend(mrb_state *mrb, mrb_int room) ...@@ -223,7 +223,7 @@ mrb_stack_extend(mrb_state *mrb, mrb_int room)
} }
static inline struct REnv* 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; const struct RProc *proc = mrb->c->ci->proc;
struct REnv *e; struct REnv *e;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment