History

ext/aubioproxy.c: fix windows c89 compilation

Paul Brossier committed 10 years ago

Commit 911c22f1 parent bb4af3a1 file · +7 −5Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/ext/aubioproxy.c+7−5
@@ -21,6 +21,7 @@ PyAubio_CFvecToArray (fvec_t * self) · 20 unmodified lines
2121
2222 int
2323 PyAubio_IsValidVector (PyObject * input) {
24+ npy_intp length;
2425 if (input == NULL) {
2526 PyErr_SetString (PyExc_ValueError, "input array is not a python object");
2627 return 0;
@@ -46,7 +47,7 @@ PyAubio_IsValidVector (PyObject * input) { · 19 unmodified lines
4647 return 0;
4748 }
4849
49− npy_intp length = PyArray_SIZE ((PyArrayObject *)input);
50+ length = PyArray_SIZE ((PyArrayObject *)input);
5051 if (length <= 0) {
5152 PyErr_SetString (PyExc_ValueError, "input array size should be greater than 0");
5253 return 0;
@@ -93,7 +94,8 @@ PyAubio_CFmatToArray (fmat_t * input) · 40 unmodified lines
9394
9495 int
9596 PyAubio_ArrayToCFmat (PyObject *input, fmat_t *mat) {
96− uint_t i;
97+ uint_t i, new_height;
98+ npy_intp length, height;
9799 if (input == NULL) {
98100 PyErr_SetString (PyExc_ValueError, "input array is not a python object");
99101 return 0;
@@ -120,12 +122,12 @@ PyAubio_ArrayToCFmat (PyObject *input, fmat_t *mat) { · 20 unmodified lines
120122 }
121123
122124 // no need to really allocate fvec, just its struct member
123− npy_intp length = PyArray_DIM ((PyArrayObject *)input, 1);
125+ length = PyArray_DIM ((PyArrayObject *)input, 1);
124126 if (length <= 0) {
125127 PyErr_SetString (PyExc_ValueError, "input array dimension 1 should be greater than 0");
126128 return 0;
127129 }
128− npy_intp height = PyArray_DIM ((PyArrayObject *)input, 0);
130+ height = PyArray_DIM ((PyArrayObject *)input, 0);
129131 if (height <= 0) {
130132 PyErr_SetString (PyExc_ValueError, "input array dimension 0 should be greater than 0");
131133 return 0;
@@ -139,7 +141,7 @@ PyAubio_ArrayToCFmat (PyObject *input, fmat_t *mat) { · 7 unmodified lines
139141 return 0;
140142 }
141143
142− uint_t new_height = (uint_t)PyArray_DIM ((PyArrayObject *)input, 0);
144+ new_height = (uint_t)PyArray_DIM ((PyArrayObject *)input, 0);
143145 if (mat->height != new_height) {
144146 if (mat->data) {
145147 free(mat->data);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t