ext/octave_api/or-hash.cpp in octave-ruby-1.0.9 vs ext/octave_api/or-hash.cpp in octave-ruby-2.0.0

- old
+ new

@@ -5,19 +5,19 @@ octave_value OR_Hash::to_octave() { int i; VALUE names = rb_funcall(ruby_val, rb_intern("keys"), 0); - int number_of_keys = RARRAY(names)->len; + int number_of_keys = RARRAY_LEN(names); string_vector keys = string_vector(); for (i = 0; i < number_of_keys; i++) { - keys.append(std::string(RSTRING(RARRAY(names)->ptr[i])->ptr)); + keys.append(std::string(RSTRING_PTR(RARRAY_PTR(names)[i]))); } Octave_map struct_matrix = Octave_map(dim_vector(1, 1), Cell(keys)); for (i = 0; i < number_of_keys; i++) { - struct_matrix.contents(std::string(RSTRING(RARRAY(names)->ptr[i])->ptr)) = OR_Variable(rb_hash_aref(ruby_val, rb_str_new2(RSTRING(RARRAY(names)->ptr[i])->ptr))).to_octave(); + struct_matrix.contents(std::string(RSTRING_PTR(RARRAY_PTR(names)[i]))) = OR_Variable(rb_hash_aref(ruby_val, rb_str_new2(RSTRING_PTR(RARRAY_PTR(names)[i])))).to_octave(); } return struct_matrix; }