aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/typesystem.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-16 15:45:10 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-17 10:07:55 +0000
commit181fa70b7ba06c92c3c0fdc4c70081b14e4b1bdf (patch)
tree3342c5f2020cf693594554b4f96bff6e8f39cf9c /sources/shiboken2/ApiExtractor/typesystem.cpp
parent9d4c604943d73cb1c8f1a6dfdf9129f92bed0661 (diff)
shiboken: Fix some clazy warnings
- Mixing const/non-const iterators - Do not use operator[] on temporaries of type QVector - Remove unused nontrivial variables - Add Q_FALLTHROUGH() - Potential detach in range-based for Change-Id: I89391fdda616f119eadd7de529eb6cee69343f85 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/typesystem.cpp')
-rw-r--r--sources/shiboken2/ApiExtractor/typesystem.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystem.cpp b/sources/shiboken2/ApiExtractor/typesystem.cpp
index c6f723e4d..8564da3c4 100644
--- a/sources/shiboken2/ApiExtractor/typesystem.cpp
+++ b/sources/shiboken2/ApiExtractor/typesystem.cpp
@@ -373,6 +373,7 @@ bool Handler::endElement(const QStringRef &localName)
m_current->parent->entry->setCodeSnips(snips);
break;
}
+ Q_FALLTHROUGH();
case StackElement::NativeToTarget:
case StackElement::AddConversion:
m_contextStack.top()->codeSnips.last().addTemplateInstance(m_current->value.templateInstance);
@@ -756,20 +757,20 @@ bool Handler::startElement(const QStringRef &n, const QXmlStreamAttributes &atts
break;
case StackElement::ValueTypeEntry:
attributes.insert(QLatin1String("default-constructor"), QString());
- // fall throooough
+ Q_FALLTHROUGH();
case StackElement::ObjectTypeEntry:
attributes.insert(QLatin1String("force-abstract"), QLatin1String("no"));
attributes.insert(QLatin1String("deprecated"), QLatin1String("no"));
attributes.insert(QLatin1String("hash-function"), QString());
attributes.insert(QLatin1String("stream"), QLatin1String("no"));
- // fall throooough
+ Q_FALLTHROUGH();
case StackElement::InterfaceTypeEntry:
attributes[QLatin1String("default-superclass")] = m_defaultSuperclass;
attributes.insert(QLatin1String("polymorphic-id-expression"), QString());
attributes.insert(QLatin1String("delete-in-main-thread"), QLatin1String("no"));
attributes.insert(QLatin1String("held-type"), QString());
attributes.insert(QLatin1String("copyable"), QString());
- // fall through
+ Q_FALLTHROUGH();
case StackElement::NamespaceTypeEntry:
attributes.insert(QLatin1String("target-lang-name"), QString());
attributes[QLatin1String("package")] = m_defaultPackage;
@@ -968,7 +969,7 @@ bool Handler::startElement(const QStringRef &n, const QXmlStreamAttributes &atts
itype->setOrigin(otype);
element->entry = otype;
}
- // fall through
+ Q_FALLTHROUGH();
case StackElement::ValueTypeEntry: {
if (!element->entry) {
ValueTypeEntry* typeEntry = new ValueTypeEntry(name, since);
@@ -978,12 +979,12 @@ bool Handler::startElement(const QStringRef &n, const QXmlStreamAttributes &atts
element->entry = typeEntry;
}
- // fall through
+ Q_FALLTHROUGH();
case StackElement::NamespaceTypeEntry:
if (!element->entry)
element->entry = new NamespaceTypeEntry(name, since);
- // fall through
+ Q_FALLTHROUGH();
case StackElement::ObjectTypeEntry:
if (!element->entry)
element->entry = new ObjectTypeEntry(name, since);
@@ -1334,13 +1335,12 @@ bool Handler::startElement(const QStringRef &n, const QXmlStreamAttributes &atts
}
}
break;
- case StackElement::RejectEnumValue: {
+ case StackElement::RejectEnumValue:
if (!m_currentEnum) {
m_error = QLatin1String("<reject-enum-value> node must be used inside a <enum-type> node");
return false;
}
- QString name = attributes[nameAttribute()];
- } break;
+ break;
case StackElement::ReplaceType: {
if (topElement.type != StackElement::ModifyArgument) {
m_error = QLatin1String("Type replacement can only be specified for argument modifications");
@@ -2495,7 +2495,7 @@ AddedFunction::AddedFunction(QString signature, QString returnType, double vr) :
break;
}
// is const?
- m_isConst = signature.right(signatureLength - endPos).contains(QLatin1String("const"));
+ m_isConst = signature.rightRef(signatureLength - endPos).contains(QLatin1String("const"));
}
}