From ff018a3f2cd9c94d569fa80f6966e3da166243bc Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 19 Feb 2024 18:31:25 +0200 Subject: [PATCH] Add pointer qualifications to auto-typed variables that are deduced to pointers. --- src/app/puzzle/xml/vplayoutfilewriter.cpp | 6 +++--- src/app/tape/dialogs/dialogmdatabase.cpp | 2 +- src/app/valentina/dialogs/dialoghistory.cpp | 2 +- src/libs/vdxf/vdxfengine.cpp | 4 ++-- src/libs/vformat/vdimensions.cpp | 6 +++--- src/libs/vformat/vpatternrecipe.cpp | 6 +++--- src/libs/vlayout/vboundary.cpp | 2 +- src/libs/vlayout/vposition.cpp | 2 +- src/libs/vpatterndb/vpiece.cpp | 4 ++-- src/libs/vpatterndb/vpiecepath.cpp | 2 +- src/libs/vtest/abstracttest.cpp | 2 +- src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp | 2 +- src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp | 2 +- src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp | 2 +- 14 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/app/puzzle/xml/vplayoutfilewriter.cpp b/src/app/puzzle/xml/vplayoutfilewriter.cpp index bb7f01da6..d66744d5e 100644 --- a/src/app/puzzle/xml/vplayoutfilewriter.cpp +++ b/src/app/puzzle/xml/vplayoutfilewriter.cpp @@ -293,7 +293,7 @@ void VPLayoutFileWriter::WritePiece(const VPPiecePtr &piece) writeStartElement(ML::TagSeamLine); QVector const contourPoints = piece->GetContourPoints(); - for (auto &point : contourPoints) + for (const auto &point : contourPoints) { WriteLayoutPoint(point); } @@ -307,7 +307,7 @@ void VPLayoutFileWriter::WritePiece(const VPPiecePtr &piece) if (piece->IsSeamAllowance() && not piece->IsSeamAllowanceBuiltIn()) { QVector const seamAllowancePoints = piece->GetSeamAllowancePoints(); - for (auto &point : seamAllowancePoints) + for (const auto &point : seamAllowancePoints) { WriteLayoutPoint(point); } @@ -350,7 +350,7 @@ void VPLayoutFileWriter::WritePiece(const VPPiecePtr &piece) [](bool mirrored) noexcept { return mirrored; }); QVector const points = path.Points(); - for (auto &point : points) + for (const auto &point : points) { WriteLayoutPoint(point); } diff --git a/src/app/tape/dialogs/dialogmdatabase.cpp b/src/app/tape/dialogs/dialogmdatabase.cpp index ddfd80b79..3fc0a20e0 100644 --- a/src/app/tape/dialogs/dialogmdatabase.cpp +++ b/src/app/tape/dialogs/dialogmdatabase.cpp @@ -313,7 +313,7 @@ void DialogMDataBase::InitDataBase(const QStringList &usedMeasurements) } QStringList const groups = knownDB.Groups(); - for (auto &group : groups) + for (const auto &group : groups) { QMap const groupMeasurements = knownDB.OrderedGroupMeasurements(group); m_groups.append(InitGroup(group, groupMeasurements, usedMeasurements)); diff --git a/src/app/valentina/dialogs/dialoghistory.cpp b/src/app/valentina/dialogs/dialoghistory.cpp index 67edc0ca5..62f348492 100644 --- a/src/app/valentina/dialogs/dialoghistory.cpp +++ b/src/app/valentina/dialogs/dialoghistory.cpp @@ -212,7 +212,7 @@ void DialogHistory::FillTable() QVector const historyRecords = QtConcurrent::blockingMapped(history, CreateRecord); - for (auto &record : historyRecords) + for (const auto &record : historyRecords) { if (not record.description.isEmpty()) { diff --git a/src/libs/vdxf/vdxfengine.cpp b/src/libs/vdxf/vdxfengine.cpp index 3b53d8042..41c9179ab 100644 --- a/src/libs/vdxf/vdxfengine.cpp +++ b/src/libs/vdxf/vdxfengine.cpp @@ -1040,7 +1040,7 @@ void VDxfEngine::ExportAAMAIntcut(const QSharedPointer &detailBlo }; QVector const drawIntCut = detail.MappedInternalPathsForCut(true); - for (auto &intCut : drawIntCut) + for (const auto &intCut : drawIntCut) { QVector points = intCut.Points(); DrawPolygon(points, false); @@ -1615,7 +1615,7 @@ void VDxfEngine::ExportASTMInternalCutout(const QSharedPointer &d }; QVector const drawIntCut = detail.MappedInternalPathsForCut(true); - for (auto &intCut : drawIntCut) + for (const auto &intCut : drawIntCut) { QVector points = intCut.Points(); DrawPolygon(points, intCut.IsNotMirrored(), false); diff --git a/src/libs/vformat/vdimensions.cpp b/src/libs/vformat/vdimensions.cpp index 305bf9050..693bec491 100644 --- a/src/libs/vformat/vdimensions.cpp +++ b/src/libs/vformat/vdimensions.cpp @@ -154,7 +154,7 @@ auto VAbstartMeasurementDimension::ValidBasesList() const -> QStringList QVector const bases = ValidBases(); QStringList list; list.reserve(bases.size()); - for(auto &base : bases) + for (const auto &base : bases) { list.append(QString::number(base)); } @@ -382,7 +382,7 @@ void VDimensionRestriction::SetExcludeString(const QString &exclude) m_exclude.clear(); QStringList const values = exclude.split(';'); - for(auto &value : values) + for (const auto &value : values) { bool ok = false; qreal const val = value.toDouble(&ok); @@ -400,7 +400,7 @@ auto VDimensionRestriction::GetExcludeString() const -> QString QList const list = m_exclude.values(); QStringList excludeList; - for(auto &value : list) + for (const auto &value : list) { excludeList.append(QString::number(value)); } diff --git a/src/libs/vformat/vpatternrecipe.cpp b/src/libs/vformat/vpatternrecipe.cpp index 8816e63c3..ac5cf687c 100644 --- a/src/libs/vformat/vpatternrecipe.cpp +++ b/src/libs/vformat/vpatternrecipe.cpp @@ -758,7 +758,7 @@ auto VPatternRecipe::SplinePath(const VToolRecord &record) -> QDomElement throw VExceptionInvalidHistory(QObject::tr("Empty list of nodes for tool with id '%1'.").arg(record.getId())); } - for (auto &pathNode : path) + for (const auto &pathNode : path) { QDomElement node = createElement(QStringLiteral("node")); @@ -804,7 +804,7 @@ auto VPatternRecipe::CubicBezierPath(const VToolRecord &record) -> QDomElement throw VExceptionInvalidHistory(QObject::tr("Empty list of nodes for tool with id '%1'.").arg(record.getId())); } - for (auto &pathNode : path) + for (const auto &pathNode : path) { QDomElement node = createElement(QStringLiteral("node")); @@ -1217,7 +1217,7 @@ auto VPatternRecipe::GroupOperationSource(VAbstractOperation *tool, quint32 id, throw VExceptionInvalidHistory(QObject::tr("Empty list of nodes for tool with id '%1'.").arg(id)); } - for (auto &item : items) + for (const auto &item : items) { QDomElement node = createElement(QStringLiteral("node")); diff --git a/src/libs/vlayout/vboundary.cpp b/src/libs/vlayout/vboundary.cpp index 961dba044..f143b0372 100644 --- a/src/libs/vlayout/vboundary.cpp +++ b/src/libs/vlayout/vboundary.cpp @@ -357,7 +357,7 @@ auto VBoundary::InsertDisconnect(QList &sequence, int } QVector> const shape = PreparePassmarkShape(passmark, drawMode, item.mirror); - for (auto &subShape : shape) + for (const auto &subShape : shape) { sequence.insert(i, PrepareSequenceItem(subShape, drawMode, VBoundarySequenceItem::PassmarkShape)); } diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index 3ef9f0a8c..cd2cc0dd0 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -247,7 +247,7 @@ auto VPosition::ArrangeDetail(const VPositionData &data, std::atomic_bool *stop, } QList const results = watcher.future().results(); - for (auto &result : results) + for (const auto &result : results) { bestResult.NewResult(result); } diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index 232172dd5..f343a9d3d 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -266,7 +266,7 @@ auto VPiece::PassmarksLines(const VContainer *data) const -> QVector { QVector const passmarks = Passmarks(data); QVector lines; - for (auto &passmark : passmarks) + for (const auto &passmark : passmarks) { if (not passmark.IsNull()) { @@ -1211,7 +1211,7 @@ auto VPiece::IsPassmarkVisible(const QVector &path, vsizetype passma return true; } - for (auto &record : records) + for (const auto &record : records) { if (record.includeType == PiecePathIncludeType::AsCustomSA) { diff --git a/src/libs/vpatterndb/vpiecepath.cpp b/src/libs/vpatterndb/vpiecepath.cpp index d5ee59844..0e811ce00 100644 --- a/src/libs/vpatterndb/vpiecepath.cpp +++ b/src/libs/vpatterndb/vpiecepath.cpp @@ -842,7 +842,7 @@ auto VPiecePath::Edge(quint32 p1, quint32 p2) const -> vsizetype auto VPiecePath::ListNodePoint() const -> QVector { QVector list; - for (auto &node : d->m_nodes) //-const V807 + for (const auto &node : d->m_nodes) //-const V807 { if (node.GetTypeTool() == Tool::NodePoint) { diff --git a/src/libs/vtest/abstracttest.cpp b/src/libs/vtest/abstracttest.cpp index 234008352..8577df1f6 100644 --- a/src/libs/vtest/abstracttest.cpp +++ b/src/libs/vtest/abstracttest.cpp @@ -469,7 +469,7 @@ auto AbstractTest::CopyRecursively(const QString &srcFilePath, const QString &tg QDir const sourceDir(srcFilePath); const QStringList fileNames = sourceDir.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System); - for (auto &fileName : fileNames) + for (const auto &fileName : fileNames) { const QString newSrcFilePath = srcFilePath + QDir::separator() + fileName; const QString newTgtFilePath = tgtFilePath + QDir::separator() + fileName; diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp index 4ecb0c691..010b08f05 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyaxis.cpp @@ -333,7 +333,7 @@ void DialogFlippingByAxis::SuffixChanged() { QRegularExpression const rx(NameRegExp()); const QStringList uniqueNames = data->AllUniqueNames(); - for (auto &uniqueName : uniqueNames) + for (const auto &uniqueName : uniqueNames) { const QString name = uniqueName + suffix; if (not rx.match(name).hasMatch() || not data->IsUnique(name)) diff --git a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp index bd0777604..7eb4847f6 100644 --- a/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogflippingbyline.cpp @@ -355,7 +355,7 @@ void DialogFlippingByLine::SuffixChanged() { QRegularExpression const rx(NameRegExp()); const QStringList uniqueNames = data->AllUniqueNames(); - for (auto &uniqueName : uniqueNames) + for (const auto &uniqueName : uniqueNames) { const QString name = uniqueName + suffix; if (not rx.match(name).hasMatch() || not data->IsUnique(name)) diff --git a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp index ced0b9df5..54dfed72c 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp @@ -4864,7 +4864,7 @@ auto DialogSeamAllowance::GetDefaultPieceName() const -> QString QList const pieces = data->DataPieces()->values(); QSet names; - for (auto &piece : pieces) + for (const auto &piece : pieces) { names.insert(piece.GetName()); }