diff --git a/Include/cpython/longintrepr.h b/Include/cpython/longintrepr.h index 66623780ca9..d841c043f37 100644 --- a/Include/cpython/longintrepr.h +++ b/Include/cpython/longintrepr.h @@ -119,7 +119,7 @@ PyAPI_FUNC(PyLongObject*) _PyLong_FromDigits( static inline int -_PyLong_IsCompact(const PyLongObject* op) { +_PyLong_IsCompact(PyLongObject* op) { assert(PyType_HasFeature(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)); return op->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS); } @@ -127,7 +127,7 @@ _PyLong_IsCompact(const PyLongObject* op) { #define PyUnstable_Long_IsCompact _PyLong_IsCompact static inline Py_ssize_t -_PyLong_CompactValue(const PyLongObject *op) +_PyLong_CompactValue(PyLongObject *op) { Py_ssize_t sign; assert(PyType_HasFeature(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)); diff --git a/Include/internal/pycore_long.h b/Include/internal/pycore_long.h index 8513695c22e..2bf6ff459dd 100644 --- a/Include/internal/pycore_long.h +++ b/Include/internal/pycore_long.h @@ -240,7 +240,7 @@ static inline int _PyLong_CompactSign(const PyLongObject *op) { assert(PyLong_Check(op)); - assert(_PyLong_IsCompact(op)); + assert(_PyLong_IsCompact((PyLongObject *)op)); return 1 - (op->long_value.lv_tag & SIGN_MASK); } @@ -248,7 +248,7 @@ static inline int _PyLong_NonCompactSign(const PyLongObject *op) { assert(PyLong_Check(op)); - assert(!_PyLong_IsCompact(op)); + assert(!_PyLong_IsCompact((PyLongObject *)op)); return 1 - (op->long_value.lv_tag & SIGN_MASK); } diff --git a/Objects/longobject.c b/Objects/longobject.c index a3a59a20f0b..86afec9a414 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -6672,12 +6672,12 @@ _PyLong_FiniTypes(PyInterpreterState *interp) int PyUnstable_Long_IsCompact(const PyLongObject* op) { - return _PyLong_IsCompact(op); + return _PyLong_IsCompact((PyLongObject*)op); } #undef PyUnstable_Long_CompactValue Py_ssize_t PyUnstable_Long_CompactValue(const PyLongObject* op) { - return _PyLong_CompactValue(op); + return _PyLong_CompactValue((PyLongObject*)op); }