shithub: aubio

Download patch

ref: bb4af3a417de1d2cfc5a0bb0f30f61d6787a244f
parent: 770f7b4984f8c5a8da5aac591cc467e9a3087d7f
author: Paul Brossier <piem@piem.org>
date: Wed May 11 10:37:49 EDT 2016

python/ext/{aubioproxy,py-cvec}.c: use npy_intp, not long

--- a/python/ext/aubioproxy.c
+++ b/python/ext/aubioproxy.c
@@ -46,7 +46,7 @@
       return 0;
     }
 
-    long length = PyArray_SIZE ((PyArrayObject *)input);
+    npy_intp length = PyArray_SIZE ((PyArrayObject *)input);
     if (length <= 0) {
       PyErr_SetString (PyExc_ValueError, "input array size should be greater than 0");
       return 0;
@@ -120,12 +120,12 @@
     }
 
     // no need to really allocate fvec, just its struct member
-    long length = PyArray_DIM ((PyArrayObject *)input, 1);
+    npy_intp length = PyArray_DIM ((PyArrayObject *)input, 1);
     if (length <= 0) {
       PyErr_SetString (PyExc_ValueError, "input array dimension 1 should be greater than 0");
       return 0;
     }
-    long height = PyArray_DIM ((PyArrayObject *)input, 0);
+    npy_intp height = PyArray_DIM ((PyArrayObject *)input, 0);
     if (height <= 0) {
       PyErr_SetString (PyExc_ValueError, "input array dimension 0 should be greater than 0");
       return 0;
--- a/python/ext/py-cvec.c
+++ b/python/ext/py-cvec.c
@@ -143,7 +143,7 @@
   if (!PyAubio_IsValidVector(input)) {
     return 1;
   }
-  long length = PyArray_SIZE ((PyArrayObject *)input);
+  npy_intp length = PyArray_SIZE ((PyArrayObject *)input);
   if (length != vec->length) {
     PyErr_Format (PyExc_ValueError,
         "input array has length %ld, but cvec has length %d", length,
@@ -163,7 +163,7 @@
   if (!PyAubio_IsValidVector(input)) {
     return 1;
   }
-  long length = PyArray_SIZE ((PyArrayObject *)input);
+  npy_intp length = PyArray_SIZE ((PyArrayObject *)input);
   if (length != vec->length) {
     PyErr_Format (PyExc_ValueError,
         "input array has length %ld, but cvec has length %d", length,