* ext/curses/curses.c (NUM2CH, CH2FIX): use single char strings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2006-07-28 08:18:22 +00:00
parent 35526b1b00
commit dab5f82b81
2 changed files with 18 additions and 16 deletions

View File

@ -1,16 +1,20 @@
Fri Jul 28 17:18:03 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/curses/curses.c (NUM2CH, CH2FIX): use single char strings.
Fri Jul 28 14:09:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org> Fri Jul 28 14:09:14 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_call): fixed typo in cache look-up. [ruby-dev:29167] * eval.c (rb_call): fixed typo in cache look-up. [ruby-dev:29167]
Fri Jul 28 10:41:35 2006 Yukihiro Matsumoto <matz@ruby-lang.org> Fri Jul 28 10:41:35 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_call): a bug in method cache look-up. * eval.c (rb_call): a bug in method cache look-up.
http://www.rubyist.net/~matz/20060720.html#c04 http://www.rubyist.net/~matz/20060720.html#c04
Fri Jul 28 10:19:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org> Fri Jul 28 10:19:28 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* sprintf.c (rb_f_sprintf): documentation update patch from Jacob * sprintf.c (rb_f_sprintf): documentation update patch from Jacob
Fugal <lukfugl at gmail.com>. [ruby-core:08418] Fugal <lukfugl at gmail.com>. [ruby-core:08418]
Fri Jul 28 09:41:45 2006 Yukihiro Matsumoto <matz@ruby-lang.org> Fri Jul 28 09:41:45 2006 Yukihiro Matsumoto <matz@ruby-lang.org>

View File

@ -54,8 +54,8 @@
# define USE_MOUSE 1 # define USE_MOUSE 1
#endif #endif
#define NUM2CH NUM2LONG #define NUM2CH NUM2CHR
#define CH2FIX LONG2FIX #define CH2FIX CHR2FIX
static VALUE mCurses; static VALUE mCurses;
static VALUE mKey; static VALUE mKey;
@ -77,7 +77,7 @@ static VALUE window_attron();
static VALUE window_attrset(); static VALUE window_attrset();
static void static void
no_window() no_window(void)
{ {
rb_raise(rb_eRuntimeError, "already closed window"); rb_raise(rb_eRuntimeError, "already closed window");
} }
@ -118,7 +118,7 @@ prep_window(VALUE class, WINDOW *window)
/* def init_screen */ /* def init_screen */
static VALUE static VALUE
curses_init_screen() curses_init_screen(void)
{ {
rb_secure(4); rb_secure(4);
if (rb_stdscr) return rb_stdscr; if (rb_stdscr) return rb_stdscr;
@ -136,7 +136,7 @@ curses_init_screen()
/* def close_screen */ /* def close_screen */
static VALUE static VALUE
curses_close_screen() curses_close_screen(void)
{ {
#ifdef HAVE_ISENDWIN #ifdef HAVE_ISENDWIN
if (!isendwin()) if (!isendwin())
@ -161,7 +161,7 @@ curses_finalize(VALUE dummy)
/* def closed? */ /* def closed? */
static VALUE static VALUE
curses_closed() curses_closed(void)
{ {
#ifdef HAVE_ISENDWIN #ifdef HAVE_ISENDWIN
if (isendwin()) { if (isendwin()) {
@ -184,7 +184,7 @@ curses_clear(VALUE obj)
/* def clrtoeol */ /* def clrtoeol */
static VALUE static VALUE
curses_clrtoeol() curses_clrtoeol(void)
{ {
curses_stdscr(); curses_stdscr();
clrtoeol(); clrtoeol();
@ -453,13 +453,13 @@ curses_keyname(VALUE obj, VALUE c)
} }
static VALUE static VALUE
curses_lines() curses_lines(void)
{ {
return INT2FIX(LINES); return INT2FIX(LINES);
} }
static VALUE static VALUE
curses_cols() curses_cols(void)
{ {
return INT2FIX(COLS); return INT2FIX(COLS);
} }
@ -619,7 +619,7 @@ struct mousedata {
}; };
static void static void
no_mevent() no_mevent(void)
{ {
rb_raise(rb_eRuntimeError, "no such mouse event"); rb_raise(rb_eRuntimeError, "no such mouse event");
} }
@ -953,9 +953,7 @@ window_begx(VALUE obj)
/* def box(vert, hor) */ /* def box(vert, hor) */
static VALUE static VALUE
window_box(argc, argv, self) window_box(int argc, VALUE *argv, VALUE self)
int argc;
VALUE argv[], self;
{ {
struct windata *winp; struct windata *winp;
VALUE vert, hor, corn; VALUE vert, hor, corn;
@ -1360,7 +1358,7 @@ window_timeout(VALUE obj, VALUE delay)
/*------------------------- Initialization -------------------------*/ /*------------------------- Initialization -------------------------*/
void void
Init_curses() Init_curses(void)
{ {
mCurses = rb_define_module("Curses"); mCurses = rb_define_module("Curses");
mKey = rb_define_module_under(mCurses, "Key"); mKey = rb_define_module_under(mCurses, "Key");