From: Paul Brossier Date: Tue, 10 Dec 2013 22:57:54 +0000 (-0500) Subject: lib/gen_pyobject.py: fix size checks X-Git-Tag: 0.4.0~25 X-Git-Url: https://git.aubio.org/?a=commitdiff_plain;h=906c0a229550a957e8f1b9d2cfaeaafe6c96f0a0;p=aubio.git lib/gen_pyobject.py: fix size checks Signed-off-by: Paul Brossier --- diff --git a/python/lib/gen_pyobject.py b/python/lib/gen_pyobject.py index d3f72618..ba8274e5 100644 --- a/python/lib/gen_pyobject.py +++ b/python/lib/gen_pyobject.py @@ -239,9 +239,9 @@ Py_%(name)s_new (PyTypeObject * pytype, PyObject * args, PyObject * kwds) 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;