]> granicus.if.org Git - python/commitdiff
Fix a bunch of compiler warnings. In at least one case these were serious bugs!
authorGuido van Rossum <guido@python.org>
Thu, 24 Aug 2006 23:43:52 +0000 (23:43 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 24 Aug 2006 23:43:52 +0000 (23:43 +0000)
Objects/codeobject.c
Objects/listobject.c

index e9b853c7c7c8de0a1deee450e6dce467bf5c5862..ca156e83196e6cc9c976a06b34e504ad51395e6a 100644 (file)
@@ -308,7 +308,7 @@ code_richcompare(PyObject *self, PyObject *other, int op)
        co = (PyCodeObject *)self;
        cp = (PyCodeObject *)other;
 
-       eq = PyObject_RichCompare(co->co_name, cp->co_name, Py_EQ);
+       eq = PyObject_RichCompareBool(co->co_name, cp->co_name, Py_EQ);
        if (eq <= 0) goto unequal;
        eq = co->co_argcount == cp->co_argcount;
        if (!eq) goto unequal;
@@ -318,17 +318,17 @@ code_richcompare(PyObject *self, PyObject *other, int op)
        if (!eq) goto unequal;
        eq = co->co_firstlineno == cp->co_firstlineno;
        if (!eq) goto unequal;
-       eq = PyObject_RichCompare(co->co_code, cp->co_code, Py_EQ);
+       eq = PyObject_RichCompareBool(co->co_code, cp->co_code, Py_EQ);
        if (eq <= 0) goto unequal;
-       eq = PyObject_RichCompare(co->co_consts, cp->co_consts, Py_EQ);
+       eq = PyObject_RichCompareBool(co->co_consts, cp->co_consts, Py_EQ);
        if (eq <= 0) goto unequal;
-       eq = PyObject_RichCompare(co->co_names, cp->co_names, Py_EQ);
+       eq = PyObject_RichCompareBool(co->co_names, cp->co_names, Py_EQ);
        if (eq <= 0) goto unequal;
-       eq = PyObject_RichCompare(co->co_varnames, cp->co_varnames, Py_EQ);
+       eq = PyObject_RichCompareBool(co->co_varnames, cp->co_varnames, Py_EQ);
        if (eq <= 0) goto unequal;
-       eq = PyObject_RichCompare(co->co_freevars, cp->co_freevars, Py_EQ);
+       eq = PyObject_RichCompareBool(co->co_freevars, cp->co_freevars, Py_EQ);
        if (eq <= 0) goto unequal;
-       eq = PyObject_RichCompare(co->co_cellvars, cp->co_cellvars, Py_EQ);
+       eq = PyObject_RichCompareBool(co->co_cellvars, cp->co_cellvars, Py_EQ);
        if (eq <= 0) goto unequal;
 
        if (op == Py_EQ)
index 3d81656930b94491283070045d64bda07c207636..9a11680fda6d0f2fc06dcd6a9260023ab175cbaf 100644 (file)
@@ -1979,7 +1979,7 @@ is_default_cmp(PyObject *cmpfunc)
                return 1;
        if (!PyCFunction_Check(cmpfunc))
                return 0;
-       f = (PyCFunction *)cmpfunc;
+       f = (PyCFunctionObject *)cmpfunc;
        if (f->m_self != NULL)
                return 0;
        if (!PyString_Check(f->m_module))