projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1691f2b
)
Get rid of "comparison of unsigned expression < 0 is always false" warning.
author
Robert Bradshaw
<robertwb@gmail.com>
Sun, 22 Sep 2013 04:02:42 +0000
(21:02 -0700)
committer
Robert Bradshaw
<robertwb@gmail.com>
Sun, 22 Sep 2013 04:02:42 +0000
(21:02 -0700)
Cython/Utility/TypeConversion.c
patch
|
blob
|
history
diff --git
a/Cython/Utility/TypeConversion.c
b/Cython/Utility/TypeConversion.c
index
eba0a6a
..
b627469
100644
(file)
--- 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; \