diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-15 09:57:05 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-15 09:57:05 +0000 |
commit | 25bfdcb39053532251797f99f141e8ceeaba6894 (patch) | |
tree | 4b7925ef47ab402c627f820ea3ed11a6cd8ede3f /ext/curses | |
parent | 8dac052af443ca14fac6d343b22113fb1d19cd1b (diff) |
* ext/curses/curses.c (window_subwin): call NUM2INT() before
GetWINDOW(). (backported from CVS HEAD)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/curses')
-rw-r--r-- | ext/curses/curses.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/ext/curses/curses.c b/ext/curses/curses.c index 106c43da4c..a8952bf186 100644 --- a/ext/curses/curses.c +++ b/ext/curses/curses.c @@ -21,7 +21,11 @@ #elif defined(HAVE_NCURSES_CURSES_H) # include <ncurses/curses.h> #elif defined(HAVE_CURSES_COLR_CURSES_H) -# include <varargs.h> +# ifdef HAVE_STDARG_PROTOTYPES +# include <stdarg.h> +# else +# include <varargs.h> +# endif # include <curses_colr/curses.h> #else # include <curses.h> @@ -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; |