summaryrefslogtreecommitdiff
path: root/numpy/f2py/src/fortranobject.c
diff options
context:
space:
mode:
authorRohit Goswami <rog32@hi.is>2021-09-29 06:26:13 +0000
committerGitHub <noreply@github.com>2021-09-29 01:26:13 -0500
commit26ce52951bf176ffb30c1044414036b728e0849d (patch)
tree0c0688f31ba8fd684dc6e5fea30f93d2bf417f05 /numpy/f2py/src/fortranobject.c
parentb0e1a445d3134e4744369ee1a34f7a44fd867578 (diff)
downloadnumpy-26ce52951bf176ffb30c1044414036b728e0849d.tar.gz
MAINT: Reduce DepreciationWarnings, use more data API types for f2py (#19978)
* MAINT: More data type API for f2py * MAINT: Less DeprecationWarnings for f2py * MAINT: Fix casts for complex arrays in f2py
Diffstat (limited to 'numpy/f2py/src/fortranobject.c')
-rw-r--r--numpy/f2py/src/fortranobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/f2py/src/fortranobject.c b/numpy/f2py/src/fortranobject.c
index 4e89cdff1..0b32137ef 100644
--- a/numpy/f2py/src/fortranobject.c
+++ b/numpy/f2py/src/fortranobject.c
@@ -142,7 +142,7 @@ PyFortranObject_New(FortranDataDef *defs, f2py_void_func init)
else if ((fp->defs[i].data) !=
NULL) { /* Is Fortran variable or array (not allocatable) */
if (fp->defs[i].type == NPY_STRING) {
- int n = fp->defs[i].rank - 1;
+ npy_intp n = fp->defs[i].rank - 1;
v = PyArray_New(&PyArray_Type, n, fp->defs[i].dims.d,
NPY_STRING, NULL, fp->defs[i].data,
fp->defs[i].dims.d[n], NPY_ARRAY_FARRAY, NULL);
@@ -195,7 +195,8 @@ static Py_ssize_t
format_def(char *buf, Py_ssize_t size, FortranDataDef def)
{
char *p = buf;
- int i, n;
+ int i;
+ npy_intp n;
n = PyOS_snprintf(p, size, "array(%" NPY_INTP_FMT, def.dims.d[0]);
if (n < 0 || n >= size) {