ext/curses/curses: more whitespace

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@25270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
marcandre 2009-10-08 17:47:51 +00:00
parent c7a8fb0afe
commit d13255aa40

View file

@ -489,9 +489,9 @@ curses_keyname(obj, c)
curses_stdscr();
name = keyname(NUM2INT(c));
if (name) {
return rb_str_new2(name);
return rb_str_new2(name);
} else {
return Qnil;
return Qnil;
}
#else
return Qnil;
@ -625,7 +625,7 @@ curses_init_color(VALUE obj, VALUE color, VALUE r, VALUE g, VALUE b)
/* may have to raise exception on ERR */
curses_stdscr();
return (init_color(NUM2INT(color),NUM2INT(r),
NUM2INT(g),NUM2INT(b)) == OK) ? Qtrue : Qfalse;
NUM2INT(g),NUM2INT(b)) == OK) ? Qtrue : Qfalse;
}
static VALUE
@ -698,7 +698,7 @@ static void
curses_mousedata_free(struct mousedata *mdata)
{
if (mdata->mevent)
free(mdata->mevent);
free(mdata->mevent);
}
static VALUE
@ -709,7 +709,7 @@ curses_getmouse(VALUE obj)
curses_stdscr();
val = Data_Make_Struct(cMouseEvent,struct mousedata,
0,curses_mousedata_free,mdata);
0,curses_mousedata_free,mdata);
mdata->mevent = (MEVENT*)xmalloc(sizeof(MEVENT));
return (getmouse(mdata->mevent) == OK) ? val : Qnil;
}
@ -1063,22 +1063,22 @@ window_box(argc, argv, self)
box(winp->window, NUM2CH(vert), NUM2CH(hor));
if (!NIL_P(corn)) {
int cur_x, cur_y, x, y;
chtype c;
int cur_x, cur_y, x, y;
chtype c;
c = NUM2CH(corn);
getyx(winp->window, cur_y, cur_x);
x = NUM2INT(window_maxx(self)) - 1;
y = NUM2INT(window_maxy(self)) - 1;
wmove(winp->window, 0, 0);
waddch(winp->window, c);
wmove(winp->window, y, 0);
waddch(winp->window, c);
wmove(winp->window, y, x);
waddch(winp->window, c);
wmove(winp->window, 0, x);
waddch(winp->window, c);
wmove(winp->window, cur_y, cur_x);
c = NUM2CH(corn);
getyx(winp->window, cur_y, cur_x);
x = NUM2INT(window_maxx(self)) - 1;
y = NUM2INT(window_maxy(self)) - 1;
wmove(winp->window, 0, 0);
waddch(winp->window, c);
wmove(winp->window, y, 0);
waddch(winp->window, c);
wmove(winp->window, y, x);
waddch(winp->window, c);
wmove(winp->window, 0, x);
waddch(winp->window, c);
wmove(winp->window, cur_y, cur_x);
}
return Qnil;
@ -1430,7 +1430,7 @@ window_keypad(VALUE obj, VALUE val)
#else
/* may have to raise exception on ERR */
return (keypad(winp->window,RTEST(val) ? TRUE : FALSE)) == OK ?
Qtrue : Qfalse;
Qtrue : Qfalse;
#endif
#else
rb_notimplement();
@ -1778,14 +1778,14 @@ Init_curses()
#ifdef KEY_F
/* KEY_F(n) : 0 <= n <= 63 */
{
int i;
char c[8];
for( i=0; i<64; i++ ){
sprintf(c, "KEY_F%d", i);
rb_define_const(mCurses, c, INT2NUM(KEY_F(i)));
sprintf(c, "F%d", i);
rb_define_const(mKey, c, INT2NUM(KEY_F(i)));
}
int i;
char c[8];
for( i=0; i<64; i++ ){
sprintf(c, "KEY_F%d", i);
rb_define_const(mCurses, c, INT2NUM(KEY_F(i)));
sprintf(c, "F%d", i);
rb_define_const(mKey, c, INT2NUM(KEY_F(i)));
}
}
#endif
#ifdef KEY_DL
@ -2121,12 +2121,12 @@ Init_curses()
rb_define_const(mKey, "MAX", INT2NUM(KEY_MAX));
#endif
{
int c;
char name[] = "KEY_CTRL_x";
for( c = 'A'; c <= 'Z'; c++ ){
sprintf(name, "KEY_CTRL_%c", c);
rb_define_const(mCurses, name, INT2FIX(c - 'A' + 1));
}
int c;
char name[] = "KEY_CTRL_x";
for( c = 'A'; c <= 'Z'; c++ ){
sprintf(name, "KEY_CTRL_%c", c);
rb_define_const(mCurses, name, INT2FIX(c - 'A' + 1));
}
}
#undef rb_curses_define_const