summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_dict.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/internal/pycore_dict.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/internal/pycore_dict.h')
-rw-r--r--Include/internal/pycore_dict.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Include/internal/pycore_dict.h b/Include/internal/pycore_dict.h
index 24d2a71..c831c4c 100644
--- a/Include/internal/pycore_dict.h
+++ b/Include/internal/pycore_dict.h
@@ -154,9 +154,11 @@ struct _dictvalues {
2 : sizeof(int32_t))
#endif
#define DK_ENTRIES(dk) \
- (assert(dk->dk_kind == DICT_KEYS_GENERAL), (PyDictKeyEntry*)(&((int8_t*)((dk)->dk_indices))[(size_t)1 << (dk)->dk_log2_index_bytes]))
+ (assert((dk)->dk_kind == DICT_KEYS_GENERAL), \
+ (PyDictKeyEntry*)(&((int8_t*)((dk)->dk_indices))[(size_t)1 << (dk)->dk_log2_index_bytes]))
#define DK_UNICODE_ENTRIES(dk) \
- (assert(dk->dk_kind != DICT_KEYS_GENERAL), (PyDictUnicodeEntry*)(&((int8_t*)((dk)->dk_indices))[(size_t)1 << (dk)->dk_log2_index_bytes]))
+ (assert((dk)->dk_kind != DICT_KEYS_GENERAL), \
+ (PyDictUnicodeEntry*)(&((int8_t*)((dk)->dk_indices))[(size_t)1 << (dk)->dk_log2_index_bytes]))
#define DK_IS_UNICODE(dk) ((dk)->dk_kind != DICT_KEYS_GENERAL)
extern uint64_t _pydict_global_version;