From cc1139cc304b6bd4c8403d437cf08f73e06e243a Mon Sep 17 00:00:00 2001 From: Nils Gladitz Date: Wed, 15 Oct 2014 14:54:05 +0200 Subject: 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. --- Source/cmFileCommand.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Source/cmFileCommand.cxx') diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 1325cec928..93734d4de2 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -1504,7 +1504,7 @@ bool cmFileCopier::Run(std::vector const& args) { // Split the input file into its directory and name components. std::vector fromPathComponents; - cmSystemTools::SplitPath(files[i].c_str(), fromPathComponents); + cmSystemTools::SplitPath(files[i], fromPathComponents); std::string fromName = *(fromPathComponents.end()-1); std::string fromDir = cmSystemTools::JoinPath(fromPathComponents.begin(), fromPathComponents.end()-1); @@ -2203,7 +2203,7 @@ bool cmFileInstaller::HandleInstallDestination() return false; } } - if ( !cmSystemTools::FileIsDirectory(destination.c_str()) ) + if ( !cmSystemTools::FileIsDirectory(destination) ) { std::string errstring = "INSTALL destination: " + destination + " is not a directory."; @@ -2553,14 +2553,14 @@ bool cmFileCommand::HandleRemove(std::vector const& args, fileName += "/" + *i; } - if(cmSystemTools::FileIsDirectory(fileName.c_str()) && - !cmSystemTools::FileIsSymlink(fileName.c_str()) && recurse) + if(cmSystemTools::FileIsDirectory(fileName) && + !cmSystemTools::FileIsSymlink(fileName) && recurse) { - cmSystemTools::RemoveADirectory(fileName.c_str()); + cmSystemTools::RemoveADirectory(fileName); } else { - cmSystemTools::RemoveFile(fileName.c_str()); + cmSystemTools::RemoveFile(fileName); } } return true; @@ -2584,7 +2584,7 @@ bool cmFileCommand::HandleCMakePathCommand(std::vector #else char pathSep = ':'; #endif - std::vector path = cmSystemTools::SplitString(i->c_str(), + std::vector path = cmSystemTools::SplitString(*i, pathSep); i++; const char* var = i->c_str(); @@ -3241,7 +3241,7 @@ cmFileCommand::HandleUploadCommand(std::vector const& args) // Open file for reading: // - FILE *fin = cmsys::SystemTools::Fopen(filename.c_str(), "rb"); + FILE *fin = cmsys::SystemTools::Fopen(filename, "rb"); if(!fin) { std::string errStr = "UPLOAD cannot open file '"; -- cgit v1.2.1