incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r1367858 - in /incubator/ooo/trunk/main/pyuno/source/module: pyuno.cxx pyuno_callable.cxx pyuno_module.cxx pyuno_runtime.cxx
Date Wed, 01 Aug 2012 04:30:42 GMT
Author: pfg
Date: Wed Aug  1 04:30:42 2012
New Revision: 1367858

URL: http://svn.apache.org/viewvc?rev=1367858&view=rev
Log:
pyuno: Replace PyObject_HEAD_INIT with PyVarObject_HEAD_INIT and add some initial Python3
safeguards.

Modified:
    incubator/ooo/trunk/main/pyuno/source/module/pyuno.cxx
    incubator/ooo/trunk/main/pyuno/source/module/pyuno_callable.cxx
    incubator/ooo/trunk/main/pyuno/source/module/pyuno_module.cxx
    incubator/ooo/trunk/main/pyuno/source/module/pyuno_runtime.cxx

Modified: incubator/ooo/trunk/main/pyuno/source/module/pyuno.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/pyuno/source/module/pyuno.cxx?rev=1367858&r1=1367857&r2=1367858&view=diff
==============================================================================
--- incubator/ooo/trunk/main/pyuno/source/module/pyuno.cxx (original)
+++ incubator/ooo/trunk/main/pyuno/source/module/pyuno.cxx Wed Aug  1 04:30:42 2012
@@ -639,8 +639,7 @@ static int PyUNO_cmp( PyObject *self, Py
 
 static PyTypeObject PyUNOType =
 {
-    PyObject_HEAD_INIT (&PyType_Type)
-    0,
+    PyVarObject_HEAD_INIT(&PyType_Type, 0)
     const_cast< char * >("pyuno"),
     sizeof (PyUNO),
     0,

Modified: incubator/ooo/trunk/main/pyuno/source/module/pyuno_callable.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/pyuno/source/module/pyuno_callable.cxx?rev=1367858&r1=1367857&r2=1367858&view=diff
==============================================================================
--- incubator/ooo/trunk/main/pyuno/source/module/pyuno_callable.cxx (original)
+++ incubator/ooo/trunk/main/pyuno/source/module/pyuno_callable.cxx Wed Aug  1 04:30:42 2012
@@ -191,8 +191,7 @@ PyObject* PyUNO_callable_call (PyObject*
 
 static PyTypeObject PyUNO_callable_Type =
 {
-    PyObject_HEAD_INIT (&PyType_Type)
-    0,
+    PyVarObject_HEAD_INIT(&PyType_Type, 0)
     const_cast< char * >("PyUNO_callable"),
     sizeof (PyUNO_callable),
     0,

Modified: incubator/ooo/trunk/main/pyuno/source/module/pyuno_module.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/pyuno/source/module/pyuno_module.cxx?rev=1367858&r1=1367857&r2=1367858&view=diff
==============================================================================
--- incubator/ooo/trunk/main/pyuno/source/module/pyuno_module.cxx (original)
+++ incubator/ooo/trunk/main/pyuno/source/module/pyuno_module.cxx Wed Aug  1 04:30:42 2012
@@ -486,9 +486,18 @@ static PyObject *isInterface( PyObject *
     {
         PyObject *obj = PyTuple_GetItem( args, 0 );
         Runtime r;
+#if PY_MAJOR_VERSION >= 3
+        return PyLong_FromLong( isInterfaceClass( r, obj ) );
+#else
         return PyInt_FromLong( isInterfaceClass( r, obj ) );
+
+#endif
     }
+#if PY_MAJOR_VERSION >= 3
+    return PyLong_FromLong( 0 );
+#else
     return PyInt_FromLong( 0 );
+#endif
 }
 
 static PyObject * generateUuid( PyObject *, PyObject * )

Modified: incubator/ooo/trunk/main/pyuno/source/module/pyuno_runtime.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/pyuno/source/module/pyuno_runtime.cxx?rev=1367858&r1=1367857&r2=1367858&view=diff
==============================================================================
--- incubator/ooo/trunk/main/pyuno/source/module/pyuno_runtime.cxx (original)
+++ incubator/ooo/trunk/main/pyuno/source/module/pyuno_runtime.cxx Wed Aug  1 04:30:42 2012
@@ -65,8 +65,7 @@ namespace pyuno
 
 static PyTypeObject RuntimeImpl_Type =
 {
-    PyObject_HEAD_INIT (&PyType_Type)
-    0,
+    PyVarObject_HEAD_INIT(&PyType_Type, 0)
     const_cast< char * >("pyuno_runtime"),
     sizeof (RuntimeImpl),
     0,
@@ -438,7 +437,11 @@ PyRef Runtime::any2PyObject (const Any &
 	{
         sal_Int32 l = 0;
         a >>= l;
+#if PY_MAJOR_VERSION >= 3
+        return PyRef( PyLong_FromLong (l), SAL_NO_ACQUIRE );
+#else
         return PyRef( PyInt_FromLong (l), SAL_NO_ACQUIRE );
+#endif
 	}
     case typelib_TypeClass_UNSIGNED_LONG:
 	{



Mime
View raw message