Skip to content

Commit f1624cd

Browse files
committed
Fix a bunch of compiler warnings. In at least one case these were serious bugs!
1 parent dc5f6b2 commit f1624cd

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

Objects/codeobject.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ code_richcompare(PyObject *self, PyObject *other, int op)
308308
co = (PyCodeObject *)self;
309309
cp = (PyCodeObject *)other;
310310

311-
eq = PyObject_RichCompare(co->co_name, cp->co_name, Py_EQ);
311+
eq = PyObject_RichCompareBool(co->co_name, cp->co_name, Py_EQ);
312312
if (eq <= 0) goto unequal;
313313
eq = co->co_argcount == cp->co_argcount;
314314
if (!eq) goto unequal;
@@ -318,17 +318,17 @@ code_richcompare(PyObject *self, PyObject *other, int op)
318318
if (!eq) goto unequal;
319319
eq = co->co_firstlineno == cp->co_firstlineno;
320320
if (!eq) goto unequal;
321-
eq = PyObject_RichCompare(co->co_code, cp->co_code, Py_EQ);
321+
eq = PyObject_RichCompareBool(co->co_code, cp->co_code, Py_EQ);
322322
if (eq <= 0) goto unequal;
323-
eq = PyObject_RichCompare(co->co_consts, cp->co_consts, Py_EQ);
323+
eq = PyObject_RichCompareBool(co->co_consts, cp->co_consts, Py_EQ);
324324
if (eq <= 0) goto unequal;
325-
eq = PyObject_RichCompare(co->co_names, cp->co_names, Py_EQ);
325+
eq = PyObject_RichCompareBool(co->co_names, cp->co_names, Py_EQ);
326326
if (eq <= 0) goto unequal;
327-
eq = PyObject_RichCompare(co->co_varnames, cp->co_varnames, Py_EQ);
327+
eq = PyObject_RichCompareBool(co->co_varnames, cp->co_varnames, Py_EQ);
328328
if (eq <= 0) goto unequal;
329-
eq = PyObject_RichCompare(co->co_freevars, cp->co_freevars, Py_EQ);
329+
eq = PyObject_RichCompareBool(co->co_freevars, cp->co_freevars, Py_EQ);
330330
if (eq <= 0) goto unequal;
331-
eq = PyObject_RichCompare(co->co_cellvars, cp->co_cellvars, Py_EQ);
331+
eq = PyObject_RichCompareBool(co->co_cellvars, cp->co_cellvars, Py_EQ);
332332
if (eq <= 0) goto unequal;
333333

334334
if (op == Py_EQ)

Objects/listobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,7 @@ is_default_cmp(PyObject *cmpfunc)
19791979
return 1;
19801980
if (!PyCFunction_Check(cmpfunc))
19811981
return 0;
1982-
f = (PyCFunction *)cmpfunc;
1982+
f = (PyCFunctionObject *)cmpfunc;
19831983
if (f->m_self != NULL)
19841984
return 0;
19851985
if (!PyString_Check(f->m_module))

0 commit comments

Comments
 (0)