Skip to content

Commit

Permalink
console.c: check unused args
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nobu committed Nov 7, 2015
1 parent 9853cb0 commit 9d0012b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ext/io/console/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit 9d0012b

Please sign in to comment.