From cb701f504e9a174bbc42ade4ae1195509e23670a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 9 Jul 2024 15:46:38 +0200 Subject: [PATCH] gh-121153: Change _PyLong_CompactValue() return type to int --- Include/cpython/longintrepr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Include/cpython/longintrepr.h b/Include/cpython/longintrepr.h index d841c043f37fc4..e742bef15c0431 100644 --- a/Include/cpython/longintrepr.h +++ b/Include/cpython/longintrepr.h @@ -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