@@ -151,6 +151,27 @@ quad_to_quad_strided_loop_aligned(PyArrayMethod_Context *context, char *const da
151151 return 0 ;
152152}
153153
154+
155+ static NPY_CASTING
156+ void_to_quad_resolve_descriptors (PyObject *NPY_UNUSED (self), PyArray_DTypeMeta *dtypes[2],
157+ PyArray_Descr *given_descrs[2], PyArray_Descr *loop_descrs[2],
158+ npy_intp *view_offset)
159+ {
160+ PyErr_SetString (PyExc_TypeError,
161+ " Void to QuadPrecision cast is not implemented" );
162+ return (NPY_CASTING)-1 ;
163+ }
164+
165+ static int
166+ void_to_quad_strided_loop (PyArrayMethod_Context *context, char *const data[],
167+ npy_intp const dimensions[], npy_intp const strides[],
168+ void *NPY_UNUSED (auxdata))
169+ {
170+ PyErr_SetString (PyExc_RuntimeError, " void_to_quad_strided_loop should not be called" );
171+ return -1 ;
172+ }
173+
174+
154175// Tag dispatching to ensure npy_bool/npy_ubyte and npy_half/npy_ushort do not alias in templates
155176// see e.g. https://stackoverflow.com/q/32522279
156177struct spec_npy_bool {};
@@ -783,26 +804,6 @@ add_cast_to(PyArray_DTypeMeta *from)
783804 add_spec (spec);
784805}
785806
786- static NPY_CASTING
787- void_to_quad_resolve_descriptors (PyObject *NPY_UNUSED (self), PyArray_DTypeMeta *dtypes[2],
788- PyArray_Descr *given_descrs[2], PyArray_Descr *loop_descrs[2],
789- npy_intp *view_offset)
790- {
791- PyErr_SetString (PyExc_TypeError,
792- " Cannot cast void dtype to QuadPrecDType. "
793- " Void arrays contain arbitrary binary data that cannot be meaningfully converted to quad-precision floats." );
794- return (NPY_CASTING)-1 ;
795- }
796-
797- static int
798- void_to_quad_strided_loop (PyArrayMethod_Context *context, char *const data[],
799- npy_intp const dimensions[], npy_intp const strides[],
800- void *NPY_UNUSED (auxdata))
801- {
802- PyErr_SetString (PyExc_RuntimeError, " void_to_quad_strided_loop should not be called" );
803- return -1 ;
804- }
805-
806807PyArrayMethod_Spec **
807808init_casts_internal (void )
808809{
@@ -843,7 +844,6 @@ init_casts_internal(void)
843844 };
844845 add_spec (void_spec);
845846
846- add_cast_to<npy_bool>(&PyArray_BoolDType);
847847 add_cast_to<spec_npy_bool>(&PyArray_BoolDType);
848848 add_cast_to<npy_byte>(&PyArray_ByteDType);
849849 add_cast_to<npy_ubyte>(&PyArray_UByteDType);
0 commit comments