From 991c09849683952684d49c451e40187c34ae3038 Mon Sep 17 00:00:00 2001 From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Thu, 19 Jun 2025 18:42:58 +0800 Subject: [PATCH 1/2] Add back const cast to _PyLong_IsCompact --- Include/cpython/longintrepr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/cpython/longintrepr.h b/Include/cpython/longintrepr.h index 9f12298d4fcc37..f3eeb7d2d1ff5c 100644 --- a/Include/cpython/longintrepr.h +++ b/Include/cpython/longintrepr.h @@ -127,7 +127,7 @@ _PyLong_IsCompact(const PyLongObject* op) { static inline int PyLong_CheckCompact(const PyObject *op) { - return PyLong_CheckExact(op) && _PyLong_IsCompact((PyLongObject *)op); + return PyLong_CheckExact(op) && _PyLong_IsCompact((const PyLongObject *)op); } #define PyUnstable_Long_IsCompact _PyLong_IsCompact From 219d9d13d6c7200ef3932db5ff21cee0cda0df81 Mon Sep 17 00:00:00 2001 From: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Date: Thu, 19 Jun 2025 19:06:24 +0800 Subject: [PATCH 2/2] remove const --- Include/cpython/longintrepr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Include/cpython/longintrepr.h b/Include/cpython/longintrepr.h index f3eeb7d2d1ff5c..19a57284e0edb1 100644 --- a/Include/cpython/longintrepr.h +++ b/Include/cpython/longintrepr.h @@ -125,7 +125,7 @@ _PyLong_IsCompact(const PyLongObject* op) { } static inline int -PyLong_CheckCompact(const PyObject *op) +PyLong_CheckCompact(PyObject *op) { return PyLong_CheckExact(op) && _PyLong_IsCompact((const PyLongObject *)op); }