summaryrefslogtreecommitdiff
path: root/ext/curses
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-12 17:47:53 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-12 17:47:53 +0000
commit562ddea6ba128fb4513bf2d88fc57d547c85391c (patch)
treec8150258b88a879fb65d6ebd32d6d78987f76330 /ext/curses
parent4627c5a19bca043c2e35aa84df68e133e0009530 (diff)
* ext/curses/curses.c (window_subwin): call NUM2INT() before
GetWINDOW(). fixed: [ruby-dev:25161] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/curses')
-rw-r--r--ext/curses/curses.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index 0408fbd6bc..a8952bf186 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -766,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;