diff options
author | Sergio Martins <sergio.martins@kdab.com> | 2018-11-29 17:40:10 +0000 |
---|---|---|
committer | Sérgio Martins <sergio.martins@kdab.com> | 2018-11-30 10:06:55 +0000 |
commit | 7e6ede9d5dbcc8f4c879d0dc467267ebd4610f7e (patch) | |
tree | 97d3fd89962def0585c2cc7792d58c3fc1002617 | |
parent | 2752a4632e94e2687655087d0d7f98b6b16e16a9 (diff) |
Fix warnings about unused Qt containers
Fixes -Wclazy-unused-non-trivial warnings, in preparation for using
gcc/clang's warn_unused attribute in all containers.
Maintainers please check if some unused variable isn't hidding an
actual bug.
Change-Id: I83c5a11aa2328db3dce4c6c402295d86ef297c83
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | src/qml/compiler/qqmlirbuilder.cpp | 2 | ||||
-rw-r--r-- | src/qml/compiler/qv4codegen.cpp | 3 | ||||
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 2 | ||||
-rw-r--r-- | src/quick/designer/qquickdesignersupportitems.cpp | 10 | ||||
-rw-r--r-- | tools/qmlcachegen/generateloader.cpp | 2 | ||||
-rw-r--r-- | tools/qmlplugindump/main.cpp | 3 |
6 files changed, 7 insertions, 15 deletions
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp index 9021fd0284..9ff38db911 100644 --- a/src/qml/compiler/qqmlirbuilder.cpp +++ b/src/qml/compiler/qqmlirbuilder.cpp @@ -2514,8 +2514,6 @@ QmlIR::Object *IRLoader::loadObject(const QV4::CompiledData::Object *serializedO f->location = compiledFunction->location; f->nameIndex = compiledFunction->nameIndex; - const QString name = unit->stringAtInternal(compiledFunction->nameIndex); - f->formals.allocate(pool, int(compiledFunction->nFormals)); const quint32_le *formalNameIdx = compiledFunction->formalsTable(); for (uint i = 0; i < compiledFunction->nFormals; ++i, ++formalNameIdx) diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp index 8ec730a33d..63cdb78d27 100644 --- a/src/qml/compiler/qv4codegen.cpp +++ b/src/qml/compiler/qv4codegen.cpp @@ -2493,9 +2493,6 @@ bool Codegen::visit(ObjectPattern *ast) TailCallBlocker blockTailCalls(this); - QVector<QPair<Reference, ObjectPropertyValue>> computedProperties; - QMap<QString, ObjectPropertyValue> valueMap; - RegisterScope scope(this); QStringList members; diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index 9df502f778..fc48957bcb 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -1891,8 +1891,6 @@ bool QQmlTypeLoader::fileExists(const QString &path, const QString &file) if (!fileSet) return false; - QString absoluteFilePath; - bool *value = fileSet->object(file); if (value) { return *value; diff --git a/src/quick/designer/qquickdesignersupportitems.cpp b/src/quick/designer/qquickdesignersupportitems.cpp index 1c338fa79d..ed5fdf3a4a 100644 --- a/src/quick/designer/qquickdesignersupportitems.cpp +++ b/src/quick/designer/qquickdesignersupportitems.cpp @@ -192,19 +192,19 @@ static bool isCrashingType(const QQmlType &type) { QString name = type.qmlTypeName(); - if (type.qmlTypeName() == QLatin1String("QtMultimedia/MediaPlayer")) + if (name == QLatin1String("QtMultimedia/MediaPlayer")) return true; - if (type.qmlTypeName() == QLatin1String("QtMultimedia/Audio")) + if (name == QLatin1String("QtMultimedia/Audio")) return true; - if (type.qmlTypeName() == QLatin1String("QtQuick.Controls/MenuItem")) + if (name == QLatin1String("QtQuick.Controls/MenuItem")) return true; - if (type.qmlTypeName() == QLatin1String("QtQuick.Controls/Menu")) + if (name == QLatin1String("QtQuick.Controls/Menu")) return true; - if (type.qmlTypeName() == QLatin1String("QtQuick/Timer")) + if (name == QLatin1String("QtQuick/Timer")) return true; return false; diff --git a/tools/qmlcachegen/generateloader.cpp b/tools/qmlcachegen/generateloader.cpp index 3d2f35617f..de79576d67 100644 --- a/tools/qmlcachegen/generateloader.cpp +++ b/tools/qmlcachegen/generateloader.cpp @@ -345,7 +345,7 @@ bool generateLoader(const QStringList &compiledFiles, const QString &outputFileN for (int i = 0; i < compiledFiles.count(); ++i) { const QString compiledFile = compiledFiles.at(i); const QString ns = symbolNamespaceForPath(compiledFile); - stream << "namespace " << symbolNamespaceForPath(compiledFile) << " { \n"; + stream << "namespace " << ns << " { \n"; stream << " extern const unsigned char qmlData[];\n"; stream << " const QQmlPrivate::CachedQmlUnit unit = {\n"; stream << " reinterpret_cast<const QV4::CompiledData::Unit*>(&qmlData), nullptr, nullptr\n"; diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp index 7ab42e9a26..565152d5d2 100644 --- a/tools/qmlplugindump/main.cpp +++ b/tools/qmlplugindump/main.cpp @@ -1138,8 +1138,7 @@ int main(int argc, char *argv[]) QRegularExpressionMatchIterator i = re.globalMatch(merge[1]); while (i.hasNext()) { QRegularExpressionMatch m = i.next(); - QString d = m.captured(1); - mergeDependencies << m.captured(1); + mergeDependencies << m.captured(1); } mergeComponents = merge [2]; } |