From: Suraj Kurapati Date: 2006-02-27T13:59:51+09:00 Subject: Re: C Extensions not working on Windows XP 64 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Matt wrote: > I then tried to generate my own example based on some tutorials. Ack! I see some integers being directly stored into a Ruby VALUE. Remember to cast them properly using INT2NUM() or, if you're feeling dangerous, INT2FIX(). > static VALUE simple_initialize(VALUE self, int iValue) > { > rb_iv_set(self,"@i",iValue); rb_iv_set(self,"@i",INT2NUM(iValue)); > static VALUE simple_set_i(VALUE self, int iValue) > { > return rb_iv_set(self,"@i",iValue); return rb_iv_set(self,"@i",INT2NUM(iValue)); -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFEAoaZmV9O7RYnKMcRAqwGAJ9uJueRap0sIm9OXXZBIzsiyNgiXwCfbK8q V9XrCvKOfONVlVEYJxI1Lk0= =RuMj -----END PGP SIGNATURE-----