@@ -151,6 +151,27 @@ quad_to_quad_strided_loop_aligned(PyArrayMethod_Context *context, char *const da
151
151
return 0 ;
152
152
}
153
153
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
+
154
175
// Tag dispatching to ensure npy_bool/npy_ubyte and npy_half/npy_ushort do not alias in templates
155
176
// see e.g. https://stackoverflow.com/q/32522279
156
177
struct spec_npy_bool {};
@@ -783,26 +804,6 @@ add_cast_to(PyArray_DTypeMeta *from)
783
804
add_spec (spec);
784
805
}
785
806
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
-
806
807
PyArrayMethod_Spec **
807
808
init_casts_internal (void )
808
809
{
@@ -843,7 +844,6 @@ init_casts_internal(void)
843
844
};
844
845
add_spec (void_spec);
845
846
846
- add_cast_to<npy_bool>(&PyArray_BoolDType);
847
847
add_cast_to<spec_npy_bool>(&PyArray_BoolDType);
848
848
add_cast_to<npy_byte>(&PyArray_ByteDType);
849
849
add_cast_to<npy_ubyte>(&PyArray_UByteDType);
0 commit comments