Skip to content

Commit e2faf27

Browse files
committed
Merge pull request #4 from o11c/primitive-type-name
Fix incorrect primitive type and add a check. This is just for debugging. After printing the missing types, we add them and disable the abort()
2 parents 5ccd9e6 + 60e119c commit e2faf27

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

generator/shiboken/shibokengenerator.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void ShibokenGenerator::initPrimitiveTypesCorrespondences()
131131
// PyLong
132132
m_pythonPrimitiveTypeName["unsigned long"] = "PyLong";
133133
m_pythonPrimitiveTypeName["signed long"] = "PyLong";
134-
m_pythonPrimitiveTypeName["ulong"] = "PyLong";
134+
m_pythonPrimitiveTypeName["unsigned long int"] = "PyLong";
135135
m_pythonPrimitiveTypeName["long long"] = "PyLong";
136136
m_pythonPrimitiveTypeName["__int64"] = "PyLong";
137137
m_pythonPrimitiveTypeName["unsigned long long"] = "PyLong";
@@ -640,7 +640,7 @@ QString ShibokenGenerator::cpythonBaseName(const TypeEntry* type)
640640
while (ptype->basicAliasedTypeEntry())
641641
ptype = ptype->basicAliasedTypeEntry();
642642
if (ptype->targetLangApiName() == ptype->name())
643-
baseName = m_pythonPrimitiveTypeName[ptype->name()];
643+
baseName = pythonPrimitiveTypeName(ptype->name());
644644
else
645645
baseName = ptype->targetLangApiName();
646646
} else if (type->isEnum()) {
@@ -779,7 +779,10 @@ QString ShibokenGenerator::fixedCppTypeName(const TypeEntry* type, QString typeN
779779

780780
QString ShibokenGenerator::pythonPrimitiveTypeName(const QString& cppTypeName)
781781
{
782-
return ShibokenGenerator::m_pythonPrimitiveTypeName.value(cppTypeName, QString());
782+
QString rv = ShibokenGenerator::m_pythonPrimitiveTypeName.value(cppTypeName, QString());
783+
if (rv.isEmpty())
784+
abort();
785+
return rv;
783786
}
784787

785788
QString ShibokenGenerator::pythonPrimitiveTypeName(const PrimitiveTypeEntry* type)

0 commit comments

Comments
 (0)