summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-print/src
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-09-04 09:30:11 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 18:20:17 +0900
commita127ded486b173b1b805da2c39d656c77d98c6cc (patch)
tree7dd265068a0bbf9f5fb3e6e2386e88bd7e7ceb2c /mrbgems/mruby-print/src
parentfe3c3bb661aac19761dcb446935d605a946065b9 (diff)
downloadmruby-a127ded486b173b1b805da2c39d656c77d98c6cc.tar.gz
mruby-a127ded486b173b1b805da2c39d656c77d98c6cc.zip
Fix warning from VC regarding implicit int conversion.
Diffstat (limited to 'mrbgems/mruby-print/src')
-rw-r--r--mrbgems/mruby-print/src/print.c8
1 files changed, 4 insertions, 4 deletions
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);
}