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-23 18:11:19 +0000
commit42d69588b5a48ebc03e81e1d083316823d79ad5c (patch)
tree976b62c91d0a1aa7a8f6f660643c2ff3c7cfaf96
parent0a01bd32762f240d44230cebfc8b0913de57f49a (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 24633d9c6d..9037ed0c92 100644
--- a/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp
+++ b/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp
@@ -393,9 +393,7 @@ void Test262Runner::loadTestExpectations()
return;
}
- int line = 0;
while (!file.atEnd()) {
- ++line;
QByteArray line = file.readLine().trimmed();
if (line.startsWith('#') || line.isEmpty())
continue;
@@ -440,9 +438,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()) {