Permalink
Browse files

Updating to Ruby 1.9 (RSTRING, RARRAY macros + Complex)

Signed-off-by: Matthew King <automatthew@gmail.com>
  • Loading branch information...
Alex Gutteridge authored and automatthew committed Feb 11, 2009
1 parent 47e8466 commit 4e47960c85435e2e7b3afaeb77ddf0c3ad32cefc
Showing with 3 additions and 11 deletions.
  1. +2 −10 ext/Converters.c
  2. +1 −1 test/tc_to_r.rb
View
@@ -199,12 +199,6 @@ hash_to_R(VALUE obj)
VALUE keys, values;
SEXP robj, names;
//TODO - Baffling. Not sure what's wrong with these functions?
//rb_hash_keys(proc_table);
//rb_hash_values(proc_table);
//rb_hash_size(proc_table);
//compiles, but complains they are undefined symbols when run...
if (FIX2INT(rb_funcall(obj,rb_intern("size"),0)) == 0)
return R_NilValue;
@@ -377,10 +371,8 @@ to_ruby_vector(SEXP robj, VALUE *obj, int mode)
case CPLXSXP:
complexes = COMPLEX(robj);
params[0] = rb_float_new(complexes[i].r);
params[1] = rb_float_new(complexes[i].i);
if (!(it = rb_class_new_instance(2, params, rb_const_get(rb_cObject, rb_intern("Complex")))))
if (!(it = rb_complex_new(rb_float_new(complexes[i].r),
rb_float_new(complexes[i].i))))
return -1;
break;
View
@@ -115,7 +115,7 @@ def test_not_convertible
def test_instances_not_convertible
foo = Foo.new
assert_raises(ArgumentError){@r.c(foo)}
end
end
def test_as_r_method
@r.c.autoconvert(RSRuby::BASIC_CONVERSION)

0 comments on commit 4e47960

Please sign in to comment.