diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2022-04-05 11:32:01 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-04-07 11:02:05 +0000 |
commit | 82fcc4be60defa16aa3da1f3bf311a775275d492 (patch) | |
tree | 67d12e7fd47a358276d170032bffe673c3118dba | |
parent | 984a5b9f8b8ea11a7db08238c501bcb819bb4c02 (diff) |
Remove unused variables in src/quick
Clang 15 started to give me -Wunused-but-set-variable on Ubuntu. I
suspect this is due to my local update (which could have included the
compiler as well). The following pattern (rightly) detected as "unused":
int foo = 0; // declaration
// ...
++foo; // usage, but in fact, this is just "an update of a definition"
// ... - foo is never used in any other expression, so warn
Specific messages:
qtdeclarative/src/quick/items/qquickwindow.cpp:2036:13: error: variable 'removed' set but not used [-Werror,-Wunused-but-set-variable]
int removed = 0;
^
qtdeclarative/src/quick/items/qquickwindow.cpp:2035:13: error: variable 'added' set but not used [-Werror,-Wunused-but-set-variable]
int added = 0;
^
qtdeclarative/src/quick/items/qquickwindow.cpp:2037:13: error: variable 'replaced' set but not used [-Werror,-Wunused-but-set-variable]
int replaced = 0;
^
qtdeclarative/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp:324:9: error: variable 'subnodeCount' set but not used [-Werror,-Wunused-but-set-variable]
int subnodeCount = 0;
^
Change-Id: I2a4d294a2527cee98f4e882050dc160efd04501e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 55e35adc052f3021e2921b36a9fd10b9a6248e1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 6 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgdistancefieldglyphnode.cpp | 2 |
2 files changed, 0 insertions, 8 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index a7af1d7119..7c16d7e770 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2054,9 +2054,6 @@ void QQuickWindowPrivate::updateDirtyNode(QQuickItem *item) // desired list is shorter. QSGNode *groupNode = itemPriv->childContainerNode(); QSGNode *currentNode = groupNode->firstChild(); - int added = 0; - int removed = 0; - int replaced = 0; QSGNode *desiredNode = nullptr; while (currentNode && (desiredNode = fetchNextNode(itemPriv, ii, fetchedPaintNode))) { @@ -2069,7 +2066,6 @@ void QQuickWindowPrivate::updateDirtyNode(QQuickItem *item) desiredNode->parent()->removeChildNode(desiredNode); groupNode->insertChildNodeAfter(desiredNode, currentNode); groupNode->removeChildNode(currentNode); - replaced++; // since we just replaced currentNode, we also need to reset // the pointer. @@ -2088,7 +2084,6 @@ void QQuickWindowPrivate::updateDirtyNode(QQuickItem *item) if (desiredNode->parent()) desiredNode->parent()->removeChildNode(desiredNode); groupNode->appendChildNode(desiredNode); - added++; } } else if (currentNode) { // on the other hand, if we processed less than our current node @@ -2098,7 +2093,6 @@ void QQuickWindowPrivate::updateDirtyNode(QQuickItem *item) QSGNode *node = currentNode->nextSibling(); groupNode->removeChildNode(currentNode); currentNode = node; - removed++; } } } diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp index 39012ba252..4c6589d1f9 100644 --- a/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp +++ b/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp @@ -317,7 +317,6 @@ void QSGDistanceFieldGlyphNode::updateGeometry() ip.append(o + 0); } - int subnodeCount = 0; if (m_glyphNodeType == SubGlyphNode) { Q_ASSERT(m_glyphsInOtherTextures.isEmpty()); } else { @@ -342,7 +341,6 @@ void QSGDistanceFieldGlyphNode::updateGeometry() subNode->update(); subNode->updateGeometry(); // we have to explicitly call this now as preprocess won't be called before it's rendered appendChildNode(subNode); - ++subnodeCount; } ++ite; } |