History

python/ext/py-cvec.c: setters to return a negative value on error (closes #17)

Paul Brossier committed 9 years ago

Commit 4deb2551 parent 5b679ba1 file · +4 −4Browse files

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

Unified · Split

python/ext/py-cvec.c+4−4
@@ -142,14 +142,14 @@ Py_cvec_set_norm (Py_cvec * vec, PyObject *input, void * closure) · 141 unmodified lines
142142 {
143143 npy_intp length;
144144 if (!PyAubio_IsValidVector(input)) {
145− return 1;
145+ return -1;
146146 }
147147 length = PyArray_SIZE ((PyArrayObject *)input);
148148 if (length != vec->length) {
149149 PyErr_Format (PyExc_ValueError,
150150 "input array has length %" NPY_INTP_FMT ", but cvec has length %d", length,
151151 vec->length);
152− return 1;
152+ return -1;
153153 }
154154
155155 Py_XDECREF(vec->norm);
@@ -163,14 +163,14 @@ Py_cvec_set_phas (Py_cvec * vec, PyObject *input, void * closure) · 7 unmodified lines
163163 {
164164 npy_intp length;
165165 if (!PyAubio_IsValidVector(input)) {
166− return 1;
166+ return -1;
167167 }
168168 length = PyArray_SIZE ((PyArrayObject *)input);
169169 if (length != vec->length) {
170170 PyErr_Format (PyExc_ValueError,
171171 "input array has length %" NPY_INTP_FMT ", but cvec has length %d", length,
172172 vec->length);
173− return 1;
173+ return -1;
174174 }
175175
176176 Py_XDECREF(vec->phas);

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