summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-02-16 21:07:52 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-02-16 21:07:52 (GMT)
commit062a7c3675af79966fbe75a9e552ccd2a4b26dd5 (patch)
treea2f4c97731e1db3c7ac04a80b0a198cfb11f7538
parentb21d8109af7b6b3577e566e8c485ec5bcde20181 (diff)
downloadcpython-062a7c3675af79966fbe75a9e552ccd2a4b26dd5.zip
cpython-062a7c3675af79966fbe75a9e552ccd2a4b26dd5.tar.gz
cpython-062a7c3675af79966fbe75a9e552ccd2a4b26dd5.tar.bz2
fix compiler warnings
-rw-r--r--Modules/itertoolsmodule.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c
index 7d1791b..f42232d 100644
--- a/Modules/itertoolsmodule.c
+++ b/Modules/itertoolsmodule.c
@@ -3239,8 +3239,8 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
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;
}
@@ -3267,8 +3267,8 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
} else
long_cnt = NULL;
}
- assert(cnt != PY_SSIZE_T_MAX && long_cnt == NULL ||
- cnt == PY_SSIZE_T_MAX && long_cnt != NULL);
+ assert((cnt != PY_SSIZE_T_MAX && long_cnt == NULL) ||
+ (cnt == PY_SSIZE_T_MAX && long_cnt != NULL));
/* create countobject structure */
lz = (countobject *)type->tp_alloc(type, 0);
@@ -3292,6 +3292,7 @@ count_dealloc(countobject *lz)
Py_TYPE(lz)->tp_free(lz);
}
+static int
count_traverse(countobject *lz, visitproc visit, void *arg)
{
Py_VISIT(lz->long_cnt);
@@ -3302,7 +3303,6 @@ count_traverse(countobject *lz, visitproc visit, void *arg)
static PyObject *
count_nextlong(countobject *lz)
{
- static PyObject *one = NULL;
PyObject *long_cnt;
PyObject *stepped_up;