@@ -320,20 +320,19 @@ macro_rules! impl_array_type {
320320 ( $( ( $offset: expr, $tname: ident) ) ,* ) => {
321321 /// All type objects that numpy has.
322322 #[ allow( non_camel_case_types) ]
323- #[ repr( i32 ) ]
324- pub enum ArrayType { $( $tname) ,* }
323+ pub enum NpyTypes { $( $tname) ,* }
325324 impl PyArrayAPI {
326325 /// Get the pointer of the type object that `self` refers.
327- pub unsafe fn get_type_object( & self , ty: ArrayType ) -> * mut PyTypeObject {
326+ pub unsafe fn get_type_object( & self , ty: NpyTypes ) -> * mut PyTypeObject {
328327 match ty {
329- $( ArrayType :: $tname => * ( self . get( $offset) ) as * mut PyTypeObject ) ,*
328+ $( NpyTypes :: $tname => * ( self . get( $offset) ) as _ ) ,*
330329 }
331330 }
332331 }
333332 }
334- } // impl_array_type!;
333+ }
335334
336- impl_array_type ! (
335+ impl_array_type ! {
337336 ( 1 , PyBigArray_Type ) ,
338337 ( 2 , PyArray_Type ) ,
339338 ( 3 , PyArrayDescr_Type ) ,
@@ -373,18 +372,18 @@ impl_array_type!(
373372 ( 37 , PyStringArrType_Type ) ,
374373 ( 38 , PyUnicodeArrType_Type ) ,
375374 ( 39 , PyVoidArrType_Type )
376- ) ;
375+ }
377376
378377/// Checks that `op` is an instance of `PyArray` or not.
379378#[ allow( non_snake_case) ]
380379pub unsafe fn PyArray_Check ( op : * mut PyObject ) -> c_int {
381- ffi:: PyObject_TypeCheck ( op, PY_ARRAY_API . get_type_object ( ArrayType :: PyArray_Type ) )
380+ ffi:: PyObject_TypeCheck ( op, PY_ARRAY_API . get_type_object ( NpyTypes :: PyArray_Type ) )
382381}
383382
384383/// Checks that `op` is an exact instance of `PyArray` or not.
385384#[ allow( non_snake_case) ]
386385pub unsafe fn PyArray_CheckExact ( op : * mut PyObject ) -> c_int {
387- ( ffi:: Py_TYPE ( op) == PY_ARRAY_API . get_type_object ( ArrayType :: PyArray_Type ) ) as c_int
386+ ( ffi:: Py_TYPE ( op) == PY_ARRAY_API . get_type_object ( NpyTypes :: PyArray_Type ) ) as _
388387}
389388
390389#[ test]
0 commit comments