summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2021-03-05 08:58:04 +0200
committerKatja Marttila <katja.marttila@qt.io>2021-03-09 13:23:44 +0200
commit6fdadf83710c37f70c1d2d621eacb9cbb327b23b (patch)
tree3b0aede467044c529fae34e6c3f5ac654ea9f974 /tools
parentabd97626ac2d50e54650a7256b48b7bbc1b2769e (diff)
Cppcheck: Fix local variable shadowing outer variable
Change-Id: Idff9a40c5089b4de7b8afd1c280603601317beda Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/devtool/binarydump.cpp6
-rw-r--r--tools/devtool/main.cpp26
2 files changed, 16 insertions, 16 deletions
diff --git a/tools/devtool/binarydump.cpp b/tools/devtool/binarydump.cpp
index bd8e9053c..bb0700149 100644
--- a/tools/devtool/binarydump.cpp
+++ b/tools/devtool/binarydump.cpp
@@ -117,10 +117,10 @@ int BinaryDump::dump(const QInstaller::ResourceCollectionManager &manager, const
if ((!isOpen) && (!resource->open()))
continue; // TODO: should we throw here?
- QFile target(targetDir.filePath(name) + QDir::separator()
+ QFile targetFile(targetDir.filePath(name) + QDir::separator()
+ QString::fromUtf8(resource->name()));
- QInstaller::openForWrite(&target);
- resource->copyData(&target); // copy the 7z files into the target directory
+ QInstaller::openForWrite(&targetFile);
+ resource->copyData(&targetFile); // copy the 7z files into the target directory
if (!isOpen) // If we reach that point, either the resource was opened already...
resource->close(); // or we did open it and have to close it again.
diff --git a/tools/devtool/main.cpp b/tools/devtool/main.cpp
index 52db7d8b3..8da6dfb75 100644
--- a/tools/devtool/main.cpp
+++ b/tools/devtool/main.cpp
@@ -182,31 +182,31 @@ int main(int argc, char *argv[])
quint64 cookie = QInstaller::BinaryContent::MagicCookie;
try {
{
- QFile tmp(path);
- QInstaller::openForRead(&tmp);
+ QFile tmpFile(path);
+ QInstaller::openForRead(&tmpFile);
- if (!tmp.seek(QInstaller::BinaryContent::findMagicCookie(&tmp, cookie) - sizeof(qint64)))
+ if (!tmpFile.seek(QInstaller::BinaryContent::findMagicCookie(&tmpFile, cookie) - sizeof(qint64)))
throw QInstaller::Error(QLatin1String("Cannot seek to read magic marker."));
QInstaller::BinaryLayout layout;
- layout.magicMarker = QInstaller::retrieveInt64(&tmp);
+ layout.magicMarker = QInstaller::retrieveInt64(&tmpFile);
if (layout.magicMarker == QInstaller::BinaryContent::MagicUninstallerMarker) {
- QFileInfo fi(path);
+ QFileInfo fileInfo(path);
- QInstaller::isInBundle(fi.absoluteFilePath(), &bundlePath);
- fi.setFile(bundlePath);
+ QInstaller::isInBundle(fileInfo.absoluteFilePath(), &bundlePath);
+ fileInfo.setFile(bundlePath);
- path = fi.absolutePath() + QLatin1Char('/') + fi.baseName() + QLatin1String(".dat");
+ path = fileInfo.absolutePath() + QLatin1Char('/') + fileInfo.baseName() + QLatin1String(".dat");
- tmp.close();
- tmp.setFileName(path);
- QInstaller::openForRead(&tmp);
+ tmpFile.close();
+ tmpFile.setFileName(path);
+ QInstaller::openForRead(&tmpFile);
cookie = QInstaller::BinaryContent::MagicCookieDat;
}
- layout = QInstaller::BinaryContent::binaryLayout(&tmp, cookie);
- tmp.close();
+ layout = QInstaller::BinaryContent::binaryLayout(&tmpFile, cookie);
+ tmpFile.close();
if (command == QLatin1String("update")) {
BinaryReplace br(layout); // To update the binary we do not need any mapping.