aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-01-20 07:01:51 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-01-21 00:48:50 +0000
commit4cf51e8c461a87fe119b39cb681fd23732c7b112 (patch)
tree11bff40cbeaa0ecc0207a316c89f7b4c8b982427
parent0d8b34e6f17e54d1481fedab769f73a94ee532fc (diff)
Test262Runner: fix -Wunused-but-set-variable
The 'int line' variable is shadowed a few lines below by the 'QByteArray line' one, even in the initial commit, so it can never have been used, except for the increment in the first line of the loop's bodies. Remove the variable, fix the warning. Found by Clang 15: test262runner.cpp:380:9: warning: variable 'line' set but not used [-Wunused-but-set-variable] int line = 0; ^ Amends d9c4a527241e0ef3a30e990c518197b0ba345b50. Change-Id: I2139aa4552d1ff2ddbb5737e2a1b26650d6519e7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 9d04888c9cb8a89f17279da6ed9b9f65a49a94b0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp b/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp
index 2c69847d71..03706b8e7c 100644
--- a/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp
+++ b/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp
@@ -373,9 +373,7 @@ void Test262Runner::loadTestExpectations()
return;
}
- int line = 0;
while (!file.atEnd()) {
- ++line;
QByteArray line = file.readLine().trimmed();
if (line.startsWith('#') || line.isEmpty())
continue;
@@ -420,9 +418,7 @@ void Test262Runner::updateTestExpectations()
QTemporaryFile updatedExpectations;
updatedExpectations.open();
- int line = 0;
while (!file.atEnd()) {
- ++line;
QByteArray originalLine = file.readLine();
QByteArray line = originalLine.trimmed();
if (line.startsWith('#') || line.isEmpty()) {