summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.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/cmLocalGenerator.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/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx38
1 files changed, 19 insertions, 19 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 50e279b..69b56c6 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -221,19 +221,19 @@ void cmLocalGenerator::SetupPathConversions()
std::string outdir;
outdir =
cmSystemTools::CollapseFullPath(this->Makefile->GetHomeDirectory());
- cmSystemTools::SplitPath(outdir.c_str(), this->HomeDirectoryComponents);
+ cmSystemTools::SplitPath(outdir, this->HomeDirectoryComponents);
outdir =
cmSystemTools::CollapseFullPath(this->Makefile->GetStartDirectory());
- cmSystemTools::SplitPath(outdir.c_str(), this->StartDirectoryComponents);
+ cmSystemTools::SplitPath(outdir, this->StartDirectoryComponents);
outdir = cmSystemTools::CollapseFullPath
(this->Makefile->GetHomeOutputDirectory());
- cmSystemTools::SplitPath(outdir.c_str(),
+ cmSystemTools::SplitPath(outdir,
this->HomeOutputDirectoryComponents);
outdir = cmSystemTools::CollapseFullPath
(this->Makefile->GetStartOutputDirectory());
- cmSystemTools::SplitPath(outdir.c_str(),
+ cmSystemTools::SplitPath(outdir,
this->StartOutputDirectoryComponents);
}
@@ -1247,7 +1247,7 @@ cmLocalGenerator::ConvertToOutputForExistingCommon(const std::string& remote,
cmSystemTools::FileExists(remote.c_str()))
{
std::string tmp;
- if(cmSystemTools::GetShortPath(remote.c_str(), tmp))
+ if(cmSystemTools::GetShortPath(remote, tmp))
{
return this->Convert(tmp, NONE, format, true);
}
@@ -1371,7 +1371,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
{
std::string frameworkDir = *i;
frameworkDir += "/../";
- frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir.c_str());
+ frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir);
if(emitted.insert(frameworkDir).second)
{
if (sysFwSearchFlag && target &&
@@ -1613,10 +1613,10 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
{
// Emit this directory only if it is a subdirectory of the
// top-level source or binary tree.
- if(cmSystemTools::ComparePath(i->c_str(), topSourceDir) ||
- cmSystemTools::ComparePath(i->c_str(), topBinaryDir) ||
- cmSystemTools::IsSubDirectory(i->c_str(), topSourceDir) ||
- cmSystemTools::IsSubDirectory(i->c_str(), topBinaryDir))
+ if(cmSystemTools::ComparePath(*i, topSourceDir) ||
+ cmSystemTools::ComparePath(*i, topBinaryDir) ||
+ cmSystemTools::IsSubDirectory(*i, topSourceDir) ||
+ cmSystemTools::IsSubDirectory(*i, topBinaryDir))
{
if(emitted.insert(*i).second)
{
@@ -2109,11 +2109,11 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName,
{
tLocation = target->GetLocation(config);
tLocation = cmSystemTools::GetFilenamePath(tLocation);
- tLocation = cmSystemTools::CollapseFullPath(tLocation.c_str());
+ tLocation = cmSystemTools::CollapseFullPath(tLocation);
}
std::string depLocation = cmSystemTools::GetFilenamePath(
std::string(inName));
- depLocation = cmSystemTools::CollapseFullPath(depLocation.c_str());
+ depLocation = cmSystemTools::CollapseFullPath(depLocation);
if(depLocation != tLocation)
{
// it is a full path to a depend that has the same name
@@ -2743,7 +2743,7 @@ std::string cmLocalGenerator::Convert(const std::string& source,
result);
break;
case FULL:
- result = cmSystemTools::CollapseFullPath(result.c_str());
+ result = cmSystemTools::CollapseFullPath(result);
break;
case NONE:
break;
@@ -2807,7 +2807,7 @@ std::string cmLocalGenerator::Convert(RelativeRoot remote,
if(!local.empty() && (!optional || this->UseRelativePaths))
{
std::vector<std::string> components;
- cmSystemTools::SplitPath(local.c_str(), components);
+ cmSystemTools::SplitPath(local, components);
std::string result = this->ConvertToRelativePath(components, remotePath);
return this->ConvertToOutputFormat(result, output);
}
@@ -2827,7 +2827,7 @@ std::string cmLocalGenerator::FindRelativePathTopSource()
{
std::string parentTop = parent->FindRelativePathTopSource();
if(cmSystemTools::IsSubDirectory(
- this->Makefile->GetStartDirectory(), parentTop.c_str()))
+ this->Makefile->GetStartDirectory(), parentTop))
{
return parentTop;
}
@@ -2847,7 +2847,7 @@ std::string cmLocalGenerator::FindRelativePathTopBinary()
{
std::string parentTop = parent->FindRelativePathTopBinary();
if(cmSystemTools::IsSubDirectory(
- this->Makefile->GetStartOutputDirectory(), parentTop.c_str()))
+ this->Makefile->GetStartOutputDirectory(), parentTop))
{
return parentTop;
}
@@ -2933,12 +2933,12 @@ cmLocalGenerator::ConvertToRelativePath(const std::vector<std::string>& local,
// Identify the longest shared path component between the remote
// path and the local path.
std::vector<std::string> remote;
- cmSystemTools::SplitPath(in_remote.c_str(), remote);
+ cmSystemTools::SplitPath(in_remote, remote);
unsigned int common=0;
while(common < remote.size() &&
common < local.size() &&
- cmSystemTools::ComparePath(remote[common].c_str(),
- local[common].c_str()))
+ cmSystemTools::ComparePath(remote[common],
+ local[common]))
{
++common;
}