History

ext/py-source.c: fix size checks

Paul Brossier committed 12 years ago

Commit 18e22f91 parent bf63c611 file · +10 −10Browse files

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

Unified · Split

python/ext/py-source.c+10−10
@@ -40,21 +40,21 @@ Py_source_new (PyTypeObject * pytype, PyObject * args, PyObject * kwds) · 39 unmodified lines
40 }40 }
41 41
42 self->samplerate = 0;42 self->samplerate = 0;
43 if (samplerate > 0) {43 if ((sint_t)samplerate > 0) {
44 self->samplerate = samplerate;44 self->samplerate = samplerate;
45 //} else if (samplerate < 0) {45 } else if ((sint_t)samplerate < 0) {
46 // PyErr_SetString (PyExc_ValueError,46 PyErr_SetString (PyExc_ValueError,
47 // "can not use negative value for samplerate");47 "can not use negative value for samplerate");
48 // return NULL;48 return NULL;
49 }49 }
50 50
51 self->hop_size = Py_default_vector_length / 2;51 self->hop_size = Py_default_vector_length / 2;
52 if (hop_size > 0) {52 if ((sint_t)hop_size > 0) {
53 self->hop_size = hop_size;53 self->hop_size = hop_size;
54 //} else if (hop_size < 0) {54 } else if ((sint_t)hop_size < 0) {
55 // PyErr_SetString (PyExc_ValueError,55 PyErr_SetString (PyExc_ValueError,
56 // "can not use negative value for hop_size");56 "can not use negative value for hop_size");
57 // return NULL;57 return NULL;
58 }58 }
59 59
60 return (PyObject *) self;60 return (PyObject *) self;

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