Skip to content

Commit 4a34e88

Browse files
committed
Use _Py_CAST()
1 parent 7d64093 commit 4a34e88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Include/object.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ having all the lower 32 bits set, which will avoid the reference count to go
8888
beyond the refcount limit. Immortality checks for reference count decreases will
8989
be done by checking the bit sign flag in the lower 32 bits.
9090
*/
91-
#define _Py_IMMORTAL_REFCNT (Py_ssize_t)UINT_MAX
91+
#define _Py_IMMORTAL_REFCNT _Py_CAST(Py_ssize_t, UINT_MAX)
9292

9393
#else
9494
/*
@@ -103,7 +103,7 @@ immortality, but the execution would still be correct.
103103
Reference count increases and decreases will first go through an immortality
104104
check by comparing the reference count field to the immortality reference count.
105105
*/
106-
#define _Py_IMMORTAL_REFCNT (Py_ssize_t)(UINT_MAX >> 2)
106+
#define _Py_IMMORTAL_REFCNT _Py_CAST(Py_ssize_t, UINT_MAX >> 2)
107107
#endif
108108

109109
// Py_NOGIL builds indicate immortal objects using `ob_ref_local`, which is

0 commit comments

Comments
 (0)