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/ext (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
21 21
22int22int
23PyAubio_IsValidVector (PyObject * input) {23PyAubio_IsValidVector (PyObject * input) {
24 npy_intp length;
24 if (input == NULL) {25 if (input == NULL) {
25 PyErr_SetString (PyExc_ValueError, "input array is not a python object");26 PyErr_SetString (PyExc_ValueError, "input array is not a python object");
26 return 0;27 return 0;
@@ -46,7 +47,7 @@ PyAubio_IsValidVector (PyObject * input) { · 19 unmodified lines
46 return 0;47 return 0;
47 }48 }
48 49
49 npy_intp length = PyArray_SIZE ((PyArrayObject *)input);50 length = PyArray_SIZE ((PyArrayObject *)input);
50 if (length <= 0) {51 if (length <= 0) {
51 PyErr_SetString (PyExc_ValueError, "input array size should be greater than 0");52 PyErr_SetString (PyExc_ValueError, "input array size should be greater than 0");
52 return 0;53 return 0;
@@ -93,7 +94,8 @@ PyAubio_CFmatToArray (fmat_t * input) · 40 unmodified lines
93 94
94int95int
95PyAubio_ArrayToCFmat (PyObject *input, fmat_t *mat) {96PyAubio_ArrayToCFmat (PyObject *input, fmat_t *mat) {
96 uint_t i;97 uint_t i, new_height;
98 npy_intp length, height;
97 if (input == NULL) {99 if (input == NULL) {
98 PyErr_SetString (PyExc_ValueError, "input array is not a python object");100 PyErr_SetString (PyExc_ValueError, "input array is not a python object");
99 return 0;101 return 0;
@@ -120,12 +122,12 @@ PyAubio_ArrayToCFmat (PyObject *input, fmat_t *mat) { · 20 unmodified lines
120 }122 }
121 123
122 // no need to really allocate fvec, just its struct member124 // 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);
124 if (length <= 0) {126 if (length <= 0) {
125 PyErr_SetString (PyExc_ValueError, "input array dimension 1 should be greater than 0");127 PyErr_SetString (PyExc_ValueError, "input array dimension 1 should be greater than 0");
126 return 0;128 return 0;
127 }129 }
128 npy_intp height = PyArray_DIM ((PyArrayObject *)input, 0);130 height = PyArray_DIM ((PyArrayObject *)input, 0);
129 if (height <= 0) {131 if (height <= 0) {
130 PyErr_SetString (PyExc_ValueError, "input array dimension 0 should be greater than 0");132 PyErr_SetString (PyExc_ValueError, "input array dimension 0 should be greater than 0");
131 return 0;133 return 0;
@@ -139,7 +141,7 @@ PyAubio_ArrayToCFmat (PyObject *input, fmat_t *mat) { · 7 unmodified lines
139 return 0;141 return 0;
140 }142 }
141 143
142 uint_t new_height = (uint_t)PyArray_DIM ((PyArrayObject *)input, 0);144 new_height = (uint_t)PyArray_DIM ((PyArrayObject *)input, 0);
143 if (mat->height != new_height) {145 if (mat->height != new_height) {
144 if (mat->data) {146 if (mat->data) {
145 free(mat->data);147 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