summaryrefslogtreecommitdiffstats
path: root/Include/abstract.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-06-20 14:04:52 (GMT)
committerGitHub <noreply@github.com>2022-06-20 14:04:52 (GMT)
commit7ad6f74fcf9db1ccfeaf0986064870d8d3887300 (patch)
tree2b140e0e4fdb3b58379887bab6ff68ade5c67c60 /Include/abstract.h
parent61f24e7885bed096b5d7f75aff13c1001994b35a (diff)
downloadcpython-7ad6f74fcf9db1ccfeaf0986064870d8d3887300.zip
cpython-7ad6f74fcf9db1ccfeaf0986064870d8d3887300.tar.gz
cpython-7ad6f74fcf9db1ccfeaf0986064870d8d3887300.tar.bz2
gh-87347: Add parenthesis around macro arguments (#93915)
Add unit test on Py_MEMBER_SIZE() and some other macros.
Diffstat (limited to 'Include/abstract.h')
-rw-r--r--Include/abstract.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/Include/abstract.h b/Include/abstract.h
index 197b20e..576024e 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -88,7 +88,7 @@ extern "C" {
-1 on failure.
This is the equivalent of the Python statement: del o.attr_name. */
-#define PyObject_DelAttrString(O,A) PyObject_SetAttrString((O),(A), NULL)
+#define PyObject_DelAttrString(O, A) PyObject_SetAttrString((O), (A), NULL)
/* Implemented as a macro:
@@ -98,7 +98,7 @@ extern "C" {
Delete attribute named attr_name, for object o. Returns -1
on failure. This is the equivalent of the Python
statement: del o.attr_name. */
-#define PyObject_DelAttr(O,A) PyObject_SetAttr((O),(A), NULL)
+#define PyObject_DelAttr(O, A) PyObject_SetAttr((O), (A), NULL)
/* Implemented elsewhere:
@@ -722,7 +722,7 @@ PyAPI_FUNC(PyObject *) PySequence_Fast(PyObject *o, const char* m);
/* Return the 'i'-th element of the sequence 'o', assuming that o was returned
by PySequence_Fast, and that i is within bounds. */
#define PySequence_Fast_GET_ITEM(o, i)\
- (PyList_Check(o) ? PyList_GET_ITEM(o, i) : PyTuple_GET_ITEM(o, i))
+ (PyList_Check(o) ? PyList_GET_ITEM((o), (i)) : PyTuple_GET_ITEM((o), (i)))
/* Return a pointer to the underlying item array for
an object returned by PySequence_Fast */
@@ -802,7 +802,7 @@ PyAPI_FUNC(Py_ssize_t) PyMapping_Length(PyObject *o);
failure.
This is equivalent to the Python statement: del o[key]. */
-#define PyMapping_DelItemString(O,K) PyObject_DelItemString((O),(K))
+#define PyMapping_DelItemString(O, K) PyObject_DelItemString((O), (K))
/* Implemented as a macro:
@@ -812,7 +812,7 @@ PyAPI_FUNC(Py_ssize_t) PyMapping_Length(PyObject *o);
Returns -1 on failure.
This is equivalent to the Python statement: del o[key]. */
-#define PyMapping_DelItem(O,K) PyObject_DelItem((O),(K))
+#define PyMapping_DelItem(O, K) PyObject_DelItem((O), (K))
/* On success, return 1 if the mapping object 'o' has the key 'key',
and 0 otherwise.