summaryrefslogtreecommitdiff
path: root/numpy/f2py/src/fortranobject.c
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2014-12-10 20:23:33 +0100
committerJulian Taylor <jtaylor.debian@googlemail.com>2014-12-10 20:23:33 +0100
commit629735bf25589d5551f9e5c1c5c3194d25511260 (patch)
tree770cfd07311371be5f5b3242cf9c9010d813a34b /numpy/f2py/src/fortranobject.c
parentcf2dc930e7b7f737445e8698041b5d98f6f88c4e (diff)
parent8df7eddd48584606310790be6d8d0d6b36671297 (diff)
downloadnumpy-629735bf25589d5551f9e5c1c5c3194d25511260.tar.gz
Merge pull request #5287 from chatcannon/reconcile-c-api-with-docs
Reconcile C API with docs
Diffstat (limited to 'numpy/f2py/src/fortranobject.c')
-rw-r--r--numpy/f2py/src/fortranobject.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/numpy/f2py/src/fortranobject.c b/numpy/f2py/src/fortranobject.c
index e88e83f0e..47a69640b 100644
--- a/numpy/f2py/src/fortranobject.c
+++ b/numpy/f2py/src/fortranobject.c
@@ -554,10 +554,10 @@ void f2py_report_on_exit(int exit_flag,void *name) {
#ifdef F2PY_REPORT_ON_ARRAY_COPY
static void f2py_report_on_array_copy(PyArrayObject* arr) {
- const long arr_size = PyArray_Size((PyObject *)arr);
+ const npy_intp arr_size = PyArray_Size((PyObject *)arr);
if (arr_size>F2PY_REPORT_ON_ARRAY_COPY) {
- fprintf(stderr,"copied an array: size=%ld, elsize=%d\n",
- arr_size, PyArray_ITEMSIZE(arr));
+ fprintf(stderr,"copied an array: size=%ld, elsize=%"NPY_INTP_FMT"\n",
+ arr_size, (npy_intp)PyArray_ITEMSIZE(arr));
}
}
static void f2py_report_on_array_copy_fromany(void) {
@@ -724,8 +724,10 @@ PyArrayObject* array_from_pyobj(const int type_num,
if (!PyArray_ISONESEGMENT(arr))
strcat(mess, " -- input must be in one segment");
if (PyArray_ITEMSIZE(arr)<elsize)
- sprintf(mess+strlen(mess)," -- expected at least elsize=%d but got %d",
- elsize,PyArray_ITEMSIZE(arr)
+ sprintf(mess+strlen(mess),
+ " -- expected at least elsize=%d but got %" NPY_INTP_FMT,
+ elsize,
+ (npy_intp)PyArray_ITEMSIZE(arr)
);
PyErr_SetString(PyExc_ValueError,mess);
return NULL;
@@ -764,9 +766,10 @@ PyArrayObject* array_from_pyobj(const int type_num,
if (!(intent & F2PY_INTENT_C) && !PyArray_ISFARRAY(arr))
strcat(mess, " -- input not fortran contiguous");
if (PyArray_ITEMSIZE(arr)!=elsize)
- sprintf(mess+strlen(mess)," -- expected elsize=%d but got %d",
+ sprintf(mess+strlen(mess),
+ " -- expected elsize=%d but got %" NPY_INTP_FMT,
elsize,
- PyArray_ITEMSIZE(arr)
+ (npy_intp)PyArray_ITEMSIZE(arr)
);
if (!(ARRAY_ISCOMPATIBLE(arr,type_num)))
sprintf(mess+strlen(mess)," -- input '%c' not compatible to '%c'",