Commit 062a7c36 authored by Benjamin Peterson's avatar Benjamin Peterson

fix compiler warnings

parent b21d8109
...@@ -3239,8 +3239,8 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ...@@ -3239,8 +3239,8 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
kwlist, &long_cnt, &long_step)) kwlist, &long_cnt, &long_step))
return NULL; return NULL;
if (long_cnt != NULL && !PyNumber_Check(long_cnt) || if ((long_cnt != NULL && !PyNumber_Check(long_cnt)) ||
long_step != NULL && !PyNumber_Check(long_step)) { (long_step != NULL && !PyNumber_Check(long_step))) {
PyErr_SetString(PyExc_TypeError, "a number is required"); PyErr_SetString(PyExc_TypeError, "a number is required");
return NULL; return NULL;
} }
...@@ -3267,8 +3267,8 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds) ...@@ -3267,8 +3267,8 @@ count_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
} else } else
long_cnt = NULL; long_cnt = NULL;
} }
assert(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); (cnt == PY_SSIZE_T_MAX && long_cnt != NULL));
/* create countobject structure */ /* create countobject structure */
lz = (countobject *)type->tp_alloc(type, 0); lz = (countobject *)type->tp_alloc(type, 0);
...@@ -3292,6 +3292,7 @@ count_dealloc(countobject *lz) ...@@ -3292,6 +3292,7 @@ count_dealloc(countobject *lz)
Py_TYPE(lz)->tp_free(lz); Py_TYPE(lz)->tp_free(lz);
} }
static int
count_traverse(countobject *lz, visitproc visit, void *arg) count_traverse(countobject *lz, visitproc visit, void *arg)
{ {
Py_VISIT(lz->long_cnt); Py_VISIT(lz->long_cnt);
...@@ -3302,7 +3303,6 @@ count_traverse(countobject *lz, visitproc visit, void *arg) ...@@ -3302,7 +3303,6 @@ count_traverse(countobject *lz, visitproc visit, void *arg)
static PyObject * static PyObject *
count_nextlong(countobject *lz) count_nextlong(countobject *lz)
{ {
static PyObject *one = NULL;
PyObject *long_cnt; PyObject *long_cnt;
PyObject *stepped_up; PyObject *stepped_up;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment