Commit 808b17b1 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

clang-tidy: fix `readability-make-member-function-const` warnings

parent 4470eb51
......@@ -24,7 +24,6 @@ readability-*,\
-readability-implicit-bool-conversion,\
-readability-inconsistent-declaration-parameter-name,\
-readability-magic-numbers,\
-readability-make-member-function-const,\
-readability-named-parameter,\
-readability-qualified-auto,\
-readability-redundant-access-specifiers,\
......
......@@ -44,7 +44,7 @@ bool cmCPackIFWCommon::IsSetToEmpty(const std::string& op) const
: false;
}
bool cmCPackIFWCommon::IsVersionLess(const char* version)
bool cmCPackIFWCommon::IsVersionLess(const char* version) const
{
if (!this->Generator) {
return false;
......@@ -54,7 +54,7 @@ bool cmCPackIFWCommon::IsVersionLess(const char* version)
cmSystemTools::OP_LESS, this->Generator->FrameworkVersion.data(), version);
}
bool cmCPackIFWCommon::IsVersionGreater(const char* version)
bool cmCPackIFWCommon::IsVersionGreater(const char* version) const
{
if (!this->Generator) {
return false;
......@@ -65,7 +65,7 @@ bool cmCPackIFWCommon::IsVersionGreater(const char* version)
version);
}
bool cmCPackIFWCommon::IsVersionEqual(const char* version)
bool cmCPackIFWCommon::IsVersionEqual(const char* version) const
{
if (!this->Generator) {
return false;
......@@ -118,7 +118,7 @@ void cmCPackIFWCommon::ExpandListArgument(
}
}
void cmCPackIFWCommon::WriteGeneratedByToStrim(cmXMLWriter& xout)
void cmCPackIFWCommon::WriteGeneratedByToStrim(cmXMLWriter& xout) const
{
if (!this->Generator) {
return;
......
......@@ -34,17 +34,17 @@ public:
/**
* Compare \a version with QtIFW framework version
*/
bool IsVersionLess(const char* version);
bool IsVersionLess(const char* version) const;
/**
* Compare \a version with QtIFW framework version
*/
bool IsVersionGreater(const char* version);
bool IsVersionGreater(const char* version) const;
/**
* Compare \a version with QtIFW framework version
*/
bool IsVersionEqual(const char* version);
bool IsVersionEqual(const char* version) const;
/** Expand the list argument containing the map of the key-value pairs.
* If the number of elements is odd, then the first value is used as the
......@@ -64,7 +64,7 @@ public:
cmCPackIFWGenerator* Generator;
protected:
void WriteGeneratedByToStrim(cmXMLWriter& xout);
void WriteGeneratedByToStrim(cmXMLWriter& xout) const;
};
#define cmCPackIFWLogger(logType, msg) \
......
......@@ -199,7 +199,7 @@ bool cmCPackIFWRepository::PatchUpdatesXml()
return cmSystemTools::RenameFile(updatesPatchXml, updatesXml);
}
void cmCPackIFWRepository::WriteRepositoryConfig(cmXMLWriter& xout)
void cmCPackIFWRepository::WriteRepositoryConfig(cmXMLWriter& xout) const
{
xout.StartElement("Repository");
......@@ -225,7 +225,7 @@ void cmCPackIFWRepository::WriteRepositoryConfig(cmXMLWriter& xout)
xout.EndElement();
}
void cmCPackIFWRepository::WriteRepositoryUpdate(cmXMLWriter& xout)
void cmCPackIFWRepository::WriteRepositoryUpdate(cmXMLWriter& xout) const
{
xout.StartElement("Repository");
......
......@@ -76,8 +76,8 @@ public:
bool PatchUpdatesXml();
void WriteRepositoryConfig(cmXMLWriter& xout);
void WriteRepositoryUpdate(cmXMLWriter& xout);
void WriteRepositoryConfig(cmXMLWriter& xout) const;
void WriteRepositoryUpdate(cmXMLWriter& xout) const;
void WriteRepositoryUpdates(cmXMLWriter& xout);
RepositoriesVector RepositoryUpdate;
......
......@@ -107,7 +107,7 @@ public:
this->PipeState = cmsysProcess_WaitForExit(this->Process, timeout);
return this->PipeState;
}
int GetProcessState() { return this->PipeState; }
int GetProcessState() const { return this->PipeState; }
private:
int PipeState;
......
......@@ -265,7 +265,7 @@ void cmCTestLaunch::LoadScrapeRules()
}
void cmCTestLaunch::LoadScrapeRules(
const char* purpose, std::vector<cmsys::RegularExpression>& regexps)
const char* purpose, std::vector<cmsys::RegularExpression>& regexps) const
{
std::string fname =
cmStrCat(this->Reporter.LogDir, "Custom", purpose, ".txt");
......
......@@ -60,7 +60,7 @@ private:
bool ScrapeRulesLoaded;
void LoadScrapeRules();
void LoadScrapeRules(const char* purpose,
std::vector<cmsys::RegularExpression>& regexps);
std::vector<cmsys::RegularExpression>& regexps) const;
bool ScrapeLog(std::string const& fname);
// Helper class to generate the xml fragment.
......
......@@ -150,7 +150,7 @@ void cmCTestLaunchReporter::WriteXML()
this->WriteXMLLabels(e2);
}
void cmCTestLaunchReporter::WriteXMLAction(cmXMLElement& e2)
void cmCTestLaunchReporter::WriteXMLAction(cmXMLElement& e2) const
{
e2.Comment("Meta-information about the build action");
cmXMLElement e3(e2, "Action");
......
......@@ -70,7 +70,7 @@ public:
// Methods to generate the xml fragment.
void WriteXML();
void WriteXMLAction(cmXMLElement&);
void WriteXMLAction(cmXMLElement&) const;
void WriteXMLCommand(cmXMLElement&);
void WriteXMLResult(cmXMLElement&);
void WriteXMLLabels(cmXMLElement&);
......
......@@ -300,7 +300,7 @@ void cmCTestMemCheckHandler::PopulateCustomVectors(cmMakefile* mf)
this->CustomTestsIgnore);
}
int cmCTestMemCheckHandler::GetDefectCount()
int cmCTestMemCheckHandler::GetDefectCount() const
{
return this->DefectCount;
}
......
......@@ -29,7 +29,7 @@ public:
void Initialize() override;
int GetDefectCount();
int GetDefectCount() const;
protected:
int PreProcessHandler() override;
......
......@@ -358,7 +358,7 @@ void cmProcess::ResetStartTime()
this->StartTime = std::chrono::steady_clock::now();
}
cmProcess::Exception cmProcess::GetExitException()
cmProcess::Exception cmProcess::GetExitException() const
{
auto exception = Exception::None;
#if defined(_WIN32) && !defined(__CYGWIN__)
......@@ -430,7 +430,7 @@ cmProcess::Exception cmProcess::GetExitException()
return exception;
}
std::string cmProcess::GetExitExceptionString()
std::string cmProcess::GetExitExceptionString() const
{
std::string exception_str;
#if defined(_WIN32)
......
......@@ -67,8 +67,8 @@ public:
Other
};
Exception GetExitException();
std::string GetExitExceptionString();
Exception GetExitException() const;
std::string GetExitExceptionString() const;
std::unique_ptr<cmCTestRunTest> GetRunner()
{
......
......@@ -951,6 +951,9 @@ void cmComputeLinkInformation::AddLinkExtension(std::string const& e,
}
}
// XXX(clang-tidy): This method's const-ness is platform dependent, so we
// cannot make it `const` as `clang-tidy` wants us to.
// NOLINTNEXTLINE(readability-make-member-function-const)
std::string cmComputeLinkInformation::CreateExtensionRegex(
std::vector<std::string> const& exts, LinkType type)
{
......
......@@ -77,7 +77,7 @@ bool cmDepends::Check(const std::string& makeFile,
return okay;
}
void cmDepends::Clear(const std::string& file)
void cmDepends::Clear(const std::string& file) const
{
// Print verbose output.
if (this->Verbose) {
......
......@@ -70,7 +70,7 @@ public:
DependencyMap& validDeps);
/** Clear dependencies for the target file so they will be regenerated. */
void Clear(const std::string& file);
void Clear(const std::string& file) const;
/** Set the file comparison object */
void SetFileTimeCache(cmFileTimeCache* fc) { this->FileTimeCache = fc; }
......
......@@ -103,7 +103,7 @@ void cmDependsJavaParserHelper::SafePrintMissing(const char* str, int line,
std::cout << "- " << strlen(str) << std::endl;
}
}
void cmDependsJavaParserHelper::Print(const char* place, const char* str)
void cmDependsJavaParserHelper::Print(const char* place, const char* str) const
{
if (this->Verbose) {
std::cout << "[" << place << "=" << str << "]" << std::endl;
......
......@@ -85,7 +85,7 @@ private:
void PrintClasses();
void Print(const char* place, const char* str);
void Print(const char* place, const char* str) const;
void CombineUnions(char** out, const char* in1, char** in2, const char* sep);
void SafePrintMissing(const char* str, int line, int cnt);
......
......@@ -27,7 +27,7 @@ public:
void SetResult(KWIML_INT_int64_t value);
KWIML_INT_int64_t GetResult() { return this->Result; }
KWIML_INT_int64_t GetResult() const { return this->Result; }
const char* GetError() { return this->ErrorString.c_str(); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment