diff --git a/mozilla/extensions/python/xpcom/src/PyIInterfaceInfo.cpp b/mozilla/extensions/python/xpcom/src/PyIInterfaceInfo.cpp index 22a0d789210..776f0f2bed0 100644 --- a/mozilla/extensions/python/xpcom/src/PyIInterfaceInfo.cpp +++ b/mozilla/extensions/python/xpcom/src/PyIInterfaceInfo.cpp @@ -309,12 +309,12 @@ static PyObject *PyGetTypeForParam(PyObject *self, PyObject *args) const nsXPTMethodInfo *pmi; if (!__GetMethodInfoHelper(pii, mi, pi, &pmi)) return NULL; - nsXPTType datumType; + nsXPTType datumType; const nsXPTParamInfo& param_info = pmi->GetParam((PRUint8)pi); nsresult n = pii->GetTypeForParam(mi, ¶m_info, dim, &datumType); if (NS_FAILED(n)) return PyXPCOM_BuildPyException(n); - return PyObject_FromXPTTypeDescriptor((const XPTTypeDescriptor *)&datumType); + return PyObject_FromXPTType(&datumType); } static PyObject *PyGetSizeIsArgNumberForParam(PyObject *self, PyObject *args) diff --git a/mozilla/extensions/python/xpcom/src/Pyxpt_info.cpp b/mozilla/extensions/python/xpcom/src/Pyxpt_info.cpp index 0c650df10be..21e25082315 100644 --- a/mozilla/extensions/python/xpcom/src/Pyxpt_info.cpp +++ b/mozilla/extensions/python/xpcom/src/Pyxpt_info.cpp @@ -29,6 +29,18 @@ // (c) 2000, ActiveState corp. #include "PyXPCOM_std.h" +PyObject *PyObject_FromXPTType( const nsXPTType *d) +{ + if (d==nsnull) { + Py_INCREF(Py_None); + return Py_None; + } + // build an object using the same format as a TypeDescriptor. + return Py_BuildValue("bzzz", + d->flags, + NULL, NULL, NULL); +} + PyObject *PyObject_FromXPTTypeDescriptor( const XPTTypeDescriptor *d) { if (d==nsnull) {