ext/numo/narray/ndloop.c in numo-narray-0.9.1.2 vs ext/numo/narray/ndloop.c in numo-narray-0.9.1.3
- old
+ new
@@ -212,11 +212,11 @@
static int
ndloop_cast_required(VALUE type, VALUE value)
{
- return CASTABLE(type) && type != CLASS_OF(value);
+ return CASTABLE(type) && type != rb_obj_class(value);
}
static int
ndloop_castable_type(VALUE type)
{
@@ -655,11 +655,11 @@
{
int i;
narray_t *na;
// type check
- if (type != CLASS_OF(v)) {
+ if (type != rb_obj_class(v)) {
return 0;
}
GetNArray(v,na);
// shape check
if (na->ndim != na_ndim) {
@@ -722,11 +722,11 @@
rb_bug("invalid type: index (%d) out of # of args",i);
}
t = nf->ain[i].type;
// if i-th type is Qnil, get the type of i-th input value
if (!CASTABLE(t)) {
- t = CLASS_OF(RARRAY_AREF(args,i));
+ t = rb_obj_class(RARRAY_AREF(args,i));
}
}
return t;
}
@@ -1390,11 +1390,11 @@
loop_end:
;
}
-VALUE
+static VALUE
na_ndloop_main(ndfunc_t *nf, VALUE args, void *opt_ptr)
{
unsigned int copy_flag;
na_md_loop_t lp;
@@ -1493,11 +1493,11 @@
narray_t *na;
GetNArray(ary,na);
nd = na->ndim;
- buf = rb_str_new2(rb_class2name(CLASS_OF(ary)));
+ buf = rb_str_new2(rb_class2name(rb_obj_class(ary)));
if (NA_TYPE(na) == NARRAY_VIEW_T) {
rb_str_cat(buf,"(view)",6);
}
rb_str_cat(buf,"#shape=[",8);
if (nd>0) {
@@ -1642,11 +1642,11 @@
int i, j;
narray_t *na;
int *dim_map;
VALUE a_type;
- a_type = CLASS_OF(LARG(lp,0).value);
- if (CLASS_OF(a) != a_type) {
+ a_type = rb_obj_class(LARG(lp,0).value);
+ if (rb_obj_class(a) != a_type) {
a = rb_funcall(a_type, id_cast, 1, a);
}
GetNArray(a,na);
if (na->ndim != nd-i0+1) {
rb_raise(nary_eShapeError, "mismatched dimension of sub-narray: "