From 869d3372b55f542d32f6f6220566507e7d8a2cb8 Mon Sep 17 00:00:00 2001 From: Marcelo Lira Date: Fri, 23 Oct 2009 13:27:33 -0300 Subject: Revert "modified the generator do deal with all value type conversions in" This reverts commit 4213b0176ae9af91221dbe38e1dead10638ff054. --- headergenerator.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'headergenerator.cpp') 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 << '*'; -- cgit v1.2.3