Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
ASSERT: add parenthesis around expr
  • Loading branch information
vstinner committed Oct 26, 2018
commit 6e9d91c0347a54e838c00f74216226f15a0d9a90
2 changes: 1 addition & 1 deletion Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ static PyObject *empty_values[1] = { NULL };
static int
_PyDict_CheckConsistency(PyDictObject *mp)
{
#define ASSERT(expr) _PyObject_ASSERT((PyObject *)mp, expr)
#define ASSERT(expr) _PyObject_ASSERT((PyObject *)mp, (expr))

PyDictKeysObject *keys = mp->ma_keys;
int splitted = _PyDict_HasSplitTable(mp);
Expand Down
2 changes: 1 addition & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ skip_signature(const char *doc)
static int
_PyType_CheckConsistency(PyTypeObject *type)
{
#define ASSERT(expr) _PyObject_ASSERT((PyObject *)type, expr)
#define ASSERT(expr) _PyObject_ASSERT((PyObject *)type, (expr))

if (!(type->tp_flags & Py_TPFLAGS_READY)) {
/* don't check types before PyType_Ready() */
Expand Down
3 changes: 2 additions & 1 deletion Objects/unicodeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ PyUnicode_GetMax(void)
int
_PyUnicode_CheckConsistency(PyObject *op, int check_content)
{
#define ASSERT(expr) _PyObject_ASSERT(op, expr)
#define ASSERT(expr) _PyObject_ASSERT(op, (expr))

PyASCIIObject *ascii;
unsigned int kind;

Expand Down