# Problem with rbgtkitemfactory.c on 64bit platforms

**URL:** <https://www.ruby-forum.com/t/problem-with-rbgtkitemfactory-c-on-64bit-platforms/196294>\
**Category:** Ruby-Gnome 2\
**Created:** [October 11, 2010, 12:18am UTC](https://www.ruby-forum.com/t/problem-with-rbgtkitemfactory-c-on-64bit-platforms/196294 "2010-10-11T00:18:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Grant\_McLean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/87869e/32.png) [@Grant\_McLean](https://www.ruby-forum.com/u/Grant_McLean)\
**Post date:** [October 11, 2010, 12:18am UTC](https://www.ruby-forum.com/t/problem-with-rbgtkitemfactory-c-on-64bit-platforms/196294/1 "2010-10-11T00:18:50Z")

</div>

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 to`int’  
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 --------

---

<div class="post-metadata">

**Author:** ![Grant\_McLean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/87869e/32.png) [@Grant\_McLean](https://www.ruby-forum.com/u/Grant_McLean)\
**Post date:** [October 12, 2010, 3:32am UTC](https://www.ruby-forum.com/t/problem-with-rbgtkitemfactory-c-on-64bit-platforms/196294/2 "2010-10-12T03:32:50Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] Problem with rbgtkitemfactory.c on 64bit  
platforms” on Mon, 11 Oct 2010 10:59:11 +1300,  
Grant McLean [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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 to `int’  
> 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

---

<div class="post-metadata">

**Author:** ![Grant\_McLean](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/87869e/32.png) [@Grant\_McLean](https://www.ruby-forum.com/u/Grant_McLean)\
**Post date:** [October 18, 2010, 2:02am UTC](https://www.ruby-forum.com/t/problem-with-rbgtkitemfactory-c-on-64bit-platforms/196294/3 "2010-10-18T02:02:14Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] Problem with rbgtkitemfactory.c on 64bit  
platforms” on Thu, 14 Oct 2010 21:55:18 -0400,  
Steve W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) 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
