Commit 6160e548 authored by Robert Bradshaw's avatar Robert Bradshaw

Clarify macro arguments.

parent 5ef198d8
...@@ -450,20 +450,20 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value) { ...@@ -450,20 +450,20 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value) {
/////////////// CIntFromPyVerify /////////////// /////////////// CIntFromPyVerify ///////////////
#define __PYX_VERIFY_RETURN_INT(type, value_type, func) \ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \
{ \ { \
value_type value = func(x); \ func_type value = func(x); \
if (sizeof(type) < sizeof(value_type)) { \ if (sizeof(target_type) < sizeof(func_type)) { \
if (unlikely(value != (value_type) (type) value)) { \ if (unlikely(value != (func_type) (target_type) value)) { \
const value_type zero = 0; \ const func_type zero = 0; \
PyErr_SetString(PyExc_OverflowError, \ PyErr_SetString(PyExc_OverflowError, \
(is_unsigned && unlikely(value < zero)) ? \ (is_unsigned && unlikely(value < zero)) ? \
"can't convert negative value to " #type : \ "can't convert negative value to " #target_type : \
"value too large to convert to " #type); \ "value too large to convert to " #target_type); \
return (type) -1; \ return (target_type) -1; \
} \ } \
} \ } \
return (type) value; \ return (target_type) value; \
} }
......
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