1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Prevent shadowing of function arguments by local vars

This commit is contained in:
Michał Janiszewski
2018-10-29 16:56:14 +01:00
parent e814aca29f
commit 7be9aa4868
11 changed files with 28 additions and 28 deletions

View File

@@ -160,15 +160,15 @@ std::vector<std::string> ZipArchive::listFiles(boost::filesystem::path filename)
do
{
unz_file_info64 info;
std::vector<char> filename;
std::vector<char> zipFilename;
unzGetCurrentFileInfo64 (file, &info, nullptr, 0, nullptr, 0, nullptr, 0);
filename.resize(info.size_filename);
zipFilename.resize(info.size_filename);
// Get name of current file. Contrary to docs "info" parameter can't be null
unzGetCurrentFileInfo64 (file, &info, filename.data(), filename.size(), nullptr, 0, nullptr, 0);
unzGetCurrentFileInfo64 (file, &info, zipFilename.data(), zipFilename.size(), nullptr, 0, nullptr, 0);
ret.push_back(std::string(filename.data(), filename.size()));
ret.push_back(std::string(zipFilename.data(), zipFilename.size()));
}
while (unzGoToNextFile(file) == UNZ_OK);
}

View File

@@ -113,8 +113,8 @@ void CFilesystemGenerator::loadJsonMap(const std::string &mountPoint, const Json
if (filename)
{
auto configData = CResourceHandler::get("initial")->load(ResourceID(URI, EResType::TEXT))->readAll();
const JsonNode config((char*)configData.first.get(), configData.second);
filesystem->addLoader(new CMappedFileLoader(mountPoint, config), false);
const JsonNode configInitial((char*)configData.first.get(), configData.second);
filesystem->addLoader(new CMappedFileLoader(mountPoint, configInitial), false);
}
}