summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generator/cppgenerator.cpp2
-rw-r--r--libshiboken/basewrapper.cpp41
-rw-r--r--libshiboken/basewrapper.h5
3 files changed, 24 insertions, 24 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index aee295f0..3936d03f 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -2383,7 +2383,7 @@ void CppGenerator::writeClassDefinition(QTextStream& s, const AbstractMetaClass*
if (metaClass->hasPrivateDestructor() || onlyPrivCtor)
tp_new = "0";
else
- tp_new = "SbkBaseWrapper_TpNew";
+ tp_new = "SbkObjectTpNew";
QString tp_richcompare = QString('0');
if (metaClass->hasComparisonOperatorOverload())
diff --git a/libshiboken/basewrapper.cpp b/libshiboken/basewrapper.cpp
index 5de9024e..3337a4d2 100644
--- a/libshiboken/basewrapper.cpp
+++ b/libshiboken/basewrapper.cpp
@@ -247,6 +247,26 @@ PyObject* SbkBaseWrapperType_TpNew(PyTypeObject* metatype, PyObject* args, PyObj
return reinterpret_cast<PyObject*>(newType);
}
+PyObject* SbkObjectTpNew(PyTypeObject* subtype, PyObject*, PyObject*)
+{
+ SbkObject* self = reinterpret_cast<SbkObject*>(subtype->tp_alloc(subtype, 0));
+ self->d = new SbkBaseWrapperPrivate;
+
+ SbkBaseWrapperType* sbkType = reinterpret_cast<SbkBaseWrapperType*>(subtype);
+ int numBases = sbkType->is_multicpp ? Shiboken::getNumberOfCppBaseClasses(subtype) : 1;
+ self->d->cptr = new void*[numBases];
+ std::memset(self->d->cptr, 0, sizeof(void*)*numBases);
+ self->d->hasOwnership = 1;
+ self->d->containsCppWrapper = 0;
+ self->d->validCppObject = 0;
+ self->d->parentInfo = 0;
+ self->ob_dict = 0;
+ self->weakreflist = 0;
+ self->d->referredObjects = 0;
+ return reinterpret_cast<PyObject*>(self);
+}
+
+
} //extern "C"
namespace Shiboken
@@ -381,25 +401,6 @@ void walkThroughClassHierarchy(PyTypeObject* currentType, HierarchyVisitor* visi
}
}
-PyObject* SbkBaseWrapper_TpNew(PyTypeObject* subtype, PyObject*, PyObject*)
-{
- SbkObject* self = reinterpret_cast<SbkObject*>(subtype->tp_alloc(subtype, 0));
- self->d = new SbkBaseWrapperPrivate;
-
- SbkBaseWrapperType* sbkType = reinterpret_cast<SbkBaseWrapperType*>(subtype);
- int numBases = sbkType->is_multicpp ? getNumberOfCppBaseClasses(subtype) : 1;
- self->d->cptr = new void*[numBases];
- std::memset(self->d->cptr, 0, sizeof(void*)*numBases);
- self->d->hasOwnership = 1;
- self->d->containsCppWrapper = 0;
- self->d->validCppObject = 0;
- self->d->parentInfo = 0;
- self->ob_dict = 0;
- self->weakreflist = 0;
- self->d->referredObjects = 0;
- return reinterpret_cast<PyObject*>(self);
-}
-
void setTypeUserData(SbkObject* wrapper, void *user_data, DeleteUserDataFunc d_func)
{
SbkBaseWrapperType* ob_type = reinterpret_cast<SbkBaseWrapperType*>(wrapper->ob_type);
@@ -714,7 +715,7 @@ PyObject* newObject(SbkBaseWrapperType* instanceType,
instanceType = BindingManager::instance().resolveType(cptr, instanceType);
}
- SbkObject* self = reinterpret_cast<SbkObject*>(SbkBaseWrapper_TpNew(reinterpret_cast<PyTypeObject*>(instanceType), 0, 0));
+ SbkObject* self = reinterpret_cast<SbkObject*>(SbkObjectTpNew(reinterpret_cast<PyTypeObject*>(instanceType), 0, 0));
self->d->cptr[0] = cptr;
self->d->hasOwnership = hasOwnership;
self->d->validCppObject = 1;
diff --git a/libshiboken/basewrapper.h b/libshiboken/basewrapper.h
index 9702992a..df5f8e35 100644
--- a/libshiboken/basewrapper.h
+++ b/libshiboken/basewrapper.h
@@ -101,6 +101,8 @@ struct LIBSHIBOKEN_API SbkBaseWrapperType
DeleteUserDataFunc d_func;
};
+LIBSHIBOKEN_API PyObject* SbkObjectTpNew(PyTypeObject* subtype, PyObject*, PyObject*);
+
} // extern "C"
namespace Shiboken
@@ -167,9 +169,6 @@ LIBSHIBOKEN_API bool canCallConstructor(PyTypeObject* myType, PyTypeObject* ctor
#define SbkBaseWrapper_Check(op) PyObject_TypeCheck(op, (PyTypeObject*)&SbkBaseWrapper_Type)
#define SbkBaseWrapper_CheckExact(op) ((op)->ob_type == &SbkBaseWrapper_Type)
-LIBSHIBOKEN_API PyObject*
-SbkBaseWrapper_TpNew(PyTypeObject* subtype, PyObject*, PyObject*);
-
/**
* Increments the reference count of the referred Python object.
* A previous Python object in the same position identified by the 'key' parameter