Problem with rbgtkitemfactory.c on 64bit platforms

Hi

I had a report from Steve W. that attempting to use SSHMenu on
FreeBSD gave the error:

/usr/local/lib/ruby/site_ruby/1.8/sshmenu.rb:877:in initialize': integer 34382765312 too big to convert toint’
from /usr/local/lib/ruby/site_ruby/1.8/sshmenu.rb:877:in `new’

We tracked this down to a call to Gtk::ItemFactory and Steve was then
able to fix the problem by changing a FIX2INT call in rbgtkitemfactory.c
to FIX2LONG.

I am aware that Gtk::ItemFactory is deprecated and plan to remove it
from SSHMenu in a future release.

As long as ruby-gnome2 includes rbgtkitemfactory.c it probably ought to
be patched to work on 64bit systems. I’m pretty sure the attached patch
is what Steve described.

Cheers
Grant

-------- Forwarded Message --------

Hi,

In [email protected]
“[ruby-gnome2-devel-en] Problem with rbgtkitemfactory.c on 64bit
platforms” on Mon, 11 Oct 2010 10:59:11 +1300,
Grant McLean [email protected] wrote:

I had a report from Steve W. that attempting to use SSHMenu on
FreeBSD gave the error:

/usr/local/lib/ruby/site_ruby/1.8/sshmenu.rb:877:in initialize': integer 34382765312 too big to convert toint’
from /usr/local/lib/ruby/site_ruby/1.8/sshmenu.rb:877:in `new’

We tracked this down to a call to Gtk::ItemFactory and Steve was then
able to fix the problem by changing a FIX2INT call in rbgtkitemfactory.c
to FIX2LONG.

I’ve fixed it by using NUM2UINT() instead of FIX2INT().
Thanks for reporting!


kou

Hi,

In [email protected]
“Re: [ruby-gnome2-devel-en] Problem with rbgtkitemfactory.c on 64bit
platforms” on Thu, 14 Oct 2010 21:55:18 -0400,
Steve W. [email protected] wrote:

I had a report from Steve W. that attempting to use SSHMenu on
I’ve fixed it by using NUM2UINT() instead of FIX2INT().
Thanks for reporting!

Actually, further testing makes me think this needs to be NUM2ULONG. It
failed again otherwise. Do you think that would be right?

You’re right. I’ve fixed it to use NUM2ULONG().

Thanks!

kou

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs