Commit be4ca1d6 authored by Robert Bradshaw's avatar Robert Bradshaw

Avoid casting to negative number for signedness check.

See #2186.
parent 14940757
......@@ -696,7 +696,7 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value, Py_ssize_t wid
Py_ssize_t length, ulength;
int prepend_sign, last_one_off;
{{TYPE}} remaining;
const {{TYPE}} neg_one = ({{TYPE}}) -1, const_zero = ({{TYPE}}) 0;
const {{TYPE}} neg_one = ({{TYPE}}) 0 - ({{TYPE}}) 1, const_zero = ({{TYPE}}) 0;
const int is_unsigned = neg_one > const_zero;
if (format_char == 'X') {
......
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