Fix occurrences of readability-non-const-parameter

Fix issues diagnosed by clang-tidy [readability-non-const-parameter]

The patch separates the definitions of the function headers for the two
variants (CMAKE_USE_ELF_PARSER or not) and comments out the parameter names
to not consider them for any const-ness in the case they are actually not
even looked at.

Signed-off-by: Matthias Maennich <matthias@maennich.net>
This commit is contained in:
Matthias Maennich
2017-09-19 23:58:08 +02:00
committed by Brad King
parent 9a2da33950
commit b5d7f5b0e8

View File

@@ -2326,12 +2326,12 @@ struct cmSystemToolsRPathInfo
};
#endif
#if defined(CMAKE_USE_ELF_PARSER)
bool cmSystemTools::ChangeRPath(std::string const& file,
std::string const& oldRPath,
std::string const& newRPath, std::string* emsg,
bool* changed)
{
#if defined(CMAKE_USE_ELF_PARSER)
if (changed) {
*changed = false;
}
@@ -2497,15 +2497,16 @@ bool cmSystemTools::ChangeRPath(std::string const& file,
*changed = true;
}
return true;
#else
(void)file;
(void)oldRPath;
(void)newRPath;
(void)emsg;
(void)changed;
return false;
#endif
}
#else
bool cmSystemTools::ChangeRPath(std::string const& /*file*/,
std::string const& /*oldRPath*/,
std::string const& /*newRPath*/,
std::string* /*emsg*/, bool* /*changed*/)
{
return false;
}
#endif
bool cmSystemTools::VersionCompare(cmSystemTools::CompareOp op,
const char* lhss, const char* rhss)
@@ -2639,10 +2640,10 @@ int cmSystemTools::strverscmp(std::string const& lhs, std::string const& rhs)
return cm_strverscmp(lhs.c_str(), rhs.c_str());
}
#if defined(CMAKE_USE_ELF_PARSER)
bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
bool* removed)
{
#if defined(CMAKE_USE_ELF_PARSER)
if (removed) {
*removed = false;
}
@@ -2780,13 +2781,14 @@ bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
*removed = true;
}
return true;
#else
(void)file;
(void)emsg;
(void)removed;
return false;
#endif
}
#else
bool cmSystemTools::RemoveRPath(std::string const& /*file*/,
std::string* /*emsg*/, bool* /*removed*/)
{
return false;
}
#endif
bool cmSystemTools::CheckRPath(std::string const& file,
std::string const& newRPath)