Fix syncqt.cpp build warnings

Remove the deprecated timeStamp argument from the parseHeader function.
Fix signed/unsigned comparison between file size and buffer size.
User the correct oder when initializing variables.

Change-Id: I483cc175c9aaf42917053b6731833e1b4f5cad3a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2a69f96e162544686d7c2a31439b3ea69095162f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2023-02-15 11:08:45 +01:00 committed by Qt Cherry-pick Bot
parent 4034cc7c19
commit 4c96abdcc0

View File

@ -532,9 +532,9 @@ public:
SyncScanner(CommandLineOptions *commandLineArgs) SyncScanner(CommandLineOptions *commandLineArgs)
: m_commandLineArgs(commandLineArgs), : m_commandLineArgs(commandLineArgs),
m_masterHeaderContents(MasterHeaderIncludeComparator), m_masterHeaderContents(MasterHeaderIncludeComparator),
m_warningMessagePreamble(WarningMessagePreamble),
m_outputRootName( m_outputRootName(
std::filesystem::weakly_canonical(m_commandLineArgs->includeDir()).root_name()) std::filesystem::weakly_canonical(m_commandLineArgs->includeDir()).root_name()),
m_warningMessagePreamble(WarningMessagePreamble)
{ {
} }
@ -829,7 +829,7 @@ public:
ParsingResult parsingResult; ParsingResult parsingResult;
parsingResult.masterInclude = m_currentFileInSourceDir && !isExport && !is3rdParty parsingResult.masterInclude = m_currentFileInSourceDir && !isExport && !is3rdParty
&& !isQpa && !isPrivate && !isGenerated; && !isQpa && !isPrivate && !isGenerated;
if (!parseHeader(headerFile, originalStamp, parsingResult, skipChecks)) if (!parseHeader(headerFile, parsingResult, skipChecks))
return false; return false;
// Record the private header file inside the version script content. // Record the private header file inside the version script content.
@ -936,7 +936,7 @@ public:
// 'result' the function output value that stores the result of parsing. // 'result' the function output value that stores the result of parsing.
// 'skipChecks' checks that are not applicable for the header file. // 'skipChecks' checks that are not applicable for the header file.
[[nodiscard]] bool parseHeader(const std::filesystem::path &headerFile, [[nodiscard]] bool parseHeader(const std::filesystem::path &headerFile,
const FileStamp &timeStamp, ParsingResult &result, ParsingResult &result,
unsigned int skipChecks) unsigned int skipChecks)
{ {
if (m_commandLineArgs->showOnly()) if (m_commandLineArgs->showOnly())
@ -1551,7 +1551,7 @@ bool SyncScanner::writeIfDifferent(const std::string &outputFile, const std::str
if (!std::filesystem::exists(outputDirectory)) if (!std::filesystem::exists(outputDirectory))
std::filesystem::create_directories(outputDirectory); std::filesystem::create_directories(outputDirectory);
int expectedSize = buffer.size(); auto expectedSize = buffer.size();
#ifdef _WINDOWS #ifdef _WINDOWS
// File on disk has \r\n instead of just \n // File on disk has \r\n instead of just \n
expectedSize += std::count(buffer.begin(), buffer.end(), '\n'); expectedSize += std::count(buffer.begin(), buffer.end(), '\n');