Author: Carl Friedrich Bolz-Tereick <[email protected]>
Branch:
Changeset: r93905:8e52e1e16d7c
Date: 2018-02-28 16:10 +0100
http://bitbucket.org/pypy/pypy/changeset/8e52e1e16d7c/
Log: silence a GCC int-in-bool-context warning
this is equivalent to the fix of CPython issue
https://bugs.python.org/issue31474
diff --git a/pypy/module/cpyext/include/pymem.h
b/pypy/module/cpyext/include/pymem.h
--- a/pypy/module/cpyext/include/pymem.h
+++ b/pypy/module/cpyext/include/pymem.h
@@ -7,8 +7,8 @@
extern "C" {
#endif
-#define PyMem_MALLOC(n) malloc((n) ? (n) : 1)
-#define PyMem_REALLOC(p, n) realloc((p), (n) ? (n) : 1)
+#define PyMem_MALLOC(n) malloc(((n) != 0) ? (n) : 1)
+#define PyMem_REALLOC(p, n) realloc((p), ((n) != 0) ? (n) : 1)
#define PyMem_FREE free
PyAPI_FUNC(void *) PyMem_Malloc(size_t);
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit