From: KUBO T. <ku...@ji...> - 2002-08-20 17:20:41
|
Masao Mutoh <mu...@hi...> writes: >> (2) integer too big >> >> ./drawing.rb:34:in `window': integer 1073891760 too big to convert to `int' (RangeError) >> from ./drawing.rb:34:in `configure_event' >> from ./drawing.rb:7:in `initialize' >> from ./drawing.rb:7:in `call' >> from ./drawing.rb:82:in `add' >> from ./drawing.rb:82 > > I can't help you only this information. > Can you use gdb ? I want result of "bt" command. > > Or otherwise, can you replace "int" to "gint"? > #But I don't know it helps you. > >> I suspect this is a 64-bit problem since I'm running on Tru64/Alpha. > > I think you are first ruby-gnome user of 64-bit OS:->. > > And I apologize that I can't try ruby-gnome in Tru64/Alpha .... > I do not have any skills of 64-bit OS. I ported some programs to Tur64/Alpha about half year ago. I want to know size of 'int', 'long', 'gint', 'void *' on Tru64/Alpha. ============ print_size.c ============ #include <stdio.h> #include <glib.h> int main() { printf("sizeof(int) = %d\n", sizeof(int)); printf("sizeof(gint) = %d\n", sizeof(gint)); printf("sizeof(long) = %d\n", sizeof(long)); printf("sizeof(void *) = %d\n", sizeof(void *)); return 0; } ============ print_size.c ============ cc -o print_size `glib-config --cflags` print_size.c ./print_size I assume 'sizeof(int) < sizeof(gint) == sizeof(long) == sizeof(void *)'. If my assumption is correct, use NUM2LONG instead of NUM2INT for gint value. For example: ====================================== --- gtk/src/rbgdkpixmap.c.orig Tue Aug 20 08:11:00 2002 +++ gtk/src/rbgdkpixmap.c Wed Aug 21 01:16:08 2002 @@ -25,7 +25,7 @@ GdkPixmap *new; GdkWindow *window = get_gdkwindow(win); - new = gdk_pixmap_new(window, NUM2INT(w), NUM2INT(h), NUM2INT(depth)); + new = gdk_pixmap_new(window, NUM2LONG(w), NUM2LONG(h), NUM2LONG(depth)); return new_gdkpixmap(new); } ====================================== Almost all codes of Ruby-GNOME use NUM2INT. There are too many codes to fix. :-< |