From: Robert Bradshaw Date: Sun, 22 Sep 2013 04:02:42 +0000 (-0700) Subject: Get rid of "comparison of unsigned expression < 0 is always false" warning. X-Git-Tag: 0.20b1~314 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ef198d8cbc5d1a653bd895b54fa762f8d11f817;p=platform%2Fupstream%2Fpython-cython.git Get rid of "comparison of unsigned expression < 0 is always false" warning. --- diff --git a/Cython/Utility/TypeConversion.c b/Cython/Utility/TypeConversion.c index eba0a6a..b627469 100644 --- a/Cython/Utility/TypeConversion.c +++ b/Cython/Utility/TypeConversion.c @@ -455,8 +455,9 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value) { value_type value = func(x); \ if (sizeof(type) < sizeof(value_type)) { \ if (unlikely(value != (value_type) (type) value)) { \ + const value_type zero = 0; \ PyErr_SetString(PyExc_OverflowError, \ - (is_unsigned && unlikely(value < 0)) ? \ + (is_unsigned && unlikely(value < zero)) ? \ "can't convert negative value to " #type : \ "value too large to convert to " #type); \ return (type) -1; \