mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
gh-124064: Fix -Wconversion warnings in pycore_{long,object}.h (#124177)
Change also the fix for pycore_gc.h and pycore_stackref.h: declare constants as uintptr_t, rather than casting constants.
This commit is contained in:
parent
ab80c6b402
commit
ec08aa1fe4
6 changed files with 19 additions and 24 deletions
|
@ -56,8 +56,8 @@ typedef union _PyStackRef {
|
|||
|
||||
#define Py_TAG_DEFERRED (1)
|
||||
|
||||
#define Py_TAG_PTR (0)
|
||||
#define Py_TAG_BITS (1)
|
||||
#define Py_TAG_PTR ((uintptr_t)0)
|
||||
#define Py_TAG_BITS ((uintptr_t)1)
|
||||
|
||||
#ifdef Py_GIL_DISABLED
|
||||
static const _PyStackRef PyStackRef_NULL = { .bits = 0 | Py_TAG_DEFERRED};
|
||||
|
@ -98,7 +98,7 @@ typedef union _PyStackRef {
|
|||
static inline PyObject *
|
||||
PyStackRef_AsPyObjectBorrow(_PyStackRef stackref)
|
||||
{
|
||||
PyObject *cleared = ((PyObject *)((stackref).bits & (~(uintptr_t)Py_TAG_BITS)));
|
||||
PyObject *cleared = ((PyObject *)((stackref).bits & (~Py_TAG_BITS)));
|
||||
return cleared;
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue