aboutsummaryrefslogtreecommitdiffstats
path: root/headergenerator.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-10-23 13:27:33 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-10-23 13:27:33 -0300
commit869d3372b55f542d32f6f6220566507e7d8a2cb8 (patch)
tree6ae0e59217d33ca48aeeaf0b5bef6f05c2a2c4a9 /headergenerator.cpp
parent70ba8b2ea9fcad7a6f88938c1675b45dec320a31 (diff)
Revert "modified the generator do deal with all value type conversions in"
This reverts commit 4213b0176ae9af91221dbe38e1dead10638ff054.
Diffstat (limited to 'headergenerator.cpp')
-rw-r--r--headergenerator.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/headergenerator.cpp b/headergenerator.cpp
index 6fcf1faf2..4bdad7b16 100644
--- a/headergenerator.cpp
+++ b/headergenerator.cpp
@@ -192,10 +192,7 @@ void HeaderGenerator::writeTypeConverterDecl(QTextStream& s, const TypeEntry* ty
if (type->isObject())
s << "const ";
s << cppName << " cppobj);" << endl;
- s << INDENT << "static " << cppName;
- if (type->isValue())
- s << '*';
- s << " toCpp(PyObject* pyobj);" << endl;
+ s << INDENT << "static " << cppName << " toCpp(PyObject* pyobj);" << endl;
s << "};" << endl;
}
@@ -246,10 +243,7 @@ void HeaderGenerator::writeTypeConverterImpl(QTextStream& s, const TypeEntry* ty
s << INDENT << "return pyobj;" << endl;
s << '}' << endl << endl;
- s << "inline " << cppName;
- if (type->isValue())
- s << '*';
- s << " Converter< " << cppName << " >::toCpp(PyObject* pyobj)" << endl;
+ s << "inline " << cppName << " Converter< " << cppName << " >::toCpp(PyObject* pyobj)" << endl;
s << '{' << endl;
if (type->isValue()) {
@@ -273,10 +267,8 @@ void HeaderGenerator::writeTypeConverterImpl(QTextStream& s, const TypeEntry* ty
s << "if (" << cpythonCheckFunction(argType) << "(pyobj))" << endl;
{
Indentation indent(INDENT);
- s << INDENT << "return ";
- if (type->isValue())
- s << "new ";
- s << cppName << "(Converter< " << argType->cppSignature() << " >::toCpp(pyobj));" << endl;
+ s << INDENT << "return " << cppName;
+ s << "(Converter< " << argType->cppSignature() << " >::toCpp(pyobj));" << endl;
}
}
}
@@ -285,6 +277,8 @@ void HeaderGenerator::writeTypeConverterImpl(QTextStream& s, const TypeEntry* ty
if (type->isEnum() || type->isFlags()) {
s << '(' << type->qualifiedCppName() << ") ((Shiboken::PyEnumObject*)pyobj)->ob_ival";
} else {
+ if (type->isValue())
+ s << '*';
s << "((" << cppName;
if (type->isValue())
s << '*';