ext/numo/narray/array.c in numo-narray-0.9.1.2 vs ext/numo/narray/array.c in numo-narray-0.9.1.3

- old
+ new

@@ -104,11 +104,11 @@ case T_NIL: return type; default: - if (CLASS_OF(v) == rb_const_get( rb_cObject, id_Complex )) { + if (rb_obj_class(v) == rb_const_get( rb_cObject, id_Complex )) { return NA_DCOMPLEX; } } return NA_ROBJ; } @@ -230,13 +230,13 @@ mdai->item[r].shape = na->shape[j]; } } // type if (NIL_P(mdai->na_type)) { - mdai->na_type = CLASS_OF(v); + mdai->na_type = rb_obj_class(v); } else { - mdai->na_type = na_upcast(CLASS_OF(v), mdai->na_type); + mdai->na_type = na_upcast(rb_obj_class(v), mdai->na_type); } } else { mdai->type = na_mdai_object_type(mdai->type, v); } } @@ -421,11 +421,11 @@ else if (IsNArray(obj)) { int i, ndim; narray_t *na; GetNArray(obj,na); ndim = na->ndim; - dtype = update_type(ptype, CLASS_OF(obj)); + dtype = update_type(ptype, rb_obj_class(obj)); if (pshape) { dshape = rb_ary_new2(ndim); for (i=0; i<ndim; i++) { rb_ary_push(dshape, SIZET2NUM(na->shape[i])); } @@ -434,11 +434,11 @@ if (pnary) { *pnary = nary_new(dtype, ndim, na->shape); } } else { rb_raise(rb_eTypeError,"invalid type for NArray: %s", - rb_class2name(CLASS_OF(obj))); + rb_class2name(rb_obj_class(obj))); } } static VALUE @@ -537,10 +537,10 @@ if (ndim>4) { abort(); } val = mdai->item[ndim].val; //fpintf(stderr,"val = "); rb_p(val); - if (CLASS_OF(val) == mdai->na_type) { + if (rb_obj_class(val) == mdai->na_type) { GetNArray(val,na); if ( ndim+na->ndim > mdai->capa ) { abort(); na_mdai_realloc(mdai,((na->ndim-1)/4+1)*4); }