[前][次][番号順一覧][スレッド一覧]

ruby-changes:57709

From: Nobuyoshi <ko1@a...>
Date: Tue, 10 Sep 2019 17:30:35 +0900 (JST)
Subject: [ruby-changes:57709] b5ab918d0c (master): [ruby/io-console] Suppress warnings on Windows

https://git.ruby-lang.org/ruby.git/commit/?id=b5ab918d0c

From b5ab918d0c7cdeac8f1b1d45842383ea5413699f Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 10 Sep 2019 17:22:06 +0900
Subject: [ruby/io-console] Suppress warnings on Windows

About unused variables and a function.

https://github.com/ruby/io-console/commit/32baf54e7a

diff --git a/ext/io/console/console.c b/ext/io/console/console.c
index 5c834f6..c828175 100644
--- a/ext/io/console/console.c
+++ b/ext/io/console/console.c
@@ -311,6 +311,7 @@ ttymode_callback(VALUE args) https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L311
     return argp->func(argp->io, argp->farg);
 }
 
+#if !defined _WIN32
 static VALUE
 ttymode_with_io(VALUE io, VALUE (*func)(VALUE, VALUE), VALUE farg, void (*setter)(conmode *, void *), void *arg)
 {
@@ -320,6 +321,7 @@ ttymode_with_io(VALUE io, VALUE (*func)(VALUE, VALUE), VALUE farg, void (*setter https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L321
     cargs.farg = farg;
     return ttymode(io, ttymode_callback, (VALUE)&cargs, setter, arg);
 }
+#endif
 
 /*
  * call-seq:
@@ -895,7 +897,7 @@ console_erase_line(VALUE io, VALUE val) https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L897
     HANDLE h;
     rb_console_size_t ws;
     COORD *pos = &ws.dwCursorPosition;
-    DWORD written, w;
+    DWORD w;
     int mode = mode_in_range(val, 2, "line erase");
 
     GetOpenFile(io, fptr);
@@ -927,7 +929,7 @@ console_erase_screen(VALUE io, VALUE val) https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L929
     HANDLE h;
     rb_console_size_t ws;
     COORD *pos = &ws.dwCursorPosition;
-    DWORD written, w;
+    DWORD w;
     int mode = mode_in_range(val, 3, "screen erase");
 
     GetOpenFile(io, fptr);
@@ -966,7 +968,6 @@ console_scroll(VALUE io, int line) https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L968
     rb_io_t *fptr;
     HANDLE h;
     rb_console_size_t ws;
-    COORD *pos = &ws.dwCursorPosition;
 
     GetOpenFile(io, fptr);
     h = (HANDLE)rb_w32_get_osfhandle(GetWriteFD(fptr));
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]