From db044d298e2eb1853991ca73bb44a20783b0032f Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Mon, 17 Oct 2011 10:50:04 -0300 Subject: [PATCH] Fixes writeReturnValueHeuristics to not mess with constructors. Also fixes isWrapperType to avoid erring when the type is an object type passed as value. Reviewed by Hugo Parente Reviewed by Luciano Wolf --- generator/cppgenerator.cpp | 1 + generator/shibokengenerator.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index 691d2943..59e86510 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -4187,6 +4187,7 @@ void CppGenerator::writeReturnValueHeuristics(QTextStream& s, const AbstractMeta || !func->ownerClass() || !type || func->isStatic() + || func->isConstructor() || !func->typeReplaced(0).isEmpty()) { return; } diff --git a/generator/shibokengenerator.cpp b/generator/shibokengenerator.cpp index 64c94146..b6d86394 100644 --- a/generator/shibokengenerator.cpp +++ b/generator/shibokengenerator.cpp @@ -864,7 +864,7 @@ bool ShibokenGenerator::isWrapperType(const AbstractMetaType* metaType) bool ShibokenGenerator::isPointerToWrapperType(const AbstractMetaType* type) { - return isObjectType(type) || type->isValuePointer(); + return (isObjectType(type) && type->indirections() == 1) || type->isValuePointer(); } bool ShibokenGenerator::shouldDereferenceArgumentPointer(const AbstractMetaArgument* arg)