diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2010-03-05 15:43:14 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2010-03-18 19:45:07 -0300 |
commit | dc8dcf70f06304105d9a4e6467d98a266dbfe78f (patch) | |
tree | b78dba3e4b94ba3528cdcc7dd7f2e01224b684bf /cppgenerator.cpp | |
parent | f52951862649d104abf664da5d456b0e0bb987fd (diff) |
Changed the semantic of Converter<T>::isConvertible method.
The new semantic is:
Returns true when the type can be converted to T OR the type is T.
The old semantic was:
Returns true when the type can be converted to T and false if the
type is T, however int and float converters did not follow this
rule, because they used PyNumber_Check on their isConvertible implementation.
Diffstat (limited to 'cppgenerator.cpp')
-rw-r--r-- | cppgenerator.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/cppgenerator.cpp b/cppgenerator.cpp index b5c2d8709..749fa001a 100644 --- a/cppgenerator.cpp +++ b/cppgenerator.cpp @@ -1057,11 +1057,6 @@ void CppGenerator::writeInvalidCppObjectCheck(QTextStream& s, QString pyArgName, void CppGenerator::writeTypeCheck(QTextStream& s, const AbstractMetaType* argType, QString argumentName, bool isNumber, QString customType) { - bool writeIsConvertibleCheck = argType->typeEntry()->isObject() || argType->typeEntry()->isValue(); - - if (writeIsConvertibleCheck || isCString(argType) || isPairContainer(argType)) - s << '('; - if (!customType.isEmpty()) s << guessCPythonCheckFunction(customType); else if (argType->typeEntry()->isFlags()) @@ -1072,13 +1067,6 @@ void CppGenerator::writeTypeCheck(QTextStream& s, const AbstractMetaType* argTyp s << cpythonCheckFunction(argType, isNumber); s << '(' << argumentName << ')'; - - if (isPairContainer(argType)) - s << " && PySequence_Size(" << argumentName << ") == 2)"; - else if (isCString(argType)) - s << " || " << argumentName << " == Py_None)"; - else if (writeIsConvertibleCheck) - s << " || " << cpythonIsConvertibleFunction(argType) << '(' << argumentName << "))"; } void CppGenerator::writeTypeCheck(QTextStream& s, const OverloadData* overloadData, QString argumentName) |