summaryrefslogtreecommitdiffstats
path: root/headergenerator.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-09-16 19:37:58 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-09-16 19:37:58 -0300
commitc0ed7e6f62a2e983f85bf5ef68184f9eec5ca3eb (patch)
tree21505be9e75642cc244fde1fc95ad39609778e96 /headergenerator.cpp
parente004df0d457f008d9f23c6b9708c5a37cc446f32 (diff)
downloadshiboken-c0ed7e6f62a2e983f85bf5ef68184f9eec5ca3eb.tar.gz
shiboken-c0ed7e6f62a2e983f85bf5ef68184f9eec5ca3eb.tar.xz
shiboken-c0ed7e6f62a2e983f85bf5ef68184f9eec5ca3eb.zip
generated converters uses 'const' for all Object-Type parameters
Diffstat (limited to 'headergenerator.cpp')
-rw-r--r--headergenerator.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/headergenerator.cpp b/headergenerator.cpp
index 87938ada..1c262018 100644
--- a/headergenerator.cpp
+++ b/headergenerator.cpp
@@ -188,7 +188,10 @@ void HeaderGenerator::writeTypeConverterDecl(QTextStream& s, const TypeEntry* ty
s << "template<>" << endl;
s << "struct Converter< " << cppName << " >" << endl << '{' << endl;
- s << INDENT << "static PyObject* toPython(" << cppName << " cppobj);" << endl;
+ s << INDENT << "static PyObject* toPython(";
+ if (type->isObject())
+ s << "const ";
+ s << cppName << " cppobj);" << endl;
s << INDENT << "static " << cppName << " toCpp(PyObject* pyobj);" << endl;
s << "};" << endl;
}
@@ -200,7 +203,10 @@ void HeaderGenerator::writeTypeConverterImpl(QTextStream& s, const TypeEntry* ty
if (type->isObject())
cppName.append('*');
- s << "inline PyObject* Converter< " << cppName << " >::toPython(" << cppName << " cppobj)" << endl;
+ s << "inline PyObject* Converter< " << cppName << " >::toPython(";
+ if (type->isObject())
+ s << "const ";
+ s << cppName << " cppobj)" << endl;
s << '{' << endl;
s << INDENT << "PyObject* pyobj;" << endl;