@@ -44,12 +44,6 @@ static PyArray_Descr* dbf2np[DBF_MENU+1];
4444 #define PyDataType_ELSIZE (descr ) ((descr)->elsize)
4545 #define PyDataType_SET_ELSIZE (descr , size ) (descr)->elsize = size
4646#endif
47- #ifndef NPY_CARRAY_RO
48- #define NPY_CARRAY_RO NPY_ARRAY_CARRAY_RO
49- #endif
50- #ifndef NPY_CARRAY
51- #define NPY_CARRAY NPY_ARRAY_CARRAY
52- #endif
5347#endif
5448
5549typedef struct {
@@ -164,7 +158,7 @@ static int assign_array(DBADDR *paddr, PyObject *arr)
164158 }
165159
166160 Py_XINCREF (desc );
167- if (!(aval = PyArray_FromAny (arr , desc , 1 , 2 , NPY_CARRAY , arr )))
161+ if (!(aval = PyArray_FromAny (arr , desc , 1 , 2 , NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_ALIGNED | NPY_ARRAY_WRITEABLE , arr )))
168162 return 1 ;
169163
170164 if (elemsize != PyArray_ITEMSIZE ((PyArrayObject * )aval )) {
@@ -219,7 +213,7 @@ static PyObject* pyField_getval(pyField *self)
219213
220214 if (self -> addr .no_elements > 1 ) {
221215 return build_array ((PyObject * )self , rawfield , self -> addr .field_type ,
222- noe , NPY_CARRAY_RO );
216+ noe , NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_ALIGNED );
223217 }
224218 }
225219
@@ -374,7 +368,7 @@ static PyObject *pyField_getarray(pyField *self)
374368 } else
375369 data = self -> addr .pfield ;
376370
377- return build_array ((PyObject * )self , data , self -> addr .field_type , self -> addr .no_elements , NPY_CARRAY );
371+ return build_array ((PyObject * )self , data , self -> addr .field_type , self -> addr .no_elements , NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_ALIGNED | NPY_ARRAY_WRITEABLE );
378372}
379373
380374static PyObject * pyField_getlen (pyField * self )
0 commit comments