Suraj Kurapati
2/27/2006 5:00:00 AM
-----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-----