From 33152e29f952307cc33b94e754a2964330c6085c Mon Sep 17 00:00:00 2001 From: "mhammond%skippinet.com.au" Date: Wed, 23 Jul 2003 00:23:45 +0000 Subject: [PATCH] We were breaking Python's rules for comparison result returns - and this only started mattering in Python 2.3. Not part of the build. git-svn-id: svn://10.0.0.236/trunk@145091 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/extensions/python/xpcom/src/PyIID.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mozilla/extensions/python/xpcom/src/PyIID.cpp b/mozilla/extensions/python/xpcom/src/PyIID.cpp index 16b25a2d9c6..69a37f72d33 100644 --- a/mozilla/extensions/python/xpcom/src/PyIID.cpp +++ b/mozilla/extensions/python/xpcom/src/PyIID.cpp @@ -174,7 +174,8 @@ Py_nsIID::PyTypeMethod_compare(PyObject *self, PyObject *other) { Py_nsIID *s_iid = (Py_nsIID *)self; Py_nsIID *o_iid = (Py_nsIID *)other; - return memcmp(&s_iid->m_iid, &o_iid->m_iid, sizeof(s_iid->m_iid)); + int rc = memcmp(&s_iid->m_iid, &o_iid->m_iid, sizeof(s_iid->m_iid)); + return rc == 0 ? 0 : (rc < 0 ? -1 : 1); } /* static */ PyObject *