diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx index 19204a207..a233e7669 100644 --- a/Source/CPack/OSXScriptLauncher.cxx +++ b/Source/CPack/OSXScriptLauncher.cxx @@ -72,7 +72,7 @@ int main(int argc, char* argv[]) std::string scriptDirectory = cmsys::SystemTools::GetFilenamePath(fullScriptPath); - ofs << fullScriptPath.c_str() << std::endl; + ofs << fullScriptPath << std::endl; std::vector args; args.push_back(fullScriptPath.c_str()); int cc; diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx index 1164021f0..9276e3a5a 100644 --- a/Source/CPack/cmCPackBundleGenerator.cxx +++ b/Source/CPack/cmCPackBundleGenerator.cxx @@ -232,12 +232,12 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir) temp_sign_file_cmd << this->GetOption("CPACK_APPLE_BUNDLE_ID"); temp_sign_file_cmd << " \""; temp_sign_file_cmd << bundle_path; - temp_sign_file_cmd << it->c_str() << "\""; + temp_sign_file_cmd << *it << "\""; if (!this->RunCommand(temp_sign_file_cmd, &output)) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Error signing file:" - << bundle_path << it->c_str() << std::endl - << output << std::endl); + cmCPackLogger(cmCPackLog::LOG_ERROR, + "Error signing file:" << bundle_path << *it << std::endl + << output << std::endl); return 0; } diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx index d5691bed5..c0d255338 100644 --- a/Source/CPack/cmCPackOSXX11Generator.cxx +++ b/Source/CPack/cmCPackOSXX11Generator.cxx @@ -158,11 +158,10 @@ int cmCPackOSXX11Generator::PackageFiles() tmpFile += "/hdiutilOutput.log"; std::ostringstream dmgCmd; dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") - << "\" create -ov -format UDZO -srcfolder \"" - << diskImageDirectory.c_str() << "\" \"" << packageFileNames[0] - << "\""; + << "\" create -ov -format UDZO -srcfolder \"" << diskImageDirectory + << "\" \"" << packageFileNames[0] << "\""; cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Compress disk image using command: " - << dmgCmd.str().c_str() << std::endl); + << dmgCmd.str() << std::endl); // since we get random dashboard failures with this one // try running it more than once int retVal = 1; @@ -181,12 +180,12 @@ int cmCPackOSXX11Generator::PackageFiles() } if (!res || retVal) { cmGeneratedFileStream ofs(tmpFile.c_str()); - ofs << "# Run command: " << dmgCmd.str().c_str() << std::endl + ofs << "# Run command: " << dmgCmd.str() << std::endl << "# Output:" << std::endl - << output.c_str() << std::endl; + << output << std::endl; cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running hdiutil command: " - << dmgCmd.str().c_str() << std::endl - << "Please check " << tmpFile.c_str() << " for errors" + << dmgCmd.str() << std::endl + << "Please check " << tmpFile << " for errors" << std::endl); return 0; } @@ -249,7 +248,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const std::string& name) cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " << (inFileName ? inFileName : "(NULL)") - << " to " << destFileName.c_str() << std::endl); + << " to " << destFileName << std::endl); this->ConfigureFile(inFileName, destFileName.c_str()); return true; } @@ -277,9 +276,8 @@ bool cmCPackOSXX11Generator::CopyResourcePlistFile( destFileName += "/"; destFileName += outputFileName; - cmCPackLogger(cmCPackLog::LOG_VERBOSE, - "Configure file: " << inFileName.c_str() << " to " - << destFileName.c_str() << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " + << inFileName << " to " << destFileName << std::endl); this->ConfigureFile(inFileName.c_str(), destFileName.c_str(), copyOnly); return true; } diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx index ff0fa8cc7..7bc05d0b1 100644 --- a/Source/CPack/cmCPackPKGGenerator.cxx +++ b/Source/CPack/cmCPackPKGGenerator.cxx @@ -316,9 +316,9 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile( this->SetOption(("CPACK_RESOURCE_FILE_" + uname + "_NOPATH").c_str(), (name + ext).c_str()); - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " - << (inFileName ? inFileName : "(NULL)") << " to " - << destFileName.c_str() << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Configure file: " << (inFileName ? inFileName : "(NULL)") + << " to " << destFileName << std::endl); this->ConfigureFile(inFileName, destFileName.c_str()); return true; } @@ -344,9 +344,8 @@ bool cmCPackPKGGenerator::CopyResourcePlistFile( destFileName += "/"; destFileName += outName; - cmCPackLogger(cmCPackLog::LOG_VERBOSE, - "Configure file: " << inFileName.c_str() << " to " - << destFileName.c_str() << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " + << inFileName << " to " << destFileName << std::endl); this->ConfigureFile(inFileName.c_str(), destFileName.c_str()); return true; } @@ -360,8 +359,8 @@ int cmCPackPKGGenerator::CopyInstallScript(const std::string& resdir, dst += name; cmSystemTools::CopyFileAlways(script.c_str(), dst.c_str()); cmSystemTools::SetPermissions(dst.c_str(), 0777); - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "copy script : " - << script << "\ninto " << dst.c_str() << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "copy script : " << script << "\ninto " << dst << std::endl); return 1; } diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx index 5bb24c0ba..891d0f471 100644 --- a/Source/CPack/cmCPackPackageMakerGenerator.cxx +++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx @@ -101,7 +101,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() if (!cmsys::SystemTools::MakeDirectory(preflightDirName.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem creating installer directory: " - << preflightDirName.c_str() << std::endl); + << preflightDirName << std::endl); return 0; } } @@ -109,7 +109,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() if (!cmsys::SystemTools::MakeDirectory(postflightDirName.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem creating installer directory: " - << postflightDirName.c_str() << std::endl); + << postflightDirName << std::endl); return 0; } } @@ -137,7 +137,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() if (!cmsys::SystemTools::MakeDirectory(packageDir.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem creating component packages directory: " - << packageDir.c_str() << std::endl); + << packageDir << std::endl); return 0; } @@ -147,7 +147,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() cmCPackLogger( cmCPackLog::LOG_ERROR, "Problem creating component PostFlight Packages directory: " - << packageFileDir.c_str() << std::endl); + << packageFileDir << std::endl); return 0; } std::string packageFile = @@ -169,7 +169,7 @@ int cmCPackPackageMakerGenerator::PackageFiles() if (!cmsys::SystemTools::MakeDirectory(basePackageDir.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem creating component packages directory: " - << basePackageDir.c_str() << std::endl); + << basePackageDir << std::endl); return 0; } @@ -314,12 +314,12 @@ int cmCPackPackageMakerGenerator::PackageFiles() } if (!res || retVal) { cmGeneratedFileStream ofs(tmpFile.c_str()); - ofs << "# Run command: " << dmgCmd.str().c_str() << std::endl + ofs << "# Run command: " << dmgCmd.str() << std::endl << "# Output:" << std::endl - << output.c_str() << std::endl; + << output << std::endl; cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running hdiutil command: " - << dmgCmd.str().c_str() << std::endl - << "Please check " << tmpFile.c_str() << " for errors" + << dmgCmd.str() << std::endl + << "Please check " << tmpFile << " for errors" << std::endl); return 0; } @@ -382,7 +382,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal() if (!cmSystemTools::FileExists(versionFile.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot find PackageMaker compiler version file: " - << versionFile.c_str() << std::endl); + << versionFile << std::endl); return 0; } @@ -416,7 +416,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal() if (!cmSystemTools::GetLineFromStream(ifs, line) || !rexVersion.find(line)) { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem reading the PackageMaker compiler version file: " - << versionFile.c_str() << std::endl); + << versionFile << std::endl); return 0; } this->PackageMakerVersion = atof(rexVersion.match(1).c_str()); @@ -481,11 +481,11 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char* command, cmGeneratedFileStream ofs(tmpFile.c_str()); ofs << "# Run command: " << command << std::endl << "# Output:" << std::endl - << output.c_str() << std::endl; + << output << std::endl; cmCPackLogger( cmCPackLog::LOG_ERROR, "Problem running PackageMaker command: " << command << std::endl - << "Please check " << tmpFile.c_str() << " for errors" << std::endl); + << "Please check " << tmpFile << " for errors" << std::endl); return false; } // sometimes the command finishes but the directory is not yet diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx index c1f63cc23..aa9a27d6a 100644 --- a/Source/CPack/cmCPackProductBuildGenerator.cxx +++ b/Source/CPack/cmCPackProductBuildGenerator.cxx @@ -47,7 +47,7 @@ int cmCPackProductBuildGenerator::PackageFiles() { cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem creating component packages directory: " - << basePackageDir.c_str() << std::endl); + << basePackageDir << std::endl); return 0; } @@ -153,12 +153,12 @@ bool cmCPackProductBuildGenerator::RunProductBuild( { cmGeneratedFileStream ofs(tmpFile.c_str()); ofs << "# Run command: " << command << std::endl - << "# Output:" << std::endl - << output.c_str() << std::endl; + << "# Output:" << std::endl + << output << std::endl; cmCPackLogger(cmCPackLog::LOG_ERROR, - "Problem running command: " << command - << std::endl << "Please check " << tmpFile.c_str() << " for errors" - << std::endl); + "Problem running command: " << command << std::endl + << "Please check " << tmpFile + << " for errors" << std::endl); return false; } return true; @@ -194,8 +194,8 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage( if ( !cmsys::SystemTools::MakeDirectory(scriptDir.c_str())) { cmCPackLogger(cmCPackLog::LOG_ERROR, - "Problem creating installer directory: " - << scriptDir.c_str() << std::endl); + "Problem creating installer directory: " << scriptDir + << std::endl); return 0; } diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 0cba8b2a4..632f45211 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -302,7 +302,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) out << "Could not find path to executable, perhaps it was not built: " << this->TestCommand << "\n"; out << "tried to find it in these places:\n"; - out << fullPath.c_str() << "\n"; + out << fullPath << "\n"; for (unsigned int i = 0; i < failed.size(); ++i) { out << failed[i] << "\n"; } diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index ba9e5469e..a631db958 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -1012,7 +1012,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage( "-o \"" + fileDir + "\" " + "\"" + *it + "\""; cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - command.c_str() << std::endl, this->Quiet); + command << std::endl, this->Quiet); std::string output = ""; std::string errors = ""; @@ -1377,7 +1377,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage( "Current coverage dir: " << fileDir << std::endl, this->Quiet); cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, - command.c_str() << std::endl, this->Quiet); + command << std::endl, this->Quiet); std::string output = ""; std::string errors = ""; diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 5b5caeab8..5f70f66df 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -991,7 +991,7 @@ void cmCTestMemCheckHandler::PostProcessBoundsCheckerTest( cmsys::ifstream ifs(ofile.c_str()); if (!ifs) { std::string log = "Cannot read memory tester output file: " + ofile; - cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl); return; } res.Output += BOUNDS_CHECKER_MARKER; @@ -1024,7 +1024,7 @@ void cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res, cmsys::ifstream ifs(ofile.c_str()); if (!ifs) { std::string log = "Cannot read memory tester output file: " + ofile; - cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl); return; } std::string line; @@ -1056,7 +1056,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames( g.FindFiles(ofile); if (g.GetFiles().empty()) { std::string log = "Cannot find memory tester output file: " + ofile; - cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl); ofile = ""; } else { files = g.GetFiles(); @@ -1064,7 +1064,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames( } } else if (!cmSystemTools::FileExists(ofile.c_str())) { std::string log = "Cannot find memory tester output file: " + ofile; - cmCTestLog(this->CTest, ERROR_MESSAGE, log.c_str() << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, log << std::endl); ofile = ""; } files.push_back(ofile); diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 6f19b325a..7b384addb 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -449,7 +449,7 @@ void cmCTestMultiProcessHandler::UpdateCostData() fout << "---\n"; for (std::vector::iterator i = this->Failed->begin(); i != this->Failed->end(); ++i) { - fout << i->c_str() << "\n"; + fout << *i << "\n"; } fout.close(); cmSystemTools::RenameFile(tmpout.c_str(), fname.c_str()); @@ -710,8 +710,8 @@ void cmCTestMultiProcessHandler::PrintTestList() << indexStr.str(), this->Quiet); cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " ", this->Quiet); - cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - p.Name.c_str() << std::endl, this->Quiet); + cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, p.Name << std::endl, + this->Quiet); // pop working dir cmSystemTools::ChangeDirectory(current_dir); } diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 015b9087a..69f2ac5b0 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -902,8 +902,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( /* Call the famous server at UserLand. */ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Submitting to: " - << realURL.c_str() << " (" << remoteprefix.c_str() - << ")" << std::endl, + << realURL << " (" << remoteprefix << ")" << std::endl, this->Quiet); cmCTest::SetOfStrings::const_iterator file; for (file = files.begin(); file != files.end(); ++file) { @@ -914,12 +913,12 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( local_file = localprefix + "/" + *file; } cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Submit file: " << local_file.c_str() << std::endl, + " Submit file: " << local_file << std::endl, this->Quiet); struct stat st; if (::stat(local_file.c_str(), &st)) { cmCTestLog(this->CTest, ERROR_MESSAGE, - " Cannot find file: " << local_file.c_str() << std::endl); + " Cannot find file: " << local_file << std::endl); return false; } @@ -927,15 +926,15 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( // make sure the file is not too big. if (static_cast(static_cast(st.st_size)) != static_cast(st.st_size)) { - cmCTestLog(this->CTest, ERROR_MESSAGE, - " File too big: " << local_file.c_str() << std::endl); + cmCTestLog(this->CTest, ERROR_MESSAGE, " File too big: " << local_file + << std::endl); return false; } size_t fileSize = static_cast(st.st_size); FILE* fp = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); if (!fp) { cmCTestLog(this->CTest, ERROR_MESSAGE, - " Cannot open file: " << local_file.c_str() << std::endl); + " Cannot open file: " << local_file << std::endl); return false; } @@ -944,7 +943,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC( delete[] fileBuffer; fclose(fp); cmCTestLog(this->CTest, ERROR_MESSAGE, - " Cannot read file: " << local_file.c_str() << std::endl); + " Cannot read file: " << local_file << std::endl); return false; } fclose(fp); diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index f461ca8f3..96a22d9c6 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -1321,7 +1321,7 @@ std::string cmCTestTestHandler::FindExecutable( << "Looked in the following places:\n"); for (std::vector::iterator i = failed.begin(); i != failed.end(); ++i) { - cmCTestLog(ctest, HANDLER_OUTPUT, i->c_str() << "\n"); + cmCTestLog(ctest, HANDLER_OUTPUT, *i << "\n"); } } diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 6e0893296..2e47298a2 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1245,16 +1245,16 @@ int cmCTest::RunTest(std::vector argv, std::string* output, if (output) { *output += outerr; } - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr.c_str() << std::endl - << std::flush); + cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl + << std::flush); } else if (result == cmsysProcess_State_Error) { std::string outerr = "\n*** ERROR executing: "; outerr += cmsysProcess_GetErrorString(cp); if (output) { *output += outerr; } - cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr.c_str() << std::endl - << std::flush); + cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl + << std::flush); } cmsysProcess_Delete(cp); diff --git a/Source/cmCallVisualStudioMacro.cxx b/Source/cmCallVisualStudioMacro.cxx index e608d6b58..515699db4 100644 --- a/Source/cmCallVisualStudioMacro.cxx +++ b/Source/cmCallVisualStudioMacro.cxx @@ -105,8 +105,8 @@ HRESULT InstanceCallMacro(IDispatch* vsIDE, const std::string& macro, std::ostringstream oss; oss << std::endl; oss << "Invoke(ExecuteCommand)" << std::endl; - oss << " Macro: " << macro.c_str() << std::endl; - oss << " Args: " << args.c_str() << std::endl; + oss << " Macro: " << macro << std::endl; + oss << " Args: " << args << std::endl; if (DISP_E_EXCEPTION == hr) { oss << "DISP_E_EXCEPTION EXCEPINFO:" << excep.wCode << std::endl; diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx index 5be527ccd..f81bf068d 100644 --- a/Source/cmDependsC.cxx +++ b/Source/cmDependsC.cxx @@ -343,16 +343,16 @@ void cmDependsC::WriteCacheFile() const this->FileCache.begin(); fileIt != this->FileCache.end(); ++fileIt) { if (fileIt->second->Used) { - cacheOut << fileIt->first.c_str() << std::endl; + cacheOut << fileIt->first << std::endl; for (std::vector::const_iterator incIt = fileIt->second->UnscannedEntries.begin(); incIt != fileIt->second->UnscannedEntries.end(); ++incIt) { - cacheOut << incIt->FileName.c_str() << std::endl; + cacheOut << incIt->FileName << std::endl; if (incIt->QuotedLocation.empty()) { cacheOut << "-" << std::endl; } else { - cacheOut << incIt->QuotedLocation.c_str() << std::endl; + cacheOut << incIt->QuotedLocation << std::endl; } } cacheOut << std::endl; diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index 5c1e7330d..68a25389e 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -213,7 +213,7 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile( cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); // only put relative paths if (!tmp.empty() && tmp[0] != '/') { - fout << tmp.c_str() << "\n"; + fout << tmp << "\n"; } } return true; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 93ce88b5c..4d778ee17 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1544,7 +1544,7 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile( std::string echo_cmd = "echo "; echo_cmd += (this->CurrentLocalGenerator->EscapeForShell( comment, ccg.GetCC().GetEscapeAllowMakeVars())); - makefileStream << "\t" << echo_cmd.c_str() << "\n"; + makefileStream << "\t" << echo_cmd << "\n"; } // Add each command line to the set of commands. @@ -1562,7 +1562,7 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile( } cmd += cmd2; ccg.AppendArguments(c, cmd); - makefileStream << "\t" << cmd.c_str() << "\n"; + makefileStream << "\t" << cmd << "\n"; } } } diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index 6b3a87073..3963cf891 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -427,7 +427,7 @@ int cmGraphVizWriter::CollectAllTargets() // Skip ignored targets continue; } - // std::cout << "Found target: " << tit->first.c_str() << std::endl; + // std::cout << "Found target: " << tit->first << std::endl; std::ostringstream ostr; ostr << this->GraphNodePrefix << cnt++; this->TargetNamesNodes[realTargetName] = ostr.str(); @@ -469,7 +469,7 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt) ostr << this->GraphNodePrefix << cnt++; this->TargetNamesNodes[libName] = ostr.str(); this->TargetPtrs[libName] = NULL; - // str << " \"" << ostr.c_str() << "\" [ label=\"" << libName + // str << " \"" << ostr << "\" [ label=\"" << libName // << "\" shape=\"ellipse\"];" << std::endl; } } diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 36a1f2972..2f6bf0725 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1688,12 +1688,12 @@ bool cmLocalVisualStudio7Generator::WriteGroup( ppLang); } if (!fc.AdditionalDeps.empty()) { - fout << "\t\t\t\t\tAdditionalDependencies=\"" - << fc.AdditionalDeps.c_str() << "\"\n"; + fout << "\t\t\t\t\tAdditionalDependencies=\"" << fc.AdditionalDeps + << "\"\n"; } if (!fc.ObjectName.empty()) { - fout << "\t\t\t\t\tObjectFile=\"$(IntDir)/" - << fc.ObjectName.c_str() << "\"\n"; + fout << "\t\t\t\t\tObjectFile=\"$(IntDir)/" << fc.ObjectName + << "\"\n"; } fout << "\t\t\t\t\t/>\n" << "\t\t\t\t\n"; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 45fb7cf34..ca30b3d66 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -3416,7 +3416,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile, while (cmSystemTools::GetLineFromStream(fin, inLine)) { outLine = ""; this->ConfigureString(inLine, outLine, atOnly, escapeQuotes); - fout << outLine.c_str() << newLineCharacters; + fout << outLine << newLineCharacters; } // close the files before attempting to copy fin.close(); diff --git a/Tests/Plugin/src/example_exe.cxx b/Tests/Plugin/src/example_exe.cxx index 857ad5469..86b54f709 100644 --- a/Tests/Plugin/src/example_exe.cxx +++ b/Tests/Plugin/src/example_exe.cxx @@ -31,8 +31,7 @@ int main() kwsys::DynamicLoader::LibraryHandle handle = kwsys::DynamicLoader::OpenLibrary(libName.c_str()); if (!handle) { - std::cerr << "Could not open plugin \"" << libName.c_str() << "\"!" - << std::endl; + std::cerr << "Could not open plugin \"" << libName << "\"!" << std::endl; return 1; } kwsys::DynamicLoader::SymbolPointer sym =