diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2021-07-12 12:03:26 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2021-07-12 15:24:59 +0000 |
commit | 264fa85f506f58e9cfc6a5a7ebe7c17b9db22494 (patch) | |
tree | 308d2a052337279324d70cab82f62b027db60d4e | |
parent | 1936006a9134a383a04b32ea94ecc1f152278eac (diff) | |
download | qt-creator-264fa85f506f58e9cfc6a5a7ebe7c17b9db22494.tar.gz |
Fix a number of compiler warnings
Change-Id: I3e71bffb2099d896742a6fca77febe20e2076464
Reviewed-by: hjk <hjk@qt.io>
9 files changed, 13 insertions, 7 deletions
diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 3905ae5f6a..816dc09650 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -120,7 +120,11 @@ static clang::format::FormatStyle qtcStyle() style.ExperimentalAutoDetectBinPacking = false; style.FixNamespaceComments = true; style.ForEachMacros = {"forever", "foreach", "Q_FOREACH", "BOOST_FOREACH"}; +#if LLVM_VERSION_MAJOR >= 12 + style.IncludeStyle.IncludeCategories = {{"^<Q.*", 200, 200, true}}; +#else style.IncludeStyle.IncludeCategories = {{"^<Q.*", 200, 200}}; +#endif style.IncludeStyle.IncludeIsMainRegex = "(Test)?$"; style.IndentCaseLabels = false; style.IndentWidth = 4; diff --git a/src/plugins/cppeditor/cppquickfixsettings.cpp b/src/plugins/cppeditor/cppquickfixsettings.cpp index 6d016d6e20..d9fbecb151 100644 --- a/src/plugins/cppeditor/cppquickfixsettings.cpp +++ b/src/plugins/cppeditor/cppquickfixsettings.cpp @@ -334,7 +334,7 @@ auto removeAndExtractTemplate(QString type) QString templateParameter; int counter = 0; int start = 0; - int templateStart; + int templateStart = 0; for (int i = 0; i < type.length(); ++i) { auto c = type[i]; if (c == '<') { diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 1ffc4f0943..b7bacb678c 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -1665,8 +1665,8 @@ bool BreakHandler::contextMenuEvent(const ItemViewEvent &ev) : locationsEnabled ? tr("Disable Location") : tr("Enable Location"), !selectedLocations.isEmpty() && handlesIndividualLocations, [this, selectedLocations, locationsEnabled] { - for (const SubBreakpoint &sbp : selectedLocations) - requestSubBreakpointEnabling(sbp, !locationsEnabled); + for (SubBreakpointItem * const sbp : selectedLocations) + requestSubBreakpointEnabling(QPointer(sbp), !locationsEnabled); } ); diff --git a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp index 5ac3ddc91e..bb95f5100b 100644 --- a/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/desktopdevice.cpp @@ -186,7 +186,7 @@ QList<FilePath> DesktopDevice::directoryEntries(const FilePath &filePath, { QTC_CHECK(!filePath.needsDevice()); const QDir dir(filePath.path()); - const QFileInfoList entryInfoList = dir.entryInfoList(nameFilters, filters); + const QFileInfoList entryInfoList = dir.entryInfoList(nameFilters, filters, sort); return Utils::transform(entryInfoList, &FilePath::fromFileInfo); } diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index 82e0058f37..51df879d9d 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -357,6 +357,7 @@ QByteArray IDevice::fileContents(const FilePath &filePath, qint64 limit, qint64 { Q_UNUSED(filePath); Q_UNUSED(limit); + Q_UNUSED(offset); QTC_CHECK(false); return {}; } diff --git a/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp b/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp index 290edf309b..f2cef3ead3 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/aligndistribute.cpp @@ -631,7 +631,7 @@ void AlignDistribute::distributeSpacing(Dimension dimension, QTC_ASSERT(!modelNode.isRootNode(), continue); if (QmlItemNode::isValidQmlItemNode(modelNode)) { QmlItemNode qmlItemNode(modelNode); - qreal parentPos; + qreal parentPos = 0; QByteArray propertyName; switch (dimension) { case Dimension::X: { diff --git a/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h b/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h index 444d25f6bd..0627b31404 100644 --- a/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h +++ b/src/plugins/qmldesigner/designercore/projectstorage/projectstoragetypes.h @@ -573,7 +573,7 @@ public: friend bool operator==(const ImportView &first, const ImportView &second) { return first.name == second.name - && first.version == second.version & first.sourceId == second.sourceId; + && first.version == second.version && first.sourceId == second.sourceId; } public: diff --git a/src/plugins/qmldesigner/settingspage.cpp b/src/plugins/qmldesigner/settingspage.cpp index 569cdb74d7..93a6fd566b 100644 --- a/src/plugins/qmldesigner/settingspage.cpp +++ b/src/plugins/qmldesigner/settingspage.cpp @@ -270,7 +270,7 @@ void SettingsPageWidget::apply() DesignerSettingsKey::ENABLE_TIMELINEVIEW }; - for (const QByteArray &key : restartNecessaryKeys) { + for (const char * const key : restartNecessaryKeys) { if (currentSettings.value(key) != newSettings.value(key)) { QMessageBox::information(Core::ICore::dialogParent(), tr("Restart Required"), tr("The made changes will take effect after a " diff --git a/src/plugins/webassembly/webassemblytoolchain.cpp b/src/plugins/webassembly/webassemblytoolchain.cpp index d0020cb6fd..c7755db21e 100644 --- a/src/plugins/webassembly/webassemblytoolchain.cpp +++ b/src/plugins/webassembly/webassemblytoolchain.cpp @@ -162,6 +162,7 @@ QList<ToolChain *> WebAssemblyToolChainFactory::autoDetect( const IDevice::Ptr &device) { Q_UNUSED(alreadyKnown) + Q_UNUSED(device) const FilePath sdk = WebAssemblyEmSdk::registeredEmSdk(); if (!WebAssemblyEmSdk::isValid(sdk)) |