From e1375ab5e61df3a8a706a5165448a72d80a57414 Mon Sep 17 00:00:00 2001 From: shugo Date: Wed, 15 Dec 2004 09:57:05 +0000 Subject: * ext/curses/curses.c (window_subwin): call NUM2INT() before GetWINDOW(). (backported from CVS HEAD) git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/curses/curses.c | 22 +++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index b77f38ffe..75a93f8e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Dec 15 18:48:42 2004 Shugo Maeda + + * ext/curses/curses.c (window_subwin): call NUM2INT() before + GetWINDOW(). (backported from CVS HEAD) + Wed Dec 15 17:03:50 2004 NAKAMURA Usaku * win32/win32.[ch] (rb_w32_isatty): new function to replace MSVCRT's diff --git a/ext/curses/curses.c b/ext/curses/curses.c index 106c43da4..a8952bf18 100644 --- a/ext/curses/curses.c +++ b/ext/curses/curses.c @@ -21,7 +21,11 @@ #elif defined(HAVE_NCURSES_CURSES_H) # include #elif defined(HAVE_CURSES_COLR_CURSES_H) -# include +# ifdef HAVE_STDARG_PROTOTYPES +# include +# else +# include +# endif # include #else # include @@ -762,22 +766,26 @@ window_initialize(obj, h, w, top, left) return obj; } -/* def subwin(h, w, top, left) */ +/* def subwin(height, width, top, left) */ static VALUE -window_subwin(obj, h, w, top, left) +window_subwin(obj, height, width, top, left) VALUE obj; - VALUE h; - VALUE w; + VALUE height; + VALUE width; VALUE top; VALUE left; { struct windata *winp; WINDOW *window; VALUE win; + int h, w, t, l; + h = NUM2INT(height); + w = NUM2INT(width); + t = NUM2INT(top); + l = NUM2INT(left); GetWINDOW(obj, winp); - window = subwin(winp->window, NUM2INT(h), NUM2INT(w), - NUM2INT(top), NUM2INT(left)); + window = subwin(winp->window, h, w, t, l); win = prep_window(rb_obj_class(obj), window); return win; -- cgit