aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-10-17 10:50:04 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:18:23 -0300
commit42e73675311c4ef43361865fac2b467680ac366d (patch)
tree8cff2c9113fd3751fb1e58224e8c3aec26d13831
parentfec8b8974eaba911ab8659cae3d651be9f27c757 (diff)
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 <hugo.lima@openbossa.org> Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--generator/cppgenerator.cpp1
-rw-r--r--generator/shibokengenerator.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index 691d2943e..59e86510a 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 64c941460..b6d863942 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)