Commit 63991515 authored by Lisandro Dalcin's avatar Lisandro Dalcin

Fixes for GCC -Wconversion

parent 438a61e1
...@@ -6927,7 +6927,9 @@ class CmpNode(object): ...@@ -6927,7 +6927,9 @@ class CmpNode(object):
contains_utility_code = UtilityCode( contains_utility_code = UtilityCode(
proto=""" proto="""
static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; } static CYTHON_INLINE int __Pyx_NegateNonNeg(int b) {
return unlikely(b < 0) ? b : !b;
}
static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) {
return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b); return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b);
} }
...@@ -7052,7 +7054,7 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq ...@@ -7052,7 +7054,7 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
else else
return (PyBytes_AS_STRING(s1)[0] != PyBytes_AS_STRING(s2)[0]); return (PyBytes_AS_STRING(s1)[0] != PyBytes_AS_STRING(s2)[0]);
} else { } else {
int result = memcmp(PyBytes_AS_STRING(s1), PyBytes_AS_STRING(s2), PyBytes_GET_SIZE(s1)); int result = memcmp(PyBytes_AS_STRING(s1), PyBytes_AS_STRING(s2), (size_t)PyBytes_GET_SIZE(s1));
return (equals == Py_EQ) ? (result == 0) : (result != 0); return (equals == Py_EQ) ? (result == 0) : (result != 0);
} }
} else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
......
...@@ -761,9 +761,9 @@ static CYTHON_INLINE %(type)s __Pyx_PyInt_As%(SignWord)s%(TypeName)s(PyObject* x ...@@ -761,9 +761,9 @@ static CYTHON_INLINE %(type)s __Pyx_PyInt_As%(SignWord)s%(TypeName)s(PyObject* x
"can't convert negative value to %(type)s"); "can't convert negative value to %(type)s");
return (%(type)s)-1; return (%(type)s)-1;
} }
return PyLong_AsUnsigned%(TypeName)s(x); return (%(type)s)PyLong_AsUnsigned%(TypeName)s(x);
} else { } else {
return PyLong_As%(TypeName)s(x); return (%(type)s)PyLong_As%(TypeName)s(x);
} }
} else { } else {
%(type)s val; %(type)s val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment