diff Modules/itertoolsmodule.c @ 51780:96abb439e2d0 legacy-trunk

fix compiler warnings
author Benjamin Peterson <benjamin@python.org>
date Sat, 21 Feb 2009 23:09:33 +0000
parents 3e27d606d625
children ad607378a4ef
line wrap: on
line diff
--- a/Modules/itertoolsmodule.c	Sat Feb 21 20:27:01 2009 +0000
+++ b/Modules/itertoolsmodule.c	Sat Feb 21 23:09:33 2009 +0000
@@ -3240,15 +3240,15 @@
 			kwlist, &long_cnt, &long_step))
 		return NULL;
 
-	if (long_cnt != NULL && !PyNumber_Check(long_cnt) ||
-        long_step != NULL && !PyNumber_Check(long_step)) {
+	if ((long_cnt != NULL && !PyNumber_Check(long_cnt)) ||
+            (long_step != NULL && !PyNumber_Check(long_step))) {
 			PyErr_SetString(PyExc_TypeError, "a number is required");
 			return NULL;
 	}
 
 	if (long_cnt != NULL) {
 		cnt = PyInt_AsSsize_t(long_cnt);
-		if (cnt == -1 && PyErr_Occurred() || !PyInt_Check(long_cnt)) {
+		if ((cnt == -1 && PyErr_Occurred()) || !PyInt_Check(long_cnt)) {
 			PyErr_Clear();
 			slow_mode = 1;
 		}
@@ -3281,10 +3281,10 @@
 	else
 		Py_CLEAR(long_cnt);
 
-	assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL && !slow_mode ||
-           cnt == PY_SSIZE_T_MAX && long_cnt != NULL && slow_mode);
+	assert((cnt != PY_SSIZE_T_MAX && long_cnt == NULL && !slow_mode) ||
+               (cnt == PY_SSIZE_T_MAX && long_cnt != NULL && slow_mode));
 	assert(slow_mode || 
-		   PyInt_Check(long_step) && PyInt_AS_LONG(long_step) == 1);
+               (PyInt_Check(long_step) && PyInt_AS_LONG(long_step) == 1));
 
 	/* create countobject structure */
 	lz = (countobject *)type->tp_alloc(type, 0);