summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-08-06 16:52:13 +0300
committerQt by Nokia <qt-info@nokia.com>2012-08-07 11:24:23 +0200
commitf1d18a2ede78a97c152dd50c3899df51829c4260 (patch)
tree20986b835d5d2e57a8266f116592cac02b06386f /tools
parentf7e87333ab2ba26706a87f0c4f5b68694d64fc2f (diff)
Fix generation of return statements for void functions in dumpcpp
Changes in QMetaMethod::typeName() return value caused functions that return void to incorrectly generate return statments in dumpcpp. Task-number: QTBUG-26587 Change-Id: Id0abea96234a0a75cab8b53473cfee7e60846499 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/dumpcpp/main.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp
index d27c7bf..1eee3cd 100644
--- a/tools/dumpcpp/main.cpp
+++ b/tools/dumpcpp/main.cpp
@@ -481,8 +481,6 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb
if (!slotTag.isEmpty())
out << slotTag << " ";
- if (slotType.isEmpty())
- out << "void ";
else
out << slotType << " ";
if (category & OnlyInlines)
@@ -506,7 +504,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb
out << endl;
out << indent << "{" << endl;
- if (!slotType.isEmpty()) {
+ if (slotType != QStringLiteral("void")) {
out << indent << " " << slotType << " qax_result";
if (slotType.endsWith('*'))
out << " = 0";
@@ -522,7 +520,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb
}
}
out << indent << " void *_a[] = {";
- if (!slotType.isEmpty())
+ if (slotType != QStringLiteral("void"))
out << "(void*)&qax_result";
else
out << "0";
@@ -533,7 +531,7 @@ void generateClassDecl(QTextStream &out, const QString &controlID, const QMetaOb
out << "};" << endl;
out << indent << " qt_metacall(QMetaObject::InvokeMetaMethod, " << islot << ", _a);" << endl;
- if (!slotType.isEmpty())
+ if (slotType != QStringLiteral("void"))
out << indent << " return qax_result;" << endl;
out << indent << "}" << endl;
}