diff options
Diffstat (limited to 'sources/shiboken2/libshiboken/basewrapper.cpp')
-rw-r--r-- | sources/shiboken2/libshiboken/basewrapper.cpp | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp index 270a5df94..d7d37971c 100644 --- a/sources/shiboken2/libshiboken/basewrapper.cpp +++ b/sources/shiboken2/libshiboken/basewrapper.cpp @@ -542,7 +542,6 @@ void DeallocVisitor::done() DtorCallerVisitor::done(); } -namespace Module { void init(); } namespace Conversions { void init(); } void init() @@ -551,7 +550,6 @@ void init() if (shibokenAlreadInitialised) return; - Module::init(); Conversions::init(); PyEval_InitThreads(); @@ -681,14 +679,6 @@ bool canCallConstructor(PyTypeObject* myType, PyTypeObject* ctorType) return true; } - -bool hasExternalCppConversions(SbkObjectType*) { return false; } // DEPRECATED. -bool isExternalConvertible(SbkObjectType *, PyObject *) { return false; } // DEPRECATED. -void setExternalCppConversionFunction(SbkObjectType*, ExtendedToCppFunc) {} // DEPRECATED. -void setExternalIsConvertibleFunction(SbkObjectType*, ExtendedIsConvertibleFunc) {} // DEPRECATED. -void* callExternalCppConversion(SbkObjectType*, PyObject*) { return 0; } // DEPRECATED. - - bool hasCast(SbkObjectType* type) { return type->d->mi_specialcast != 0; @@ -721,18 +711,6 @@ void setTypeDiscoveryFunctionV2(SbkObjectType* self, TypeDiscoveryFuncV2 func) self->d->type_discovery = func; } -void setTypeDiscoveryFunction(SbkObjectType* self, TypeDiscoveryFunc func) -{ - self->d->type_discovery = (TypeDiscoveryFuncV2)func; -} - -TypeDiscoveryFunc getTypeDiscoveryFunction(SbkObjectType* self) -{ - // This is an illegal cast because the return value is different, - // but nobody ever used this function, so... =] - return (TypeDiscoveryFunc)self->d->type_discovery; -} - void copyMultimpleheritance(SbkObjectType* self, SbkObjectType* other) { self->d->mi_init = other->d->mi_init; @@ -840,13 +818,15 @@ Py_hash_t hash(PyObject* pyObj) static void setSequenceOwnership(PyObject* pyObj, bool owner) { if (PySequence_Check(pyObj)) { - std::list<SbkObject*> objs = splitPyObject(pyObj); - std::list<SbkObject*>::const_iterator it = objs.begin(); - for(; it != objs.end(); ++it) { - if (owner) - getOwnership(*it); - else - releaseOwnership(*it); + Py_ssize_t size = PySequence_Size(pyObj); + if (size > 0) { + std::list<SbkObject*> objs = splitPyObject(pyObj); + for (auto it = objs.begin(), end = objs.end(); it != end; ++it) { + if (owner) + getOwnership(*it); + else + releaseOwnership(*it); + } } } else if (Object::checkType(pyObj)) { if (owner) @@ -1053,11 +1033,6 @@ void makeValid(SbkObject* self) } } -bool hasParentInfo(SbkObject* pyObj) -{ - return pyObj->d->parentInfo != 0; -} - void* cppPointer(SbkObject* pyObj, PyTypeObject* desiredType) { PyTypeObject* type = Py_TYPE(pyObj); |