summaryrefslogtreecommitdiffstats
path: root/Source/CTest/cmCTestCoverageHandler.cxx
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2014-10-15 12:54:05 (GMT)
committerNils Gladitz <nilsgladitz@gmail.com>2014-10-15 12:54:05 (GMT)
commitcc1139cc304b6bd4c8403d437cf08f73e06e243a (patch)
treee9645a08b795a6eef8233e82c07370bc3cfa0673 /Source/CTest/cmCTestCoverageHandler.cxx
parent1b3495d32e1523648da08e138482a654f8765333 (diff)
downloadCMake-cc1139cc304b6bd4c8403d437cf08f73e06e243a.zip
CMake-cc1139cc304b6bd4c8403d437cf08f73e06e243a.tar.gz
CMake-cc1139cc304b6bd4c8403d437cf08f73e06e243a.tar.bz2
strings: Remove redundant calls to std::string::c_str()
Replacements were detected and performed by the clang tool remove-cstr-calls on a linux build.
Diffstat (limited to 'Source/CTest/cmCTestCoverageHandler.cxx')
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx42
1 files changed, 21 insertions, 21 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 76f6584..4b322a8 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -164,7 +164,7 @@ void cmCTestCoverageHandler::CleanCoverageLogFiles(std::ostream& log)
fi != files.end(); ++fi)
{
log << "Removing old coverage log: " << *fi << "\n";
- cmSystemTools::RemoveFile(fi->c_str());
+ cmSystemTools::RemoveFile(*fi);
}
}
@@ -237,10 +237,10 @@ bool cmCTestCoverageHandler::ShouldIDoCoverage(const char* file,
std::string fSrcDir = cmSystemTools::CollapseFullPath(srcDir);
std::string fBinDir = cmSystemTools::CollapseFullPath(binDir);
std::string fFile = cmSystemTools::CollapseFullPath(file);
- bool sourceSubDir = cmSystemTools::IsSubDirectory(fFile.c_str(),
- fSrcDir.c_str());
- bool buildSubDir = cmSystemTools::IsSubDirectory(fFile.c_str(),
- fBinDir.c_str());
+ bool sourceSubDir = cmSystemTools::IsSubDirectory(fFile,
+ fSrcDir);
+ bool buildSubDir = cmSystemTools::IsSubDirectory(fFile,
+ fBinDir);
// Always check parent directory of the file.
std::string fileDir = cmSystemTools::GetFilenamePath(fFile);
std::string checkDir;
@@ -758,8 +758,8 @@ void cmCTestCoverageHandler::PopulateCustomVectors(cmMakefile *mf)
//----------------------------------------------------------------------
bool IsFileInDir(const std::string &infile, const std::string &indir)
{
- std::string file = cmSystemTools::CollapseFullPath(infile.c_str());
- std::string dir = cmSystemTools::CollapseFullPath(indir.c_str());
+ std::string file = cmSystemTools::CollapseFullPath(infile);
+ std::string dir = cmSystemTools::CollapseFullPath(indir);
if (
file.size() > dir.size() &&
@@ -779,7 +779,7 @@ int cmCTestCoverageHandler::HandlePHPCoverage(
{
cmParsePHPCoverage cov(*cont, this->CTest);
std::string coverageDir = this->CTest->GetBinaryDir() + "/xdebugCoverage";
- if(cmSystemTools::FileIsDirectory(coverageDir.c_str()))
+ if(cmSystemTools::FileIsDirectory(coverageDir))
{
cov.ReadPHPCoverageDirectory(coverageDir.c_str());
}
@@ -974,7 +974,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
std::string tempDir = testingDir + "/CoverageInfo";
std::string currentDirectory = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::MakeDirectory(tempDir.c_str());
- cmSystemTools::ChangeDirectory(tempDir.c_str());
+ cmSystemTools::ChangeDirectory(tempDir);
int gcovStyle = 0;
@@ -1295,7 +1295,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
*cont->OFS << " produced in source dir: " << sourceFile
<< std::endl;
actualSourceFile
- = cmSystemTools::CollapseFullPath(sourceFile.c_str());
+ = cmSystemTools::CollapseFullPath(sourceFile);
}
else if ( IsFileInDir(sourceFile, cont->BinaryDir) )
{
@@ -1304,7 +1304,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
*cont->OFS << " produced in binary dir: " << sourceFile
<< std::endl;
actualSourceFile
- = cmSystemTools::CollapseFullPath(sourceFile.c_str());
+ = cmSystemTools::CollapseFullPath(sourceFile);
}
if ( actualSourceFile.empty() )
@@ -1345,7 +1345,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
}
}
- cmSystemTools::ChangeDirectory(currentDirectory.c_str());
+ cmSystemTools::ChangeDirectory(currentDirectory);
return file_count;
}
@@ -1409,8 +1409,8 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
for ( it = files.begin(); it != files.end(); ++ it )
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, "." << std::flush);
- std::string fileDir = cmSystemTools::GetFilenamePath(it->c_str());
- cmSystemTools::ChangeDirectory(fileDir.c_str());
+ std::string fileDir = cmSystemTools::GetFilenamePath(*it);
+ cmSystemTools::ChangeDirectory(fileDir);
std::string command = "\"" + lcovCommand + "\" " +
lcovExtraFlags + " ";
@@ -1609,7 +1609,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
}
}
- cmSystemTools::ChangeDirectory(currentDirectory.c_str());
+ cmSystemTools::ChangeDirectory(currentDirectory);
return file_count;
}
@@ -1653,7 +1653,7 @@ void cmCTestCoverageHandler::FindLCovFiles(std::vector<std::string>& files)
gl.RecurseThroughSymlinksOff();
std::string prevBinaryDir;
cmSystemTools::ChangeDirectory(
- this->CTest->GetCTestConfiguration("BuildDirectory").c_str());
+ this->CTest->GetCTestConfiguration("BuildDirectory"));
// Run profmerge to merge all *.dyn files into dpi files
cmSystemTools::RunSingleCommand("profmerge");
@@ -1696,9 +1696,9 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
std::string tempDir = testingDir + "/CoverageInfo";
std::string currentDirectory = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::MakeDirectory(tempDir.c_str());
- cmSystemTools::ChangeDirectory(tempDir.c_str());
+ cmSystemTools::ChangeDirectory(tempDir);
- cmSystemTools::ChangeDirectory(currentDirectory.c_str());
+ cmSystemTools::ChangeDirectory(currentDirectory);
std::vector<std::string>::iterator fileIt;
int file_count = 0;
@@ -1714,7 +1714,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
}
std::string actualSourceFile
- = cmSystemTools::CollapseFullPath(fileName.c_str());
+ = cmSystemTools::CollapseFullPath(fileName);
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" Check coverage for file: " << actualSourceFile
<< std::endl);
@@ -1802,7 +1802,7 @@ int cmCTestCoverageHandler::HandleTracePyCoverage(
}
++ file_count;
}
- cmSystemTools::ChangeDirectory(currentDirectory.c_str());
+ cmSystemTools::ChangeDirectory(currentDirectory);
return file_count;
}
@@ -2132,7 +2132,7 @@ int cmCTestCoverageHandler::RunBullseyeSourceSummary(
file += "/";
file += sourceFile;
}
- file = cmSystemTools::CollapseFullPath(file.c_str());
+ file = cmSystemTools::CollapseFullPath(file);
bool shouldIDoCoverage
= this->ShouldIDoCoverage(file.c_str(),
cont->SourceDir.c_str(),