From 9d0012b0e7d5b658bc62856b36666a9e5d684646 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 7 Nov 2015 00:25:50 +0000 Subject: console.c: check unused args * ext/io/console/console.c (console_set_winsize): unused arguments also should be nil or integers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/io/console/console.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ext/io') diff --git a/ext/io/console/console.c b/ext/io/console/console.c index 6716d32201..dc494c2ddd 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -541,8 +541,12 @@ console_set_winsize(VALUE io, VALUE size) if (!setwinsize(fd, &ws)) rb_sys_fail(0); #elif defined _WIN32 wh = (HANDLE)rb_w32_get_osfhandle(fd); - newrow = (SHORT)NUM2UINT(row); - newcol = (SHORT)NUM2UINT(col); +#define SET(m) new##m = NIL_P(m) ? 0 : (unsigned short)NUM2UINT(m) + SET(row); + SET(col); +#undef SET + if (!NIL_P(xpixel)) (void)NUM2UINT(xpixel); + if (!NIL_P(ypixel)) (void)NUM2UINT(ypixel); if (!GetConsoleScreenBufferInfo(wh, &ws)) { rb_syserr_fail(LAST_ERROR, "GetConsoleScreenBufferInfo"); } -- cgit v1.2.3