diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-11-23 10:05:50 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-11-23 10:09:54 (GMT) |
commit | 5eb4d7590e0e721b56fc735ab6da35d55ad339d0 (patch) | |
tree | e7edc44c5913f7647c46fa1a9df0472b3000ece2 | |
parent | 2a0c65485854bb6e6a33a7d5acd99c936adacec6 (diff) | |
download | CMake-5eb4d7590e0e721b56fc735ab6da35d55ad339d0.zip CMake-5eb4d7590e0e721b56fc735ab6da35d55ad339d0.tar.gz CMake-5eb4d7590e0e721b56fc735ab6da35d55ad339d0.tar.bz2 |
Remove some unneeded c_str calls.
26 files changed, 59 insertions, 59 deletions
diff --git a/Source/CPack/cmCPackComponentGroup.cxx b/Source/CPack/cmCPackComponentGroup.cxx index 77f11cb..fd20e9b 100644 --- a/Source/CPack/cmCPackComponentGroup.cxx +++ b/Source/CPack/cmCPackComponentGroup.cxx @@ -30,7 +30,7 @@ unsigned long cmCPackComponent::GetInstalledSize( std::string path = installDir; path += '/'; path += *fileIt; - this->TotalSize += cmSystemTools::FileLength(path.c_str()); + this->TotalSize += cmSystemTools::FileLength(path); } return this->TotalSize; diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index c939cd2..0a64bd5 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -390,7 +390,7 @@ int cmCPackDebGenerator::createDeb() packageFiles.begin(); fileIt != packageFiles.end(); ++ fileIt ) { - totalSize += cmSystemTools::FileLength(fileIt->c_str()); + totalSize += cmSystemTools::FileLength(*fileIt); } } out << "Installed-Size: " << (totalSize + 1023) / 1024 << "\n"; diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 31f0b59..e78f161 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -217,7 +217,7 @@ int cmCPackGenerator::InstallProject() { std::string destDir = "DESTDIR="; destDir += tempInstallDirectory; - cmSystemTools::PutEnv(destDir.c_str()); + cmSystemTools::PutEnv(destDir); } else { @@ -277,7 +277,7 @@ int cmCPackGenerator::InstallProjectViaInstallCommands( { std::string tempInstallDirectoryEnv = "CMAKE_INSTALL_PREFIX="; tempInstallDirectoryEnv += tempInstallDirectory; - cmSystemTools::PutEnv(tempInstallDirectoryEnv.c_str()); + cmSystemTools::PutEnv(tempInstallDirectoryEnv); std::vector<std::string> installCommandsVector; cmSystemTools::ExpandListArgument(installCommands,installCommandsVector); std::vector<std::string>::iterator it; @@ -404,7 +404,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( std::string targetFile; std::string inFileRelative = cmSystemTools::RelativePath(top.c_str(),inFile.c_str()); - cmSystemTools::ReadSymlink(inFile.c_str(),targetFile); + cmSystemTools::ReadSymlink(inFile,targetFile); symlinkedFiles.push_back(std::pair<std::string, std::string>(targetFile,inFileRelative)); } @@ -437,8 +437,8 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: " << symlinkedIt->second << "--> " << symlinkedIt->first << std::endl); - if (!cmSystemTools::CreateSymlink((symlinkedIt->first).c_str(), - (symlinkedIt->second).c_str())) + if (!cmSystemTools::CreateSymlink(symlinkedIt->first, + symlinkedIt->second)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create symlink: " << symlinkedIt->second << "--> " @@ -787,7 +787,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( * in order to put things in subdirs... */ cmSystemTools::PutEnv( - (std::string("DESTDIR=")+tempInstallDirectory).c_str() + std::string("DESTDIR=")+tempInstallDirectory ); cmCPackLogger(cmCPackLog::LOG_DEBUG, "- Creating directory: '" << dir << "'" << std::endl); diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx index c1fff7d..b506b06 100644 --- a/Source/CPack/cmCPackNSISGenerator.cxx +++ b/Source/CPack/cmCPackNSISGenerator.cxx @@ -825,7 +825,7 @@ CreateComponentDescription(cmCPackComponent *component, } out << std::endl; - totalSize += cmSystemTools::FileLength((dirName + *fileIt).c_str()); + totalSize += cmSystemTools::FileLength(dirName + *fileIt); } } diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx index 5e8f8f0..d226a6c 100644 --- a/Source/CTest/cmCTestBuildHandler.cxx +++ b/Source/CTest/cmCTestBuildHandler.cxx @@ -828,7 +828,7 @@ cmCTestBuildHandler::LaunchHelper::LaunchHelper(cmCTestBuildHandler* handler): this->WriteLauncherConfig(); std::string launchEnv = "CTEST_LAUNCH_LOGS="; launchEnv += launchDir; - cmSystemTools::PutEnv(launchEnv.c_str()); + cmSystemTools::PutEnv(launchEnv); } } diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 8dc22a8..e782886 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -884,7 +884,7 @@ struct cmCTestCoverageHandlerLocale { if(!lc_all.empty()) { - cmSystemTools::PutEnv(("LC_ALL=" + lc_all).c_str()); + cmSystemTools::PutEnv("LC_ALL=" + lc_all); } else { @@ -1491,24 +1491,24 @@ int cmCTestCoverageHandler::HandleLCovCoverage( lcovExtraFlags + " "; cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Current coverage dir: " - << fileDir.c_str() << std::endl); + << fileDir << std::endl); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, command.c_str() << std::endl); std::string output = ""; std::string errors = ""; int retVal = 0; - *cont->OFS << "* Run coverage for: " << fileDir.c_str() << std::endl; - *cont->OFS << " Command: " << command.c_str() << std::endl; + *cont->OFS << "* Run coverage for: " << fileDir << std::endl; + *cont->OFS << " Command: " << command << std::endl; int res = this->CTest->RunCommand(command.c_str(), &output, &errors, &retVal, fileDir.c_str(), 0 /*this->TimeOut*/); - *cont->OFS << " Output: " << output.c_str() << std::endl; - *cont->OFS << " Errors: " << errors.c_str() << std::endl; + *cont->OFS << " Output: " << output << std::endl; + *cont->OFS << " Errors: " << errors << std::endl; if ( ! res ) { cmCTestLog(this->CTest, ERROR_MESSAGE, - "Problem running coverage on file: " << it->c_str() << std::endl); + "Problem running coverage on file: " << *it << std::endl); cmCTestLog(this->CTest, ERROR_MESSAGE, "Command produced error: " << errors << std::endl); cont->Error ++; @@ -1517,7 +1517,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage( if ( retVal != 0 ) { cmCTestLog(this->CTest, ERROR_MESSAGE, "Coverage command returned: " - << retVal << " while processing: " << it->c_str() << std::endl); + << retVal << " while processing: " << *it << std::endl); cmCTestLog(this->CTest, ERROR_MESSAGE, "Command produced error: " << cont->Error << std::endl); } diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 5f065c2..6aa1c2b 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -234,7 +234,7 @@ bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix, ::curl_global_cleanup(); return false; } - unsigned long filelen = cmSystemTools::FileLength(local_file.c_str()); + unsigned long filelen = cmSystemTools::FileLength(local_file); ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); *this->LogFile << "\tUpload file: " << local_file << " to " @@ -475,7 +475,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix, ::curl_global_cleanup(); return false; } - unsigned long filelen = cmSystemTools::FileLength(local_file.c_str()); + unsigned long filelen = cmSystemTools::FileLength(local_file); ftpfile = cmsys::SystemTools::Fopen(local_file, "rb"); cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Upload file: " diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 435fb32..f330e58 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1939,7 +1939,7 @@ std::string cmCTestTestHandler::GenerateRegressionImages( cmCTest::CleanString(measurementfile.match(5)); if ( cmSystemTools::FileExists(filename.c_str()) ) { - long len = cmSystemTools::FileLength(filename.c_str()); + long len = cmSystemTools::FileLength(filename); if ( len == 0 ) { std::string k1 = measurementfile.match(1); diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx index 68f5fe1..7206914 100644 --- a/Source/CTest/cmCTestUpdateHandler.cxx +++ b/Source/CTest/cmCTestUpdateHandler.cxx @@ -98,7 +98,7 @@ cmCTestUpdateHandlerLocale::~cmCTestUpdateHandlerLocale() { std::string put = "LC_MESSAGES="; put += saveLCMessages; - cmSystemTools::PutEnv(put.c_str()); + cmSystemTools::PutEnv(put); } else { diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx index 5f4a708..fc90bc1 100644 --- a/Source/CTest/cmParseBlanketJSCoverage.cxx +++ b/Source/CTest/cmParseBlanketJSCoverage.cxx @@ -78,7 +78,7 @@ public: * information in the local vector */ FileLinesType& CoverageVector = - this->Coverage.TotalCoverage[filename.c_str()]; + this->Coverage.TotalCoverage[filename]; CoverageVector = localCoverageVector; localCoverageVector.clear(); foundFile=false; @@ -98,7 +98,7 @@ public: * FoundFile and foundSource ensure that * only the value of the line coverage is captured */ - std::string result = getValue(line,1).c_str(); + std::string result = getValue(line,1); result = result.substr(2,result.npos); if(result == "\"\"") { @@ -120,7 +120,7 @@ public: // On exit, capture end of last file covered. FileLinesType& CoverageVector = - this->Coverage.TotalCoverage[filename.c_str()]; + this->Coverage.TotalCoverage[filename]; CoverageVector = localCoverageVector; foundFile=false; localCoverageVector.clear(); diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 0734927..4200e9e 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -47,7 +47,7 @@ cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args, cmSystemTools::GetCMakeCursesCommand()); // create the arguments for the cmake object - std::string whereCMake = cmSystemTools::GetProgramPath(this->Args[0].c_str()); + std::string whereCMake = cmSystemTools::GetProgramPath(this->Args[0]); whereCMake += "/cmake"; this->Args[0] = whereCMake; this->CMakeInstance->SetArgs(this->Args); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index f88f72c..2bf7b77 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1688,7 +1688,7 @@ std::string cmCTest::Base64GzipEncodeFile(std::string file) //---------------------------------------------------------------------- std::string cmCTest::Base64EncodeFile(std::string file) { - long len = cmSystemTools::FileLength(file.c_str()); + long len = cmSystemTools::FileLength(file); cmsys::ifstream ifs(file.c_str(), std::ios::in #ifdef _WIN32 | std::ios::binary @@ -2860,7 +2860,7 @@ void cmCTest::SetConfigType(const char* ct) cmSystemTools::ReplaceString(this->ConfigType, ".\\", ""); std::string confTypeEnv = "CMAKE_CONFIG_TYPE=" + this->ConfigType; - cmSystemTools::PutEnv(confTypeEnv.c_str()); + cmSystemTools::PutEnv(confTypeEnv); } //---------------------------------------------------------------------- diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index b0ddff4..aa4c95b 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -1640,7 +1640,7 @@ bool cmFileCopier::InstallSymlink(const char* fromFile, const char* toFile) cmSystemTools::RemoveFile(toFile); // Create the symlink. - if(!cmSystemTools::CreateSymlink(symlinkTarget.c_str(), toFile)) + if(!cmSystemTools::CreateSymlink(symlinkTarget, toFile)) { cmOStringStream e; e << this->Name << " cannot duplicate symlink \"" << fromFile @@ -3282,7 +3282,7 @@ cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args) return false; } - unsigned long file_size = cmsys::SystemTools::FileLength(filename.c_str()); + unsigned long file_size = cmsys::SystemTools::FileLength(filename); #if defined(WIN32) && defined(CMAKE_ENCODING_UTF8) url = fix_file_url_windows(url); diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 51f33fd..0130006 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1475,7 +1475,7 @@ void cmFindPackageCommand::FillPrefixesBuilds() cmSystemTools::ExpandRegistryValues(f); cmSystemTools::ConvertToUnixSlashes(f); if(cmSystemTools::FileIsFullPath(f.c_str()) && - cmSystemTools::FileIsDirectory(f.c_str())) + cmSystemTools::FileIsDirectory(f)) { paths.AddPath(f); } diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index b6577e1..4ee419c 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -88,7 +88,7 @@ std::string cmFindProgramCommand { std::string appName = *name + std::string(".app"); - std::string appPath = cmSystemTools::FindDirectory(appName.c_str(), + std::string appPath = cmSystemTools::FindDirectory(appName, this->SearchPaths, true); diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx index 9aa8e6f..b0258f6 100644 --- a/Source/cmGeneratorExpressionEvaluator.cxx +++ b/Source/cmGeneratorExpressionEvaluator.cxx @@ -329,7 +329,7 @@ static const struct MakeCIdentifierNode : public cmGeneratorExpressionNode const GeneratorExpressionContent *, cmGeneratorExpressionDAGChecker *) const { - return cmSystemTools::MakeCidentifier(parameters.front().c_str()); + return cmSystemTools::MakeCidentifier(parameters.front()); } } makeCIdentifierNode; diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 77850af..e7d2857 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -79,7 +79,7 @@ bool cmGetFilenameComponentCommand } } } - cmSystemTools::SplitProgramFromArgs(filename.c_str(), + cmSystemTools::SplitProgramFromArgs(filename, result, programArgs); } else if (args[2] == "EXT") diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 4d49fe3..6def155 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -300,11 +300,11 @@ void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) { std::string dir; std::string file; - cmSystemTools::SplitProgramPath(makeProgram.c_str(), + cmSystemTools::SplitProgramPath(makeProgram, dir, file); std::string saveFile = file; cmSystemTools::GetShortPath(makeProgram, makeProgram); - cmSystemTools::SplitProgramPath(makeProgram.c_str(), + cmSystemTools::SplitProgramPath(makeProgram, dir, file); makeProgram = dir; makeProgram += "/"; @@ -607,7 +607,7 @@ cmGlobalGenerator::EnableLanguage(std::vector<std::string>const& languages, std::string env = envVar; env += "="; env += envVarValue; - cmSystemTools::PutEnv(env.c_str()); + cmSystemTools::PutEnv(env); } // if determineLanguage was called then load the file it @@ -2469,7 +2469,7 @@ void cmGlobalGenerator::EnableMinGWLanguage(cmMakefile *mf) this->FindMakeProgram(mf); std::string makeProgram = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM"); std::vector<std::string> locations; - locations.push_back(cmSystemTools::GetProgramPath(makeProgram.c_str())); + locations.push_back(cmSystemTools::GetProgramPath(makeProgram)); locations.push_back("/mingw/bin"); locations.push_back("c:/mingw/bin"); std::string tgcc = cmSystemTools::FindProgram("gcc", locations); diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx index 9a086ca..55e20ab 100644 --- a/Source/cmOSXBundleGenerator.cxx +++ b/Source/cmOSXBundleGenerator.cxx @@ -113,7 +113,7 @@ void cmOSXBundleGenerator::CreateFramework( newName = versions; newName += "/Current"; cmSystemTools::RemoveFile(newName); - cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); + cmSystemTools::CreateSymlink(oldName, newName); this->Makefile->AddCMakeOutputFile(newName); // foo -> Versions/Current/foo @@ -122,7 +122,7 @@ void cmOSXBundleGenerator::CreateFramework( newName = contentdir; newName += name; cmSystemTools::RemoveFile(newName); - cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); + cmSystemTools::CreateSymlink(oldName, newName); this->Makefile->AddCMakeOutputFile(newName); // Resources -> Versions/Current/Resources @@ -133,7 +133,7 @@ void cmOSXBundleGenerator::CreateFramework( newName = contentdir; newName += "Resources"; cmSystemTools::RemoveFile(newName); - cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); + cmSystemTools::CreateSymlink(oldName, newName); this->Makefile->AddCMakeOutputFile(newName); } @@ -145,7 +145,7 @@ void cmOSXBundleGenerator::CreateFramework( newName = contentdir; newName += "Headers"; cmSystemTools::RemoveFile(newName); - cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); + cmSystemTools::CreateSymlink(oldName, newName); this->Makefile->AddCMakeOutputFile(newName); } @@ -157,7 +157,7 @@ void cmOSXBundleGenerator::CreateFramework( newName = contentdir; newName += "PrivateHeaders"; cmSystemTools::RemoveFile(newName); - cmSystemTools::CreateSymlink(oldName.c_str(), newName.c_str()); + cmSystemTools::CreateSymlink(oldName, newName); this->Makefile->AddCMakeOutputFile(newName); } } diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 929cbc0..3e8aaef 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -178,7 +178,7 @@ std::string cmQtAutoGenerators::ListQt5RccInputs(cmSourceFile* sf, command.push_back("--list"); std::string absFile = cmsys::SystemTools::GetRealPath( - sf->GetFullPath().c_str()); + sf->GetFullPath()); command.push_back(absFile); @@ -394,7 +394,7 @@ bool cmQtAutoGenerators::InitializeAutogenTarget(cmTarget* target) { cmSourceFile* sf = *fileIt; std::string absFile = cmsys::SystemTools::GetRealPath( - sf->GetFullPath().c_str()); + sf->GetFullPath()); std::string ext = sf->GetExtension(); @@ -2319,8 +2319,8 @@ bool cmQtAutoGenerators::InputFilesNewerThanQrc(const std::string& qrcFile, it != files.end(); ++it) { int inputNewerThanQrc = 0; - bool success = cmsys::SystemTools::FileTimeCompare(it->c_str(), - rccOutput.c_str(), + bool success = cmsys::SystemTools::FileTimeCompare(*it, + rccOutput, &inputNewerThanQrc); if (!success || inputNewerThanQrc >= 0) { @@ -2353,7 +2353,7 @@ bool cmQtAutoGenerators::GenerateQrc() int sourceNewerThanQrc = 0; bool generateQrc = !cmsys::SystemTools::FileTimeCompare(*si, - rcc_output_file.c_str(), + rcc_output_file, &sourceNewerThanQrc); generateQrc = generateQrc || (sourceNewerThanQrc >= 0); generateQrc = generateQrc || this->InputFilesNewerThanQrc(*si, diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx index 0ca36eb..176a08d 100644 --- a/Source/cmSetCommand.cxx +++ b/Source/cmSetCommand.cxx @@ -43,7 +43,7 @@ bool cmSetCommand if (!currValue || strcmp(currValue,args[1].c_str())) { putEnvArg += args[1]; - cmSystemTools::PutEnv(putEnvArg.c_str()); + cmSystemTools::PutEnv(putEnvArg); } return true; } @@ -51,7 +51,7 @@ bool cmSetCommand // if it will be cleared, then clear it if it isn;t already clear if (currValue) { - cmSystemTools::PutEnv(putEnvArg.c_str()); + cmSystemTools::PutEnv(putEnvArg); } return true; } diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index ce7c854..8341027 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -780,7 +780,7 @@ bool cmStringCommand const std::string& variableName = args[2]; this->Makefile->AddDefinition(variableName, - cmSystemTools::MakeCidentifier(input.c_str()).c_str()); + cmSystemTools::MakeCidentifier(input).c_str()); return true; } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 3247f7f..7e93384 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1409,7 +1409,7 @@ void cmSystemTools::AppendEnv(std::vector<std::string> const& env) for(std::vector<std::string>::const_iterator eit = env.begin(); eit != env.end(); ++eit) { - cmSystemTools::PutEnv(eit->c_str()); + cmSystemTools::PutEnv(*eit); } } @@ -2333,7 +2333,7 @@ bool cmSystemTools::GuessLibrarySOName(std::string const& fullPath, { return false; } - if(!cmSystemTools::ReadSymlink(fullPath.c_str(), soname)) + if(!cmSystemTools::ReadSymlink(fullPath, soname)) { return false; } diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index ee62f06..fef71d9 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -4713,7 +4713,7 @@ const char* cmTarget::GetExportMacro() const { std::string in = this->GetName(); in += "_EXPORTS"; - this->ExportMacro = cmSystemTools::MakeCindentifier(in.c_str()); + this->ExportMacro = cmSystemTools::MakeCindentifier(in); } return this->ExportMacro.c_str(); } diff --git a/Source/cmake.cxx b/Source/cmake.cxx index fb04376..bbd3fe4 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1135,13 +1135,13 @@ void cmake::SetGlobalGenerator(cmGlobalGenerator *gg) { env += this->CCEnvironment; } - cmSystemTools::PutEnv(env.c_str()); + cmSystemTools::PutEnv(env); env = "CXX="; if(this->CXXEnvironment.size()) { env += this->CXXEnvironment; } - cmSystemTools::PutEnv(env.c_str()); + cmSystemTools::PutEnv(env); } // set the new diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index f5436ff..a97444d 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -215,7 +215,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) else if(a.find("=") != a.npos) { // Set environment variable. - cmSystemTools::PutEnv(a.c_str()); + cmSystemTools::PutEnv(a); } else { @@ -549,7 +549,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) "' because existing path cannot be removed: " << emsg << "\n"; return 1; } - if(!cmSystemTools::CreateSymlink(args[2].c_str(), args[3].c_str())) + if(!cmSystemTools::CreateSymlink(args[2], args[3])) { std::string emsg = cmSystemTools::GetLastSystemError(); std::cerr << @@ -893,7 +893,7 @@ bool cmcmd::SymlinkInternal(std::string const& file, std::string const& link) return cmSystemTools::CopyFileAlways(file.c_str(), link.c_str()); #else std::string linktext = cmSystemTools::GetFilenameName(file); - return cmSystemTools::CreateSymlink(linktext.c_str(), link.c_str()); + return cmSystemTools::CreateSymlink(linktext, link); #endif } |