Skip to content

Commit 3c77f38

Browse files
committed
fix gcc warning: make argument to ternary operation boolean
This change is cosmetic and only silences a gcc warning (-Wint-in-bool-context) Signed-off-by: Ani Sinha <[email protected]>
1 parent 7eb8727 commit 3c77f38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Include/pymem.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ PyAPI_FUNC(void) PyMem_Free(void *);
7272
/* Returns NULL to indicate error if a negative size or size larger than
7373
Py_ssize_t can represent is supplied. Helps prevents security holes. */
7474
#define PyMem_MALLOC(n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
75-
: malloc((n) ? (n) : 1))
75+
: malloc((n) != 0? (n) : 1))
7676
#define PyMem_REALLOC(p, n) ((size_t)(n) > (size_t)PY_SSIZE_T_MAX ? NULL \
77-
: realloc((p), (n) ? (n) : 1))
77+
: realloc((p), (n) != 0? (n) : 1))
7878
#define PyMem_FREE free
7979

8080
#endif /* PYMALLOC_DEBUG */

0 commit comments

Comments
 (0)