diff options
author | Chris Kerr <cjk34@cam.ac.uk> | 2014-11-17 20:34:11 +0100 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-12-10 20:23:11 +0100 |
commit | 69265b8601ed72c558d033ecef4d6157b052da05 (patch) | |
tree | ab73441fd24ac96a56487e18bf7ad931497fa256 /numpy/f2py/src/fortranobject.c | |
parent | 54bb07b723f6c1fc508e5021de8ef261ae366f6a (diff) | |
download | numpy-69265b8601ed72c558d033ecef4d6157b052da05.tar.gz |
MAINT: Update printf statements in fortranobject.c
Using NPY_INTP_FMT to format PyArray_ITEMSIZE
Diffstat (limited to 'numpy/f2py/src/fortranobject.c')
-rw-r--r-- | numpy/f2py/src/fortranobject.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/numpy/f2py/src/fortranobject.c b/numpy/f2py/src/fortranobject.c index 37b0b0e62..fa9792c49 100644 --- a/numpy/f2py/src/fortranobject.c +++ b/numpy/f2py/src/fortranobject.c @@ -553,9 +553,9 @@ 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", + fprintf(stderr,"copied an array: size=%ld, elsize=%"NPY_INTP_FMT"\n", arr_size, PyArray_ITEMSIZE(arr)); } } @@ -723,8 +723,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, + PyArray_ITEMSIZE(arr) ); PyErr_SetString(PyExc_ValueError,mess); return NULL; @@ -763,7 +765,8 @@ 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) ); |