File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -117,16 +117,17 @@ maybe_small_long(PyLongObject *v)
117117
118118#define PYLONG_FROM_SIGNED (INT_TYPE , ival ) \
119119 do { \
120+ unsigned long abs_ival, t; \
120121 if (IS_SMALL_INT(ival)) { \
121122 return get_small_int((sdigit)(ival)); \
122123 } \
123124 if (-(INT_TYPE)PyLong_MASK <= (ival) && (ival) <= (INT_TYPE)PyLong_MASK) { \
124125 return _PyLong_FromMedium((sdigit)(ival)); \
125126 } \
126127 /* Count digits (at least two - smaller cases were handled above). */ \
127- INT_TYPE abs_ival = (ival ) < 0 ? 0U - (INT_TYPE )(ival ) : (INT_TYPE )(ival ); \
128+ abs_ival = (ival ) < 0 ? 0U - (unsigned long )(ival ) : (unsigned long )(ival ); \
128129 /* Do shift in two steps to avoid possible undefined behavior. */ \
129- INT_TYPE t = abs_ival >> PyLong_SHIFT >> PyLong_SHIFT ; \
130+ t = abs_ival >> PyLong_SHIFT >> PyLong_SHIFT ; \
130131 Py_ssize_t ndigits = 2 ; \
131132 while (t ) { \
132133 ++ ndigits ; \
You can’t perform that action at this time.
0 commit comments