shithub: aubio

Download patch

ref: 906c0a229550a957e8f1b9d2cfaeaafe6c96f0a0
parent: 18e22f9553c239cfbe915cce1998025784e87ed8
author: Paul Brossier <[email protected]>
date: Tue Dec 10 12:57:54 EST 2013

lib/gen_pyobject.py: fix size checks

Signed-off-by: Paul Brossier <[email protected]>

--- a/python/lib/gen_pyobject.py
+++ b/python/lib/gen_pyobject.py
@@ -239,9 +239,9 @@
             s += """\
 
   self->%(pname)s = %(defval)s;
-  if (%(pname)s > 0) {
+  if ((sint_t)%(pname)s > 0) {
     self->%(pname)s = %(pname)s;
-  } else if (%(pname)s < 0) {
+  } else if ((sint_t)%(pname)s < 0) {
     PyErr_SetString (PyExc_ValueError,
         "can not use negative value for %(pname)s");
     return NULL;