diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-07-28 00:30:00 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:17:05 -0300 |
commit | 40b7e0c83b76a208117f5fd4c0c3b850beb3d889 (patch) | |
tree | 3047ae732532a0bf2a2dd4a01d416df43eaedb58 /generator | |
parent | 849c246c1e459ddeb545b5a4520365fbb803bf55 (diff) |
Removed unused parameter from writeInvalidCppObjectCheck().
Also removed the default value for a more explicit use of the method.
Diffstat (limited to 'generator')
-rw-r--r-- | generator/cppgenerator.cpp | 14 | ||||
-rw-r--r-- | generator/cppgenerator.h | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/generator/cppgenerator.cpp b/generator/cppgenerator.cpp index 8848e34a2..0d56aeedb 100644 --- a/generator/cppgenerator.cpp +++ b/generator/cppgenerator.cpp @@ -1204,12 +1204,12 @@ void CppGenerator::writeMethodWrapper(QTextStream& s, const AbstractMetaFunction s << INDENT << "if (self) {" << endl; { Indentation indent(INDENT); - writeInvalidCppObjectCheck(s); + writeInvalidCppObjectCheck(s, "self"); s << INDENT << cppSelfAttribution << ';' << endl; } s << INDENT << '}' << endl; } else { - writeInvalidCppObjectCheck(s); + writeInvalidCppObjectCheck(s, "self"); s << INDENT << cppSelfAttribution << ';' << endl; } s << endl; @@ -1526,7 +1526,7 @@ void CppGenerator::writeErrorSection(QTextStream& s, OverloadData& overloadData) s << INDENT << "return " << m_currentErrorCode << ';' << endl; } -void CppGenerator::writeInvalidCppObjectCheck(QTextStream& s, QString pyArgName, const TypeEntry* type) +void CppGenerator::writeInvalidCppObjectCheck(QTextStream& s, const QString& pyArgName) { s << INDENT << "if (!Shiboken::Object::isValid(" << pyArgName << "))" << endl; Indentation indent(INDENT); @@ -1586,8 +1586,8 @@ void CppGenerator::writeArgumentConversion(QTextStream& s, Options flags = getConverterOptions(argType); typeName = translateTypeForWrapperMethod(argType, context, flags).trimmed(); - if (ShibokenGenerator::isWrapperType(type)) - writeInvalidCppObjectCheck(s, pyArgName, 0); + if (isWrapperType(type)) + writeInvalidCppObjectCheck(s, pyArgName); // Value type that has default value. if (argType->isValue() && !defaultValue.isEmpty()) @@ -2662,7 +2662,7 @@ void CppGenerator::writeMappingMethods(QTextStream& s, const AbstractMetaClass* CodeSnipList snips = func->injectedCodeSnips(CodeSnip::Any, TypeSystem::TargetLangCode); s << funcRetVal << ' ' << funcName << '(' << funcArgs << ')' << endl << '{' << endl; - writeInvalidCppObjectCheck(s); + writeInvalidCppObjectCheck(s, "self"); writeCppSelfDefinition(s, func); @@ -2690,7 +2690,7 @@ void CppGenerator::writeSequenceMethods(QTextStream& s, const AbstractMetaClass* CodeSnipList snips = func->injectedCodeSnips(CodeSnip::Any, TypeSystem::TargetLangCode); s << funcRetVal << ' ' << funcName << '(' << funcArgs << ')' << endl << '{' << endl; - writeInvalidCppObjectCheck(s); + writeInvalidCppObjectCheck(s, "self"); writeCppSelfDefinition(s, func); diff --git a/generator/cppgenerator.h b/generator/cppgenerator.h index 185380e4b..08b05aa8b 100644 --- a/generator/cppgenerator.h +++ b/generator/cppgenerator.h @@ -63,7 +63,7 @@ private: * \param argName Python argument name * \param type the TypeEntry passed when the validity check must confirm the type of the Python wrapper to be checked */ - void writeInvalidCppObjectCheck(QTextStream& s, QString pyArgName = "self", const TypeEntry* type = 0); + void writeInvalidCppObjectCheck(QTextStream& s, const QString& pyArgName); void writeTypeCheck(QTextStream& s, const AbstractMetaType* argType, QString argumentName, bool isNumber = false, QString customType = ""); void writeTypeCheck(QTextStream& s, const OverloadData* overloadData, QString argumentName); |