Skip to content

Commit

Permalink
pythongh-121153: Change _PyLong_CompactValue() return type to int
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner committed Jul 9, 2024
1 parent 9ba2a46 commit cb701f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Include/cpython/longintrepr.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,14 @@ _PyLong_IsCompact(PyLongObject* op) {

#define PyUnstable_Long_IsCompact _PyLong_IsCompact

static inline Py_ssize_t
static inline int
_PyLong_CompactValue(PyLongObject *op)
{
Py_ssize_t sign;
assert(PyType_HasFeature(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS));
assert(PyUnstable_Long_IsCompact(op));
sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK);
return sign * (Py_ssize_t)op->long_value.ob_digit[0];
return sign * (int)op->long_value.ob_digit[0];
}

#define PyUnstable_Long_CompactValue _PyLong_CompactValue
Expand Down

0 comments on commit cb701f5

Please sign in to comment.