diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2017-07-16 09:39:55 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2017-07-16 09:39:55 +0200 |
commit | a2db27bb85d0daa4cc4b4b7d65c0e6a7cda5ec2a (patch) | |
tree | fde1a8f8f527369a2f3e4b95d7163b746860afa3 | |
parent | 7ecce71eda300289a591187d316c9c57c0b68e2c (diff) | |
download | cython-a2db27bb85d0daa4cc4b4b7d65c0e6a7cda5ec2a.tar.gz |
fix some C compiler warnings about comparison between signed and unsigned in helper code
-rw-r--r-- | Cython/Utility/Optimize.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Cython/Utility/Optimize.c b/Cython/Utility/Optimize.c index 11f399e53..c21fbbf09 100644 --- a/Cython/Utility/Optimize.c +++ b/Cython/Utility/Optimize.c @@ -613,7 +613,7 @@ static PyObject* __Pyx_PyInt_{{op}}{{order}}(PyObject *op1, PyObject *op2, CYTHO } return PyInt_FromLong(x); {{elif op == 'Lshift'}} - if (likely(b < sizeof(long)*8 && a == (a << b) >> b) || !a) { + if (likely(b < (long) (sizeof(long)*8) && a == (a << b) >> b) || !a) { return PyInt_FromLong(a {{c_op}} b); } {{else}} @@ -702,12 +702,12 @@ static PyObject* __Pyx_PyInt_{{op}}{{order}}(PyObject *op1, PyObject *op2, CYTHO x = a {{c_op}} b; {{if op == 'Lshift'}} #ifdef HAVE_LONG_LONG - if (unlikely(!(b < sizeof(long)*8 && a == x >> b)) && a) { + if (unlikely(!(b < (long) (sizeof(long)*8) && a == x >> b)) && a) { ll{{ival}} = {{ival}}; goto long_long; } #else - if (likely(b < sizeof(long)*8 && a == x >> b) || !a) /* execute return statement below */ + if (likely(b < (long) (sizeof(long)*8) && a == x >> b) || !a) /* execute return statement below */ #endif {{endif}} {{endif}} |