Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-110024: Fix Pointer Type Warnings #110053

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions Include/cpython/pyatomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,15 +506,23 @@ static inline void _Py_atomic_fence_release(void);
// --- aliases ---------------------------------------------------------------

#if SIZEOF_LONG == 8
# define _Py_atomic_load_ulong _Py_atomic_load_uint64
# define _Py_atomic_load_ulong_relaxed _Py_atomic_load_uint64_relaxed
# define _Py_atomic_store_ulong _Py_atomic_store_uint64
# define _Py_atomic_store_ulong_relaxed _Py_atomic_store_uint64_relaxed
# define _Py_atomic_load_ulong(p) \
_Py_atomic_load_uint64((uint64_t *)p)
# define _Py_atomic_load_ulong_relaxed(p) \
_Py_atomic_load_uint64_relaxed((uint64_t *)p)
# define _Py_atomic_store_ulong(p, v) \
_Py_atomic_store_uint64((uint64_t *)p, v)
# define _Py_atomic_store_ulong_relaxed(p, v) \
_Py_atomic_store_uint64_relaxed((uint64_t *)p, v)
#elif SIZEOF_LONG == 4
# define _Py_atomic_load_ulong _Py_atomic_load_uint32
# define _Py_atomic_load_ulong_relaxed _Py_atomic_load_uint32_relaxed
# define _Py_atomic_store_ulong _Py_atomic_store_uint32
# define _Py_atomic_store_ulong_relaxed _Py_atomic_store_uint32_relaxed
# define _Py_atomic_load_ulong(p) \
_Py_atomic_load_uint32((uint32_t *)p)
# define _Py_atomic_load_ulong_relaxed(p) \
_Py_atomic_load_uint32_relaxed((uint32_t *)p)
# define _Py_atomic_store_ulong(p, v) \
_Py_atomic_store_uint32((uint32_t *)p, v)
# define _Py_atomic_store_ulong_relaxed(p, v) \
_Py_atomic_store_uint32_relaxed((uint32_t *)p, v)
#else
# error "long must be 4 or 8 bytes in size"
#endif // SIZEOF_LONG