gh-87347: Add parenthesis around macro arguments (#93915)

Add unit test on Py_MEMBER_SIZE() and some other macros.
This commit is contained in:
Victor Stinner 2022-06-20 16:04:52 +02:00 committed by GitHub
parent 61f24e7885
commit 7ad6f74fcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 171 additions and 143 deletions

View file

@ -82,13 +82,13 @@ PyAPI_FUNC(void) PyMem_Free(void *ptr);
// Deprecated aliases only kept for backward compatibility.
// PyMem_Del and PyMem_DEL are defined with no parameter to be able to use
// them as function pointers (ex: dealloc = PyMem_Del).
#define PyMem_MALLOC(n) PyMem_Malloc(n)
#define PyMem_NEW(type, n) PyMem_New(type, n)
#define PyMem_REALLOC(p, n) PyMem_Realloc(p, n)
#define PyMem_RESIZE(p, type, n) PyMem_Resize(p, type, n)
#define PyMem_FREE(p) PyMem_Free(p)
#define PyMem_Del PyMem_Free
#define PyMem_DEL PyMem_Free
#define PyMem_MALLOC(n) PyMem_Malloc((n))
#define PyMem_NEW(type, n) PyMem_New(type, (n))
#define PyMem_REALLOC(p, n) PyMem_Realloc((p), (n))
#define PyMem_RESIZE(p, type, n) PyMem_Resize((p), type, (n))
#define PyMem_FREE(p) PyMem_Free((p))
#define PyMem_Del(p) PyMem_Free((p))
#define PyMem_DEL(p) PyMem_Free((p))
#ifndef Py_LIMITED_API