summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-04-05 16:53:29 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2010-04-05 18:39:52 -0300
commit8752f1655bbd65cd5588fa6246c1fe274e2a0f5e (patch)
treeca7022de2a39656d88da78fd9e15e39cbd0d2409
parent319e5f2467e8682865f1206ae4ce4b3e2bdff147 (diff)
downloadshiboken-8752f1655bbd65cd5588fa6246c1fe274e2a0f5e.tar.gz
shiboken-8752f1655bbd65cd5588fa6246c1fe274e2a0f5e.tar.xz
shiboken-8752f1655bbd65cd5588fa6246c1fe274e2a0f5e.zip
Do not write Py_RETURN_FALSE twice.
-rw-r--r--cppgenerator.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp
index c1881a44..a0a8eec5 100644
--- a/cppgenerator.cpp
+++ b/cppgenerator.cpp
@@ -2152,7 +2152,7 @@ void CppGenerator::writeRichCompareFunction(QTextStream& s, const AbstractMetaCl
s << baseName << "_richcompare(PyObject* self, PyObject* other, int op)" << endl;
s << '{' << endl;
QList<AbstractMetaFunctionList> cmpOverloads = filterGroupedOperatorFunctions(metaClass, AbstractMetaClass::ComparisonOp);
- s << INDENT << "bool result;" << endl;
+ s << INDENT << "bool result = false;" << endl;
s << INDENT << metaClass->qualifiedCppName() << "& cpp_self = *" << cpythonWrapperCPtr(metaClass) << ';' << endl;
s << endl;
@@ -2254,12 +2254,8 @@ void CppGenerator::writeRichCompareFunction(QTextStream& s, const AbstractMetaCl
Indentation indent(INDENT);
s << INDENT << "Py_RETURN_TRUE;" << endl;
}
- s << INDENT << "Py_RETURN_FALSE;" << endl << endl;
s << INDENT << baseName << "_RichComparison_TypeError:" << endl;
- {
- Indentation indent(INDENT);
- s << INDENT << "Py_RETURN_FALSE;" << endl;
- }
+ s << INDENT << "Py_RETURN_FALSE;" << endl << endl;
s << '}' << endl << endl;
}