diff options
author | Marc Mutz <marc.mutz@qt.io> | 2023-01-20 07:01:51 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2023-01-20 20:39:11 +0100 |
commit | 9d04888c9cb8a89f17279da6ed9b9f65a49a94b0 (patch) | |
tree | 5d481590a5559d40301659ce58152203d119fe0a /tests/auto | |
parent | b112f7390663b7bb3166c4ef03c9fbd5f2392a87 (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.
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I2139aa4552d1ff2ddbb5737e2a1b26650d6519e7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp | 4 |
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 f50b390fa9..fc09182f19 100644 --- a/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp +++ b/tests/auto/qml/ecmascripttests/qjstest/test262runner.cpp @@ -377,9 +377,7 @@ void Test262Runner::loadTestExpectations() return; } - int line = 0; while (!file.atEnd()) { - ++line; QByteArray line = file.readLine().trimmed(); if (line.startsWith('#') || line.isEmpty()) continue; @@ -424,9 +422,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()) { |