summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.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/cmSystemTools.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/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index fbb4416..b0e898b 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -97,7 +97,7 @@ cm_archive_entry_pathname(struct archive_entry *entry)
{
#if cmsys_STL_HAS_WSTRING
return cmsys::Encoding::ToNarrow(
- archive_entry_pathname_w(entry)).c_str();
+ archive_entry_pathname_w(entry));
#else
return archive_entry_pathname(entry);
#endif
@@ -881,7 +881,7 @@ std::string cmSystemTools::FileExistsInParentDirectories(const char* fname,
break;
}
prevDir = dir;
- dir = cmSystemTools::GetParentDirectory(dir.c_str());
+ dir = cmSystemTools::GetParentDirectory(dir);
}
return "";
}
@@ -1014,7 +1014,7 @@ void cmSystemTools::Glob(const std::string& directory,
cmsys::Directory d;
cmsys::RegularExpression reg(regexp.c_str());
- if (d.Load(directory.c_str()))
+ if (d.Load(directory))
{
size_t numf;
unsigned int i;
@@ -1044,7 +1044,7 @@ void cmSystemTools::GlobDirs(const std::string& path,
std::string finishPath = path.substr(pos+2);
cmsys::Directory d;
- if (d.Load(startPath.c_str()))
+ if (d.Load(startPath))
{
for (unsigned int i = 0; i < d.GetNumberOfFiles(); ++i)
{
@@ -1054,7 +1054,7 @@ void cmSystemTools::GlobDirs(const std::string& path,
std::string fname = startPath;
fname +="/";
fname += d.GetFile(i);
- if(cmSystemTools::FileIsDirectory(fname.c_str()))
+ if(cmSystemTools::FileIsDirectory(fname))
{
fname += finishPath;
cmSystemTools::GlobDirs(fname, files);
@@ -1168,7 +1168,7 @@ bool cmSystemTools::SimpleGlob(const std::string& glob,
bool res = false;
cmsys::Directory d;
- if (d.Load(path.c_str()))
+ if (d.Load(path))
{
for (unsigned int i = 0; i < d.GetNumberOfFiles(); ++i)
{
@@ -1182,11 +1182,11 @@ bool cmSystemTools::SimpleGlob(const std::string& glob,
}
fname += d.GetFile(i);
std::string sfname = d.GetFile(i);
- if ( type > 0 && cmSystemTools::FileIsDirectory(fname.c_str()) )
+ if ( type > 0 && cmSystemTools::FileIsDirectory(fname) )
{
continue;
}
- if ( type < 0 && !cmSystemTools::FileIsDirectory(fname.c_str()) )
+ if ( type < 0 && !cmSystemTools::FileIsDirectory(fname) )
{
continue;
}
@@ -1354,8 +1354,8 @@ std::string cmSystemTools::CollapseCombinedPath(std::string const& dir,
std::vector<std::string> dirComponents;
std::vector<std::string> fileComponents;
- cmSystemTools::SplitPath(dir.c_str(), dirComponents);
- cmSystemTools::SplitPath(file.c_str(), fileComponents);
+ cmSystemTools::SplitPath(dir, dirComponents);
+ cmSystemTools::SplitPath(file, fileComponents);
if(fileComponents.empty())
{
@@ -2176,7 +2176,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
if(cmSystemTools::FindProgramPath(argv0, exe, errorMsg))
{
// remove symlinks
- exe = cmSystemTools::GetRealPath(exe.c_str());
+ exe = cmSystemTools::GetRealPath(exe);
exe_dir =
cmSystemTools::GetFilenamePath(exe);
}
@@ -2227,7 +2227,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
cmsys::ifstream fin(src_dir_txt.c_str());
std::string src_dir;
if(fin && cmSystemTools::GetLineFromStream(fin, src_dir) &&
- cmSystemTools::FileIsDirectory(src_dir.c_str()))
+ cmSystemTools::FileIsDirectory(src_dir))
{
cmSystemToolsCMakeRoot = src_dir;
}
@@ -2237,7 +2237,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
src_dir_txt = dir + "/CMakeFiles/CMakeSourceDir.txt";
cmsys::ifstream fin2(src_dir_txt.c_str());
if(fin2 && cmSystemTools::GetLineFromStream(fin2, src_dir) &&
- cmSystemTools::FileIsDirectory(src_dir.c_str()))
+ cmSystemTools::FileIsDirectory(src_dir))
{
cmSystemToolsCMakeRoot = src_dir;
}
@@ -2333,7 +2333,7 @@ bool cmSystemTools::GuessLibrarySOName(std::string const& fullPath,
#endif
// If the file is not a symlink we have no guess for its soname.
- if(!cmSystemTools::FileIsSymlink(fullPath.c_str()))
+ if(!cmSystemTools::FileIsSymlink(fullPath))
{
return false;
}