ruby-numo / numo-narray

Ruby/Numo::NArray - New NArray class library
http://ruby-numo.github.io/narray/
BSD 3-Clause "New" or "Revised" License
413 stars 41 forks source link

Use rb_cObject instead of rb_cData #201

Closed kojix2 closed 2 years ago

kojix2 commented 2 years ago

Hello. Thank you for maintaining this wonderful library. Understanding the source code of Numo::NArray, even partially, has been a dream of mine since I started programming.

When I compiled NArray from the source code, I noticed the following warning.

../../../../../ext/numo/narray/array.c:361:5: warning: ‘rb_cData’ is deprecated: by: rb_cObject.  Will be removed in 3.1. [-Wdeprecated-declarations]
  361 |     vmdai = TypedData_Wrap_Struct(rb_cData, &mdai_data_type, (void*)mdai);
      |     ^~~~~

https://github.com/ruby-numo/numo-narray/blob/6f5c91250c0cb948f6b811385d384c3f15af4dcd/ext/numo/narray/array.c#L361

So we created a pull request to change rb_cData to rb_cObject. This is the first pull request for the Numo::NArray C code. Please check if this simple replacement is appropriate for NArray. Thank you in advance.

Best regards

mrkn commented 2 years ago

@masa16 Could you merge this and release the new version? rb_cData has already been removed from CRuby's master branch, so numo-narray cannot support Ruby 3.2 if nothing to do.

array.c:361:35: error: ‘rb_cData’ undeclared (first use in this function)
361 |     vmdai = TypedData_Wrap_Struct(rb_cData, &mdai_data_type,
(void*)mdai);
      |                                   ^~~~~~~~
kojix2 commented 2 years ago

Thanks. @masa16, numo-narray is a special gem. I think It is more important than any other gem. I am afraid that the development of numo-narray will stop. If possible, please give the right to commit to the people who would be your successor. I would also like to offer some support for numo-narray. I think this project is worth it. (Even if you don't think so)