From 169114666ae2c0f91a462dd466a0171eef8d92b7 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 14 May 2024 01:34:43 +0900 Subject: [PATCH] mruby-io: fix Win32 declaration bugs --- mrbgems/mruby-io/src/file.c | 2 +- mrbgems/mruby-io/src/io.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mrbgems/mruby-io/src/file.c b/mrbgems/mruby-io/src/file.c index 64307517d..ce1566a0e 100644 --- a/mrbgems/mruby-io/src/file.c +++ b/mrbgems/mruby-io/src/file.c @@ -368,7 +368,7 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass) mrb_locale_free(home); return path; #else /* _WIN32 */ - argc = mrb_get_argc(mrb); + mrb_int argc = mrb_get_argc(mrb); if (argc == 0) { home = getenv("USERPROFILE"); if (home == NULL) { diff --git a/mrbgems/mruby-io/src/io.c b/mrbgems/mruby-io/src/io.c index 18c6bef79..e7fae4faa 100644 --- a/mrbgems/mruby-io/src/io.c +++ b/mrbgems/mruby-io/src/io.c @@ -396,7 +396,6 @@ io_s_popen_args(mrb_state *mrb, mrb_value klass, static mrb_value io_s_popen(mrb_state *mrb, mrb_value klass) { - mrb_value io; int doexec; int opt_in, opt_out, opt_err; const char *cmd; @@ -1792,7 +1791,7 @@ io_gets(mrb_state *mrb, mrb_value io) for (;;) { if (rs_given) { /* with RS */ - int rslen = RSTRING_LEN(rs); + mrb_int rslen = RSTRING_LEN(rs); mrb_int idx = io_find_index(fptr, RSTRING_PTR(rs), rslen); if (idx >= 0) { /* found */ mrb_int n = idx+rslen;