aboutsummaryrefslogtreecommitdiffstats
path: root/generator/cppgenerator.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-08-09 16:43:55 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:17:10 -0300
commit313c6906077cd94311fb09cbaf5a6194eb87c756 (patch)
treec6c3314904c14bb837a1e0619596b819aa98dcf3 /generator/cppgenerator.cpp
parent8cbeb5c0305b6d81ae8fd7ab16aaf94e16d80389 (diff)
CppGenerator's writeHashFunction now uses writeCppSelfDefinition.
Diffstat (limited to 'generator/cppgenerator.cpp')
-rw-r--r--generator/cppgenerator.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp
index f0c19e3ff..3ae270eb4 100644
--- a/generator/cppgenerator.cpp
+++ b/generator/cppgenerator.cpp
@@ -4108,11 +4108,10 @@ void CppGenerator::writeReturnValueHeuristics(QTextStream& s, const AbstractMeta
void CppGenerator::writeHashFunction(QTextStream& s, const AbstractMetaClass* metaClass)
{
- s << "static long " << cpythonBaseName(metaClass) << "_HashFunc(PyObject* obj)";
- s << '{' << endl;
+ s << "static long " << cpythonBaseName(metaClass) << "_HashFunc(PyObject* self) {" << endl;
+ writeCppSelfDefinition(s, metaClass);
s << INDENT << "return " << metaClass->typeEntry()->hashFunction() << '(';
- writeToCppConversion(s, metaClass, "obj");
- s << ");" << endl;
+ s << (isObjectType(metaClass) ? "" : "*") << CPP_SELF_VAR << ");" << endl;
s << '}' << endl << endl;
}