From b5d7f5b0e8490a66cdd603e0ee38890426b3b6c4 Mon Sep 17 00:00:00 2001 From: Matthias Maennich Date: Tue, 19 Sep 2017 23:58:08 +0200 Subject: 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 --- Source/cmSystemTools.cxx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 26073d3..63c1452 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -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; +bool cmSystemTools::ChangeRPath(std::string const& /*file*/, + std::string const& /*oldRPath*/, + std::string const& /*newRPath*/, + std::string* /*emsg*/, bool* /*changed*/) +{ return false; -#endif } +#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; +bool cmSystemTools::RemoveRPath(std::string const& /*file*/, + std::string* /*emsg*/, bool* /*removed*/) +{ return false; -#endif } +#endif bool cmSystemTools::CheckRPath(std::string const& file, std::string const& newRPath) -- cgit v0.12