VirtualBox

Changeset 102401 in vbox for trunk/src/libs/xpcom18a4


Ignore:
Timestamp:
Nov 30, 2023 3:21:33 PM (15 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160542
Message:

libs/xpcom: Revert r160537, doesn't work as well, bugref:10544

Location:
trunk/src/libs/xpcom18a4/python/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/python/src/PyIID.cpp

    r102396 r102401  
    237237                { Py_tp_str,            (void *)(uintptr_t)&Py_nsIID::PyTypeMethod_str },
    238238                { Py_tp_richcompare,    (void *)(uintptr_t)&Py_nsIID::PyTypeMethod_richcompare },
    239         { Py_tp_is_gc,          (void *)(uintptr_t)&Py_nsIID::PyTypeMethod_is_gc },
    240239                { 0, NULL } /* terminator */
    241240        };
     
    321320Py_nsIID::PyTypeMethod_richcompare(PyObject *self, PyObject *other, int op)
    322321{
    323     nsIID iid;
    324     if (!Py_nsIID::IIDFromPyObject(other, &iid))
    325     {
    326         /* Can't do comparison betsides equality/inequalityif the other object does not contain an IID. */
    327         if (op == Py_EQ)
    328             Py_RETURN_FALSE;
    329         else if (op == Py_NE)
    330             Py_RETURN_TRUE;
    331 
    332         PyErr_SetString(PyExc_TypeError, "Comparison between different object types is not defined");
    333         return NULL;
    334     }
    335 
    336322    PyObject *result = NULL;
    337323        Py_nsIID *s_iid = (Py_nsIID *)self;
    338         int rc = memcmp(&s_iid->m_iid, &iid, sizeof(s_iid->m_iid));
     324        Py_nsIID *o_iid = (Py_nsIID *)other;
     325        int rc = memcmp(&s_iid->m_iid, &o_iid->m_iid, sizeof(s_iid->m_iid));
    339326    switch (op)
    340327    {
     
    422409        delete (Py_nsIID *)ob;
    423410}
    424 
    425 #ifdef Py_LIMITED_API
    426 /* static */ int
    427 Py_nsIID::PyTypeMethod_is_gc(PyObject *self)
    428 {
    429     return 1;
    430 }
    431 #endif
  • trunk/src/libs/xpcom18a4/python/src/PyXPCOM.h

    r102396 r102401  
    586586        static NS_EXPORT_STATIC_MEMBER_(PyTypeObject *) s_pType;
    587587        static PyTypeObject *GetTypeObject(void);
    588     static int PyTypeMethod_is_gc(PyObject *self);
    589588#endif
    590589        static NS_EXPORT_STATIC_MEMBER_(PyMethodDef) methods[];
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette