summaryrefslogtreecommitdiff
path: root/numpy/f2py/rules.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/f2py/rules.py')
-rw-r--r--numpy/f2py/rules.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/numpy/f2py/rules.py b/numpy/f2py/rules.py
index 4c186712c..b46776777 100644
--- a/numpy/f2py/rules.py
+++ b/numpy/f2py/rules.py
@@ -109,6 +109,8 @@ module_rules={
* $D"""+"""ate:$
* Do not edit this file directly unless you know what you are doing!!!
*/
+
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#ifdef __cplusplus
extern \"C\" {
#endif
@@ -232,6 +234,7 @@ PyMODINIT_FUNC init#modulename#(void) {
#ifdef __cplusplus
}
#endif
+#undef NPY_NO_DEPRECATED_API
""",
'separatorsfor':{'latexdoc':'\n\n',
'restdoc':'\n\n'},
@@ -1027,9 +1030,9 @@ if (#varname#_capi==Py_None) {
# \tif ((#varname#_capi != Py_None) && PyArray_Check(#varname#_capi) \\
# \t\t&& (#varname#_capi != (PyObject *)capi_#varname#_tmp)) {
-# \t\tif (((PyArrayObject *)#varname#_capi)->nd != capi_#varname#_tmp->nd) {
-# \t\t\tif (#varname#_capi != capi_#varname#_tmp->base)
-# \t\t\t\tcopy_ND_array((PyArrayObject *)capi_#varname#_tmp->base,(PyArrayObject *)#varname#_capi);
+# \t\tif (PyArray_NDIM((PyArrayObject *)#varname#_capi) != PyArray_NDIM(capi_#varname#_tmp)) {
+# \t\t\tif (#varname#_capi != PyArray_BASE(capi_#varname#_tmp))
+# \t\t\t\tcopy_ND_array(PyArray_BASE((PyArrayObject *)capi_#varname#_tmp),(PyArrayObject *)#varname#_capi);
# \t\t} else
# \t\t\tcopy_ND_array(capi_#varname#_tmp,(PyArrayObject *)#varname#_capi);
# \t}
@@ -1047,7 +1050,7 @@ if (#varname#_capi==Py_None) {
\t\tif (!PyErr_Occurred())
\t\t\tPyErr_SetString(#modulename#_error,\"failed in converting #nth# `#varname#\' of #pyname# to C/Fortran array\" );
\t} else {
-\t\t#varname# = (#ctype# *)(capi_#varname#_tmp->data);
+\t\t#varname# = (#ctype# *)(PyArray_DATA(capi_#varname#_tmp));
""",
{hasinitvalue:[
{isintent_nothide:'\tif (#varname#_capi == Py_None) {'},
@@ -1056,7 +1059,7 @@ if (#varname#_capi==Py_None) {
"""\
\t\tint *_i,capi_i=0;
\t\tCFUNCSMESS(\"#name#: Initializing #varname#=#init#\\n\");
-\t\tif (initforcomb(capi_#varname#_tmp->dimensions,capi_#varname#_tmp->nd,1)) {
+\t\tif (initforcomb(PyArray_DIMS(capi_#varname#_tmp),PyArray_NDIM(capi_#varname#_tmp),1)) {
\t\t\twhile ((_i = nextforcomb()))
\t\t\t\t#varname#[capi_i++] = #init#; /* fortran way */
\t\t} else {