[#5563] Non-overridable and non-redefinable methods — Eric Mahurin <eric_mahurin@...>

Lately, I've been thinking about the future of ruby

44 messages 2005/08/19
[#5564] Re: Non-overridable and non-redefinable methods — Austin Ziegler <halostatue@...> 2005/08/19

On 8/19/05, Eric Mahurin <eric_mahurin@yahoo.com> wrote:

[#5571] Re: Non-overridable and non-redefinable methods — Eric Mahurin <eric_mahurin@...> 2005/08/19

--- Austin Ziegler <halostatue@gmail.com> wrote:

[#5574] Re: Non-overridable and non-redefinable methods — TRANS <transfire@...> 2005/08/20

Just wanted to add a few things.

[#5581] Re: Non-overridable and non-redefinable methods — Austin Ziegler <halostatue@...> 2005/08/20

On 8/19/05, TRANS <transfire@gmail.com> wrote:

[#5583] Re: Non-overridable and non-redefinable methods — "David A. Black" <dblack@...> 2005/08/20

Hi --

[#5585] Re: Non-overridable and non-redefinable methods — Eric Mahurin <eric_mahurin@...> 2005/08/20

--- "David A. Black" <dblack@wobblini.net> wrote:

[#5609] Pathname#walk for traversing path nodes (patch) — ES <ruby-ml@...>

Here is a small addition to Pathname against 1.9, probably suited

20 messages 2005/08/22

Re: [ ruby-Bugs-2298 ] Curses bkgd functions loose their high bits when converting

From: "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>
Date: 2005-08-25 08:27:09 UTC
List: ruby-core #5677
Hi.

Umm, chtype in curses seems not to be `char' rather `long'.

Probably, patch is needed for other functions using chtype.

CAUTION: I'm not using curses, so this patch is not checked yet. (even compile)

# And maybe it's enough to use NUM2LONG directory instead of defining NUM2CH.

Index: curses.c
===================================================================
RCS file: /src/ruby/ext/curses/curses.c,v
retrieving revision 1.29
diff -u -w -b -p -r1.29 curses.c
--- curses.c	7 Jun 2005 15:02:32 -0000	1.29
+++ curses.c	25 Aug 2005 06:16:21 -0000
@@ -54,6 +54,9 @@
 # define USE_MOUSE 1
 #endif
 
+#define NUM2CH NUM2LONG
+#define CH2FIX LONG2FIX
+
 static VALUE mCurses;
 static VALUE mKey;
 static VALUE cWindow;
@@ -362,7 +365,7 @@ curses_inch(obj)
     VALUE obj;
 {
     curses_stdscr();
-    return CHR2FIX(inch());
+    return CH2FIX(inch());
 }
 
 /* def addch(ch) */
@@ -372,7 +375,7 @@ curses_addch(obj, ch)
     VALUE ch;
 {
     curses_stdscr();
-    addch(NUM2CHR(ch));
+    addch(NUM2CH(ch));
     return Qnil;
 }
 
@@ -383,7 +386,7 @@ curses_insch(obj, ch)
     VALUE ch;
 {
     curses_stdscr();
-    insch(NUM2CHR(ch));
+    insch(NUM2CH(ch));
     return Qnil;
 }
 
@@ -547,7 +550,7 @@ static VALUE
 curses_bkgdset(VALUE obj, VALUE ch)
 {
 #ifdef HAVE_BKGDSET
-  bkgdset(NUM2CHR(ch));
+  bkgdset(NUM2CH(ch));
 #endif
   return Qnil;
 }
@@ -556,7 +559,7 @@ static VALUE
 curses_bkgd(VALUE obj, VALUE ch)
 {
 #ifdef HAVE_BKGD
-  return (bkgd(NUM2CHR(ch)) == OK) ? Qtrue : Qfalse;
+  return (bkgd(NUM2CH(ch)) == OK) ? Qtrue : Qfalse;
 #else
   return Qfalse;
 #endif
@@ -1002,13 +1005,13 @@ window_box(argc, argv, self)
     rb_scan_args(argc, argv, "21", &vert, &hor, &corn);
 
     GetWINDOW(self, winp);
-    box(winp->window, NUM2CHR(vert), NUM2CHR(hor));
+    box(winp->window, NUM2CH(vert), NUM2CH(hor));
 
     if (!NIL_P(corn)) {
       int cur_x, cur_y, x, y;
-      char c;
+      chtype c;
 
-      c = NUM2CHR(corn);
+      c = NUM2CH(corn);
       getyx(winp->window, cur_y, cur_x);
       x = NUM2INT(window_maxx(self)) - 1;
       y = NUM2INT(window_maxy(self)) - 1;
@@ -1058,7 +1061,7 @@ window_inch(obj)
     struct windata *winp;
     
     GetWINDOW(obj, winp);
-    return CHR2FIX(winch(winp->window));
+    return CH2FIX(winch(winp->window));
 }
 
 /* def addch(ch) */
@@ -1070,7 +1073,7 @@ window_addch(obj, ch)
     struct windata *winp;
     
     GetWINDOW(obj, winp);
-    waddch(winp->window, NUM2CHR(ch));
+    waddch(winp->window, NUM2CH(ch));
     
     return Qnil;
 }
@@ -1084,7 +1087,7 @@ window_insch(obj, ch)
     struct windata *winp;
     
     GetWINDOW(obj, winp);
-    winsch(winp->window, NUM2CHR(ch));
+    winsch(winp->window, NUM2CH(ch));
     
     return Qnil;
 }
@@ -1313,7 +1316,7 @@ window_bkgdset(VALUE obj, VALUE ch)
   struct windata *winp;
 
   GetWINDOW(obj,winp);
-  wbkgdset(winp->window, NUM2CHR(ch));
+  wbkgdset(winp->window, NUM2CH(ch));
 #endif
   return Qnil;
 }
@@ -1325,7 +1328,7 @@ window_bkgd(VALUE obj, VALUE ch)
   struct windata *winp;
 
   GetWINDOW(obj,winp);
-  return (wbkgd(winp->window, NUM2CHR(ch)) == OK) ? Qtrue : Qfalse;
+  return (wbkgd(winp->window, NUM2CH(ch)) == OK) ? Qtrue : Qfalse;
 #else
   return Qfalse;
 #endif
@@ -1335,11 +1338,11 @@ static VALUE
 window_getbkgd(VALUE obj)
 {
 #ifdef HAVE_WGETBKGD
-  char c;
+  chtype c;
   struct windata *winp;
 
   GetWINDOW(obj,winp);
-  return (c = getbkgd(winp->window) != ERR) ? CHR2FIX(c) : Qnil;
+  return (c = getbkgd(winp->window) != ERR) ? CH2FIX(c) : Qnil;
 #else
   return Qnil;
 #endif


In This Thread

Prev Next