ruby-changes:40394
From: nobu <ko1@a...>
Date: Sat, 7 Nov 2015 09:25:55 +0900 (JST)
Subject: [ruby-changes:40394] nobu:r52475 (trunk): console.c: check unused args
nobu 2015-11-07 09:25:50 +0900 (Sat, 07 Nov 2015) New Revision: 52475 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52475 Log: console.c: check unused args * ext/io/console/console.c (console_set_winsize): unused arguments also should be nil or integers. Modified files: trunk/ext/io/console/console.c Index: ext/io/console/console.c =================================================================== --- ext/io/console/console.c (revision 52474) +++ ext/io/console/console.c (revision 52475) @@ -541,8 +541,12 @@ console_set_winsize(VALUE io, VALUE size https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L541 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"); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/