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 | e1375ab5e61df3a8a706a5165448a72d80a57414 (patch) | |
| tree | 4b7925ef47ab402c627f820ea3ed11a6cd8ede3f /ext | |
| parent | 7aa248f42ce85a729785967247720237f8f4a566 (diff) | |
| download | ruby-e1375ab5e61df3a8a706a5165448a72d80a57414.tar.gz ruby-e1375ab5e61df3a8a706a5165448a72d80a57414.tar.xz ruby-e1375ab5e61df3a8a706a5165448a72d80a57414.zip | |
* 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
Diffstat (limited to 'ext')
| -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 106c43da4..a8952bf18 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; |
