From: KUBO T. <ku...@ji...> - 2002-08-21 03:33:34
|
Hi, KUBO Takehiro <ku...@ji...> writes: >> Masao Mutoh <mu...@hi...> writes: >> >>>> (2) integer too big >>>> >>>> ./drawing.rb:34:in `window': integer 1073891760 too big to convert to `int' (RangeError) (snip) > Hmm, my brain had stopped. > The 34th line of brawing.rb is 'b = Gdk::Pixmap::new(w.window, g[2], g[3], -1)'. > I made patch for Gdk::Pixmap::new. But error occurs at 'w.window'. I checked configure.in of glib1.2 and fount that sizeof(int) is sizeof(gint) indeed. My assumption 'sizeof(int) < sizeof(gint) == sizeof(long) == sizeof(void *)' is derived from my misunderstanding that error occurs at Gdk::Pixmap::new. As a result, >> If my assumption is correct, use NUM2LONG instead of NUM2INT for gint >> value. is not true. > I saw rbgdk.c. ... tricky :-< > It doesn't work on the platform 'sizeof(int) != sizeof(long)' obviously. sizeof(int) < sizeof(VALUE) > I made patch for rbgdk.c: > http://www.jiubao.org/tmp/0821.dif > But I don't touch other files. This patch will not fix all of the 2nd > problem. I did mistake again. 'LONG2NUM' is not defined in ruby 1.6. Sorry, I didn't compile test. Please delete the previous patch and apply following one: http://www.jiubao.org/tmp/0821-2.dif I hope this will fix all of the 2nd problem. I already did many mistakes. ;-( |