summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2016-05-26 19:58:51 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2016-05-26 19:58:51 (GMT)
commit618fb23fc9838d344e2033c64bfc1a3a55bb7f61 (patch)
treeabaabfaae8a9f5448d7ee062c757c61254792995 /Source/CTest
parentacd8a73044e879286f0cfa24b54497a8307f204b (diff)
downloadCMake-618fb23fc9838d344e2033c64bfc1a3a55bb7f61.zip
CMake-618fb23fc9838d344e2033c64bfc1a3a55bb7f61.tar.gz
CMake-618fb23fc9838d344e2033c64bfc1a3a55bb7f61.tar.bz2
Pass arguments that are not modified as const&.
Use clang-tidy's performance-unnecessary-value-param checker to find value parameter declarations of expensive to copy types that are not modified inside the function. Ignore findings in kwsys. After applying the fix-its, manually change `const T&` to `T const&`.
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx2
-rw-r--r--Source/CTest/cmCTestCoverageHandler.h2
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx2
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h2
-rw-r--r--Source/CTest/cmParseBlanketJSCoverage.cxx4
-rw-r--r--Source/CTest/cmParseBlanketJSCoverage.h2
-rw-r--r--Source/CTest/cmParseDelphiCoverage.cxx4
-rw-r--r--Source/CTest/cmParseDelphiCoverage.h2
-rw-r--r--Source/CTest/cmParseJacocoCoverage.cxx8
-rw-r--r--Source/CTest/cmParseJacocoCoverage.h2
10 files changed, 15 insertions, 15 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 51456ed..1f2d29c 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -1759,7 +1759,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
}
std::string cmCTestCoverageHandler::FindFile(
- cmCTestCoverageHandlerContainer* cont, std::string fileName)
+ cmCTestCoverageHandlerContainer* cont, std::string const& fileName)
{
std::string fileNameNoE =
cmSystemTools::GetFilenameWithoutLastExtension(fileName);
diff --git a/Source/CTest/cmCTestCoverageHandler.h b/Source/CTest/cmCTestCoverageHandler.h
index 4a2a602..1773218 100644
--- a/Source/CTest/cmCTestCoverageHandler.h
+++ b/Source/CTest/cmCTestCoverageHandler.h
@@ -119,7 +119,7 @@ private:
// Find the source file based on the source and build tree. This is used for
// Trace.py mode, since that one does not tell us where the source file is.
std::string FindFile(cmCTestCoverageHandlerContainer* cont,
- std::string fileName);
+ std::string const& fileName);
std::set<std::string> FindUncoveredFiles(
cmCTestCoverageHandlerContainer* cont);
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index d155023..6f19b32 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -500,7 +500,7 @@ void cmCTestMultiProcessHandler::ReadCostData()
}
}
-int cmCTestMultiProcessHandler::SearchByName(std::string name)
+int cmCTestMultiProcessHandler::SearchByName(std::string const& name)
{
int index = -1;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index cb709cc..9ec1528 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -84,7 +84,7 @@ protected:
void UpdateCostData();
void ReadCostData();
// Return index of a test based on its name
- int SearchByName(std::string name);
+ int SearchByName(std::string const& name);
void CreateTestCostList();
diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx
index 1e42847..9dc15c6 100644
--- a/Source/CTest/cmParseBlanketJSCoverage.cxx
+++ b/Source/CTest/cmParseBlanketJSCoverage.cxx
@@ -46,7 +46,7 @@ public:
return line.substr(begIndex, line.npos);
}
}
- bool ParseFile(std::string file)
+ bool ParseFile(std::string const& file)
{
FileLinesType localCoverageVector;
std::string filename;
@@ -138,7 +138,7 @@ bool cmParseBlanketJSCoverage::LoadCoverageData(std::vector<std::string> files)
return true;
}
-bool cmParseBlanketJSCoverage::ReadJSONFile(std::string file)
+bool cmParseBlanketJSCoverage::ReadJSONFile(std::string const& file)
{
cmParseBlanketJSCoverage::JSONParser parser(this->Coverage);
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
diff --git a/Source/CTest/cmParseBlanketJSCoverage.h b/Source/CTest/cmParseBlanketJSCoverage.h
index 4fc64e7..a4f6670 100644
--- a/Source/CTest/cmParseBlanketJSCoverage.h
+++ b/Source/CTest/cmParseBlanketJSCoverage.h
@@ -35,7 +35,7 @@ public:
cmCTest* ctest);
bool LoadCoverageData(std::vector<std::string> files);
// Read the JSON output
- bool ReadJSONFile(std::string file);
+ bool ReadJSONFile(std::string const& file);
protected:
class JSONParser;
diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx
index 2e06078..9d86ce9 100644
--- a/Source/CTest/cmParseDelphiCoverage.cxx
+++ b/Source/CTest/cmParseDelphiCoverage.cxx
@@ -22,7 +22,7 @@ public:
virtual ~HTMLParser() {}
bool initializeDelphiFile(
- const std::string filename,
+ std::string const& filename,
cmParseDelphiCoverage::HTMLParser::FileLinesType& coverageVector)
{
std::string line;
@@ -197,7 +197,7 @@ cmParseDelphiCoverage::cmParseDelphiCoverage(
}
bool cmParseDelphiCoverage::LoadCoverageData(
- const std::vector<std::string> files)
+ std::vector<std::string> const& files)
{
size_t i;
std::string path;
diff --git a/Source/CTest/cmParseDelphiCoverage.h b/Source/CTest/cmParseDelphiCoverage.h
index 06dea2b..c1c495c 100644
--- a/Source/CTest/cmParseDelphiCoverage.h
+++ b/Source/CTest/cmParseDelphiCoverage.h
@@ -28,7 +28,7 @@ class cmParseDelphiCoverage
{
public:
cmParseDelphiCoverage(cmCTestCoverageHandlerContainer& cont, cmCTest* ctest);
- bool LoadCoverageData(const std::vector<std::string> files);
+ bool LoadCoverageData(std::vector<std::string> const& files);
bool ReadDelphiHTML(const char* file);
// Read a single HTML file from output
bool ReadHTMLFile(const char* f);
diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx
index 6afaca6..335535d 100644
--- a/Source/CTest/cmParseJacocoCoverage.cxx
+++ b/Source/CTest/cmParseJacocoCoverage.cxx
@@ -85,7 +85,7 @@ protected:
}
}
- virtual bool FindPackagePath(const std::string fileName)
+ virtual bool FindPackagePath(std::string const& fileName)
{
// Search for the source file in the source directory.
if (this->PackagePathFound(fileName, this->Coverage.SourceDir)) {
@@ -99,8 +99,8 @@ protected:
return false;
}
- virtual bool PackagePathFound(const std::string fileName,
- const std::string baseDir)
+ virtual bool PackagePathFound(std::string const& fileName,
+ std::string const& baseDir)
{
// Search for the file in the baseDir and its subdirectories.
std::string packageGlob = baseDir;
@@ -149,7 +149,7 @@ cmParseJacocoCoverage::cmParseJacocoCoverage(
}
bool cmParseJacocoCoverage::LoadCoverageData(
- const std::vector<std::string> files)
+ std::vector<std::string> const& files)
{
// load all the jacoco.xml files in the source directory
cmsys::Directory dir;
diff --git a/Source/CTest/cmParseJacocoCoverage.h b/Source/CTest/cmParseJacocoCoverage.h
index fa31d47..bcd472e 100644
--- a/Source/CTest/cmParseJacocoCoverage.h
+++ b/Source/CTest/cmParseJacocoCoverage.h
@@ -27,7 +27,7 @@ class cmParseJacocoCoverage
{
public:
cmParseJacocoCoverage(cmCTestCoverageHandlerContainer& cont, cmCTest* ctest);
- bool LoadCoverageData(const std::vector<std::string> files);
+ bool LoadCoverageData(std::vector<std::string> const& files);
std::string PackageName;
std::string FileName;