aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-25 09:51:39 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-25 10:44:01 +0200
commite5595a4b3010b1bb4b6f80a0339271a7b26934de (patch)
tree332a63307284ad7957c3daa9e8cb7ba6daed158f /sources/shiboken2/generator
parentddfbbd346b522703a5b6f8d274a7f79983e5f319 (diff)
shiboken: Introduce auto
Apply Fixits by Qt Creator with some amendments. Change-Id: Ib2be1012ef7e8a2ad0e6cd130371bf1e941c4264 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r--sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp4
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp4
-rw-r--r--sources/shiboken2/generator/shiboken2/headergenerator.cpp2
-rw-r--r--sources/shiboken2/generator/shiboken2/shibokengenerator.cpp18
4 files changed, 14 insertions, 14 deletions
diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
index 8d6c5903b..205ca5e99 100644
--- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
+++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp
@@ -387,7 +387,7 @@ QtXmlToSphinx::QtXmlToSphinx(QtDocGenerator* generator, const QString& doc, cons
void QtXmlToSphinx::pushOutputBuffer()
{
- QString* buffer = new QString();
+ auto *buffer = new QString();
m_buffers << buffer;
m_output.setString(buffer);
}
@@ -981,7 +981,7 @@ QtXmlToSphinx::LinkContext *QtXmlToSphinx::handleLinkStart(const QString &type,
{
ref.replace(QLatin1String("::"), QLatin1String("."));
ref.remove(QLatin1String("()"));
- LinkContext *result = new LinkContext(ref);
+ auto *result = new LinkContext(ref);
if (m_insideBold)
result->flags |= LinkContext::InsideBold;
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index a37606923..60ef30d16 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -390,7 +390,7 @@ void CppGenerator::generateClass(QTextStream &s, GeneratorContext &classContext)
// Create string literal for smart pointer getter method.
if (classContext.forSmartPointer()) {
- const SmartPointerTypeEntry *typeEntry =
+ const auto *typeEntry =
static_cast<const SmartPointerTypeEntry *>(classContext.preciseType()
->typeEntry());
QString rawGetter = typeEntry->getter();
@@ -509,7 +509,7 @@ void CppGenerator::generateClass(QTextStream &s, GeneratorContext &classContext)
else if (!rfunc->isOperatorOverload()) {
if (classContext.forSmartPointer()) {
- const SmartPointerTypeEntry *smartPointerTypeEntry =
+ const auto *smartPointerTypeEntry =
static_cast<const SmartPointerTypeEntry *>(
classContext.preciseType()->typeEntry());
diff --git a/sources/shiboken2/generator/shiboken2/headergenerator.cpp b/sources/shiboken2/generator/shiboken2/headergenerator.cpp
index 82b2d96d6..8a2c56232 100644
--- a/sources/shiboken2/generator/shiboken2/headergenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/headergenerator.cpp
@@ -310,7 +310,7 @@ void HeaderGenerator::writeTypeIndexValueLine(QTextStream &s, const TypeEntry *t
const int typeIndex = typeEntry->sbkIndex();
_writeTypeIndexValueLine(s, getTypeIndexVariableName(typeEntry), typeIndex);
if (typeEntry->isComplex()) {
- const ComplexTypeEntry *cType = static_cast<const ComplexTypeEntry *>(typeEntry);
+ const auto *cType = static_cast<const ComplexTypeEntry *>(typeEntry);
if (cType->baseContainerType()) {
const AbstractMetaClass *metaClass = AbstractMetaClass::findClass(classes(), cType);
if (metaClass->templateBaseClass())
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
index 693576444..b5f37cc57 100644
--- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
@@ -750,7 +750,7 @@ QString ShibokenGenerator::getFormatUnitString(const AbstractMetaFunction *func,
|| arg->type()->referenceType() == LValueReference) {
result += QLatin1Char(objType);
} else if (arg->type()->isPrimitive()) {
- const PrimitiveTypeEntry *ptype =
+ const auto *ptype =
static_cast<const PrimitiveTypeEntry *>(arg->type()->typeEntry());
if (ptype->basicReferencedTypeEntry())
ptype = ptype->basicReferencedTypeEntry();
@@ -790,7 +790,7 @@ QString ShibokenGenerator::cpythonBaseName(const TypeEntry *type)
if (ShibokenGenerator::isWrapperType(type) || type->isNamespace()) { // && type->referenceType() == NoReference) {
baseName = QLatin1String("Sbk_") + type->name();
} else if (type->isPrimitive()) {
- const PrimitiveTypeEntry *ptype = static_cast<const PrimitiveTypeEntry *>(type);
+ const auto *ptype = static_cast<const PrimitiveTypeEntry *>(type);
while (ptype->basicReferencedTypeEntry())
ptype = ptype->basicReferencedTypeEntry();
if (ptype->targetLangApiName() == ptype->name())
@@ -802,7 +802,7 @@ QString ShibokenGenerator::cpythonBaseName(const TypeEntry *type)
} else if (type->isFlags()) {
baseName = cpythonFlagsName(static_cast<const FlagsTypeEntry *>(type));
} else if (type->isContainer()) {
- const ContainerTypeEntry *ctype = static_cast<const ContainerTypeEntry *>(type);
+ const auto *ctype = static_cast<const ContainerTypeEntry *>(type);
switch (ctype->type()) {
case ContainerTypeEntry::ListContainer:
case ContainerTypeEntry::StringListContainer:
@@ -883,7 +883,7 @@ QString ShibokenGenerator::converterObject(const TypeEntry *type)
}
/* the typedef'd primitive types case */
- const PrimitiveTypeEntry *pte = dynamic_cast<const PrimitiveTypeEntry *>(type);
+ const auto *pte = dynamic_cast<const PrimitiveTypeEntry *>(type);
if (!pte) {
qDebug() << "Warning: the Qt5 primitive type is unknown" << type->qualifiedCppName();
return QString();
@@ -1104,7 +1104,7 @@ bool ShibokenGenerator::isUserPrimitive(const TypeEntry *type)
{
if (!type->isPrimitive())
return false;
- const PrimitiveTypeEntry *trueType = static_cast<const PrimitiveTypeEntry *>(type);
+ const auto *trueType = static_cast<const PrimitiveTypeEntry *>(type);
if (trueType->basicReferencedTypeEntry())
trueType = trueType->basicReferencedTypeEntry();
return trueType->isPrimitive() && !trueType->isCppPrimitive()
@@ -1124,7 +1124,7 @@ bool ShibokenGenerator::isCppPrimitive(const TypeEntry *type)
return true;
if (!type->isPrimitive())
return false;
- const PrimitiveTypeEntry *trueType = static_cast<const PrimitiveTypeEntry *>(type);
+ const auto *trueType = static_cast<const PrimitiveTypeEntry *>(type);
if (trueType->basicReferencedTypeEntry())
trueType = trueType->basicReferencedTypeEntry();
return trueType->qualifiedCppName() == QLatin1String("std::string");
@@ -2323,7 +2323,7 @@ AbstractMetaType *ShibokenGenerator::buildAbstractMetaTypeFromTypeEntry(const Ty
typeName.remove(0, 2);
if (m_metaTypeFromStringCache.contains(typeName))
return m_metaTypeFromStringCache.value(typeName);
- AbstractMetaType *metaType = new AbstractMetaType;
+ auto *metaType = new AbstractMetaType;
metaType->setTypeEntry(typeEntry);
metaType->clearIndirections();
metaType->setReferenceType(NoReference);
@@ -2663,7 +2663,7 @@ QString ShibokenGenerator::getTypeIndexVariableName(const AbstractMetaClass *met
QString ShibokenGenerator::getTypeIndexVariableName(const TypeEntry *type)
{
if (type->isCppPrimitive()) {
- const PrimitiveTypeEntry *trueType = static_cast<const PrimitiveTypeEntry *>(type);
+ const auto *trueType = static_cast<const PrimitiveTypeEntry *>(type);
if (trueType->basicReferencedTypeEntry())
type = trueType->basicReferencedTypeEntry();
}
@@ -2763,7 +2763,7 @@ bool ShibokenGenerator::isCppIntegralPrimitive(const TypeEntry *type)
{
if (!type->isCppPrimitive())
return false;
- const PrimitiveTypeEntry *trueType = static_cast<const PrimitiveTypeEntry *>(type);
+ const auto *trueType = static_cast<const PrimitiveTypeEntry *>(type);
if (trueType->basicReferencedTypeEntry())
trueType = trueType->basicReferencedTypeEntry();
QString typeName = trueType->qualifiedCppName();