Remove c_str() calls from stream arguments.

Mostly automated:

git grep -l '.c_str() <<' | xargs sed -i 's|\.c_str() <<| <<|g'
This commit is contained in:
Daniel Pfeifer 2016-06-06 23:53:32 +02:00
parent ba5fb16519
commit fa277b29e4
21 changed files with 81 additions and 86 deletions

View File

@ -72,7 +72,7 @@ int main(int argc, char* argv[])
std::string scriptDirectory = std::string scriptDirectory =
cmsys::SystemTools::GetFilenamePath(fullScriptPath); cmsys::SystemTools::GetFilenamePath(fullScriptPath);
ofs << fullScriptPath.c_str() << std::endl; ofs << fullScriptPath << std::endl;
std::vector<const char*> args; std::vector<const char*> args;
args.push_back(fullScriptPath.c_str()); args.push_back(fullScriptPath.c_str());
int cc; int cc;

View File

@ -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 << this->GetOption("CPACK_APPLE_BUNDLE_ID");
temp_sign_file_cmd << " \""; temp_sign_file_cmd << " \"";
temp_sign_file_cmd << bundle_path; 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)) { if (!this->RunCommand(temp_sign_file_cmd, &output)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, "Error signing file:" cmCPackLogger(cmCPackLog::LOG_ERROR,
<< bundle_path << it->c_str() << std::endl "Error signing file:" << bundle_path << *it << std::endl
<< output << std::endl); << output << std::endl);
return 0; return 0;
} }

View File

@ -158,11 +158,10 @@ int cmCPackOSXX11Generator::PackageFiles()
tmpFile += "/hdiutilOutput.log"; tmpFile += "/hdiutilOutput.log";
std::ostringstream dmgCmd; std::ostringstream dmgCmd;
dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE") dmgCmd << "\"" << this->GetOption("CPACK_INSTALLER_PROGRAM_DISK_IMAGE")
<< "\" create -ov -format UDZO -srcfolder \"" << "\" create -ov -format UDZO -srcfolder \"" << diskImageDirectory
<< diskImageDirectory.c_str() << "\" \"" << packageFileNames[0] << "\" \"" << packageFileNames[0] << "\"";
<< "\"";
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Compress disk image using command: " 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 // since we get random dashboard failures with this one
// try running it more than once // try running it more than once
int retVal = 1; int retVal = 1;
@ -181,12 +180,12 @@ int cmCPackOSXX11Generator::PackageFiles()
} }
if (!res || retVal) { if (!res || retVal) {
cmGeneratedFileStream ofs(tmpFile.c_str()); 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:" << std::endl
<< output.c_str() << std::endl; << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running hdiutil command: " cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running hdiutil command: "
<< dmgCmd.str().c_str() << std::endl << dmgCmd.str() << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << "Please check " << tmpFile << " for errors"
<< std::endl); << std::endl);
return 0; return 0;
} }
@ -249,7 +248,7 @@ bool cmCPackOSXX11Generator::CopyCreateResourceFile(const std::string& name)
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
<< (inFileName ? inFileName : "(NULL)") << (inFileName ? inFileName : "(NULL)")
<< " to " << destFileName.c_str() << std::endl); << " to " << destFileName << std::endl);
this->ConfigureFile(inFileName, destFileName.c_str()); this->ConfigureFile(inFileName, destFileName.c_str());
return true; return true;
} }
@ -277,9 +276,8 @@ bool cmCPackOSXX11Generator::CopyResourcePlistFile(
destFileName += "/"; destFileName += "/";
destFileName += outputFileName; destFileName += outputFileName;
cmCPackLogger(cmCPackLog::LOG_VERBOSE, cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
"Configure file: " << inFileName.c_str() << " to " << inFileName << " to " << destFileName << std::endl);
<< destFileName.c_str() << std::endl);
this->ConfigureFile(inFileName.c_str(), destFileName.c_str(), copyOnly); this->ConfigureFile(inFileName.c_str(), destFileName.c_str(), copyOnly);
return true; return true;
} }

View File

@ -316,9 +316,9 @@ bool cmCPackPKGGenerator::CopyCreateResourceFile(
this->SetOption(("CPACK_RESOURCE_FILE_" + uname + "_NOPATH").c_str(), this->SetOption(("CPACK_RESOURCE_FILE_" + uname + "_NOPATH").c_str(),
(name + ext).c_str()); (name + ext).c_str());
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: " cmCPackLogger(cmCPackLog::LOG_VERBOSE,
<< (inFileName ? inFileName : "(NULL)") << " to " "Configure file: " << (inFileName ? inFileName : "(NULL)")
<< destFileName.c_str() << std::endl); << " to " << destFileName << std::endl);
this->ConfigureFile(inFileName, destFileName.c_str()); this->ConfigureFile(inFileName, destFileName.c_str());
return true; return true;
} }
@ -344,9 +344,8 @@ bool cmCPackPKGGenerator::CopyResourcePlistFile(
destFileName += "/"; destFileName += "/";
destFileName += outName; destFileName += outName;
cmCPackLogger(cmCPackLog::LOG_VERBOSE, cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Configure file: "
"Configure file: " << inFileName.c_str() << " to " << inFileName << " to " << destFileName << std::endl);
<< destFileName.c_str() << std::endl);
this->ConfigureFile(inFileName.c_str(), destFileName.c_str()); this->ConfigureFile(inFileName.c_str(), destFileName.c_str());
return true; return true;
} }
@ -360,8 +359,8 @@ int cmCPackPKGGenerator::CopyInstallScript(const std::string& resdir,
dst += name; dst += name;
cmSystemTools::CopyFileAlways(script.c_str(), dst.c_str()); cmSystemTools::CopyFileAlways(script.c_str(), dst.c_str());
cmSystemTools::SetPermissions(dst.c_str(), 0777); cmSystemTools::SetPermissions(dst.c_str(), 0777);
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "copy script : " cmCPackLogger(cmCPackLog::LOG_VERBOSE,
<< script << "\ninto " << dst.c_str() << std::endl); "copy script : " << script << "\ninto " << dst << std::endl);
return 1; return 1;
} }

View File

@ -101,7 +101,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if (!cmsys::SystemTools::MakeDirectory(preflightDirName.c_str())) { if (!cmsys::SystemTools::MakeDirectory(preflightDirName.c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating installer directory: " "Problem creating installer directory: "
<< preflightDirName.c_str() << std::endl); << preflightDirName << std::endl);
return 0; return 0;
} }
} }
@ -109,7 +109,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if (!cmsys::SystemTools::MakeDirectory(postflightDirName.c_str())) { if (!cmsys::SystemTools::MakeDirectory(postflightDirName.c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating installer directory: " "Problem creating installer directory: "
<< postflightDirName.c_str() << std::endl); << postflightDirName << std::endl);
return 0; return 0;
} }
} }
@ -137,7 +137,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if (!cmsys::SystemTools::MakeDirectory(packageDir.c_str())) { if (!cmsys::SystemTools::MakeDirectory(packageDir.c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating component packages directory: " "Problem creating component packages directory: "
<< packageDir.c_str() << std::endl); << packageDir << std::endl);
return 0; return 0;
} }
@ -147,7 +147,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
cmCPackLogger( cmCPackLogger(
cmCPackLog::LOG_ERROR, cmCPackLog::LOG_ERROR,
"Problem creating component PostFlight Packages directory: " "Problem creating component PostFlight Packages directory: "
<< packageFileDir.c_str() << std::endl); << packageFileDir << std::endl);
return 0; return 0;
} }
std::string packageFile = std::string packageFile =
@ -169,7 +169,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
if (!cmsys::SystemTools::MakeDirectory(basePackageDir.c_str())) { if (!cmsys::SystemTools::MakeDirectory(basePackageDir.c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating component packages directory: " "Problem creating component packages directory: "
<< basePackageDir.c_str() << std::endl); << basePackageDir << std::endl);
return 0; return 0;
} }
@ -314,12 +314,12 @@ int cmCPackPackageMakerGenerator::PackageFiles()
} }
if (!res || retVal) { if (!res || retVal) {
cmGeneratedFileStream ofs(tmpFile.c_str()); 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:" << std::endl
<< output.c_str() << std::endl; << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running hdiutil command: " cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem running hdiutil command: "
<< dmgCmd.str().c_str() << std::endl << dmgCmd.str() << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << "Please check " << tmpFile << " for errors"
<< std::endl); << std::endl);
return 0; return 0;
} }
@ -382,7 +382,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
if (!cmSystemTools::FileExists(versionFile.c_str())) { if (!cmSystemTools::FileExists(versionFile.c_str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Cannot find PackageMaker compiler version file: " "Cannot find PackageMaker compiler version file: "
<< versionFile.c_str() << std::endl); << versionFile << std::endl);
return 0; return 0;
} }
@ -416,7 +416,7 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
if (!cmSystemTools::GetLineFromStream(ifs, line) || !rexVersion.find(line)) { if (!cmSystemTools::GetLineFromStream(ifs, line) || !rexVersion.find(line)) {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem reading the PackageMaker compiler version file: " "Problem reading the PackageMaker compiler version file: "
<< versionFile.c_str() << std::endl); << versionFile << std::endl);
return 0; return 0;
} }
this->PackageMakerVersion = atof(rexVersion.match(1).c_str()); this->PackageMakerVersion = atof(rexVersion.match(1).c_str());
@ -481,11 +481,11 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char* command,
cmGeneratedFileStream ofs(tmpFile.c_str()); cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << command << std::endl ofs << "# Run command: " << command << std::endl
<< "# Output:" << std::endl << "# Output:" << std::endl
<< output.c_str() << std::endl; << output << std::endl;
cmCPackLogger( cmCPackLogger(
cmCPackLog::LOG_ERROR, "Problem running PackageMaker command: " cmCPackLog::LOG_ERROR, "Problem running PackageMaker command: "
<< command << std::endl << command << std::endl
<< "Please check " << tmpFile.c_str() << " for errors" << std::endl); << "Please check " << tmpFile << " for errors" << std::endl);
return false; return false;
} }
// sometimes the command finishes but the directory is not yet // sometimes the command finishes but the directory is not yet

View File

@ -47,7 +47,7 @@ int cmCPackProductBuildGenerator::PackageFiles()
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating component packages directory: " "Problem creating component packages directory: "
<< basePackageDir.c_str() << std::endl); << basePackageDir << std::endl);
return 0; return 0;
} }
@ -153,12 +153,12 @@ bool cmCPackProductBuildGenerator::RunProductBuild(
{ {
cmGeneratedFileStream ofs(tmpFile.c_str()); cmGeneratedFileStream ofs(tmpFile.c_str());
ofs << "# Run command: " << command << std::endl ofs << "# Run command: " << command << std::endl
<< "# Output:" << std::endl << "# Output:" << std::endl
<< output.c_str() << std::endl; << output << std::endl;
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem running command: " << command "Problem running command: " << command << std::endl
<< std::endl << "Please check " << tmpFile.c_str() << " for errors" << "Please check " << tmpFile
<< std::endl); << " for errors" << std::endl);
return false; return false;
} }
return true; return true;
@ -194,8 +194,8 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
if ( !cmsys::SystemTools::MakeDirectory(scriptDir.c_str())) if ( !cmsys::SystemTools::MakeDirectory(scriptDir.c_str()))
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_ERROR,
"Problem creating installer directory: " "Problem creating installer directory: " << scriptDir
<< scriptDir.c_str() << std::endl); << std::endl);
return 0; return 0;
} }

View File

@ -302,7 +302,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
out << "Could not find path to executable, perhaps it was not built: " out << "Could not find path to executable, perhaps it was not built: "
<< this->TestCommand << "\n"; << this->TestCommand << "\n";
out << "tried to find it in these places:\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) { for (unsigned int i = 0; i < failed.size(); ++i) {
out << failed[i] << "\n"; out << failed[i] << "\n";
} }

View File

@ -1012,7 +1012,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
"-o \"" + fileDir + "\" " + "\"" + *it + "\""; "-o \"" + fileDir + "\" " + "\"" + *it + "\"";
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
command.c_str() << std::endl, this->Quiet); command << std::endl, this->Quiet);
std::string output = ""; std::string output = "";
std::string errors = ""; std::string errors = "";
@ -1377,7 +1377,7 @@ int cmCTestCoverageHandler::HandleLCovCoverage(
"Current coverage dir: " << fileDir << std::endl, "Current coverage dir: " << fileDir << std::endl,
this->Quiet); this->Quiet);
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
command.c_str() << std::endl, this->Quiet); command << std::endl, this->Quiet);
std::string output = ""; std::string output = "";
std::string errors = ""; std::string errors = "";

View File

@ -991,7 +991,7 @@ void cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(
cmsys::ifstream ifs(ofile.c_str()); cmsys::ifstream ifs(ofile.c_str());
if (!ifs) { if (!ifs) {
std::string log = "Cannot read memory tester output file: " + ofile; 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; return;
} }
res.Output += BOUNDS_CHECKER_MARKER; res.Output += BOUNDS_CHECKER_MARKER;
@ -1024,7 +1024,7 @@ void cmCTestMemCheckHandler::AppendMemTesterOutput(cmCTestTestResult& res,
cmsys::ifstream ifs(ofile.c_str()); cmsys::ifstream ifs(ofile.c_str());
if (!ifs) { if (!ifs) {
std::string log = "Cannot read memory tester output file: " + ofile; 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; return;
} }
std::string line; std::string line;
@ -1056,7 +1056,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(
g.FindFiles(ofile); g.FindFiles(ofile);
if (g.GetFiles().empty()) { if (g.GetFiles().empty()) {
std::string log = "Cannot find memory tester output file: " + ofile; 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 = ""; ofile = "";
} else { } else {
files = g.GetFiles(); files = g.GetFiles();
@ -1064,7 +1064,7 @@ void cmCTestMemCheckHandler::TestOutputFileNames(
} }
} else if (!cmSystemTools::FileExists(ofile.c_str())) { } else if (!cmSystemTools::FileExists(ofile.c_str())) {
std::string log = "Cannot find memory tester output file: " + ofile; 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 = ""; ofile = "";
} }
files.push_back(ofile); files.push_back(ofile);

View File

@ -449,7 +449,7 @@ void cmCTestMultiProcessHandler::UpdateCostData()
fout << "---\n"; fout << "---\n";
for (std::vector<std::string>::iterator i = this->Failed->begin(); for (std::vector<std::string>::iterator i = this->Failed->begin();
i != this->Failed->end(); ++i) { i != this->Failed->end(); ++i) {
fout << i->c_str() << "\n"; fout << *i << "\n";
} }
fout.close(); fout.close();
cmSystemTools::RenameFile(tmpout.c_str(), fname.c_str()); cmSystemTools::RenameFile(tmpout.c_str(), fname.c_str());
@ -710,8 +710,8 @@ void cmCTestMultiProcessHandler::PrintTestList()
<< indexStr.str(), << indexStr.str(),
this->Quiet); this->Quiet);
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " ", this->Quiet); cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " ", this->Quiet);
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, p.Name << std::endl,
p.Name.c_str() << std::endl, this->Quiet); this->Quiet);
// pop working dir // pop working dir
cmSystemTools::ChangeDirectory(current_dir); cmSystemTools::ChangeDirectory(current_dir);
} }

View File

@ -902,8 +902,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
/* Call the famous server at UserLand. */ /* Call the famous server at UserLand. */
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Submitting to: " cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, " Submitting to: "
<< realURL.c_str() << " (" << remoteprefix.c_str() << realURL << " (" << remoteprefix << ")" << std::endl,
<< ")" << std::endl,
this->Quiet); this->Quiet);
cmCTest::SetOfStrings::const_iterator file; cmCTest::SetOfStrings::const_iterator file;
for (file = files.begin(); file != files.end(); ++file) { for (file = files.begin(); file != files.end(); ++file) {
@ -914,12 +913,12 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
local_file = localprefix + "/" + *file; local_file = localprefix + "/" + *file;
} }
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
" Submit file: " << local_file.c_str() << std::endl, " Submit file: " << local_file << std::endl,
this->Quiet); this->Quiet);
struct stat st; struct stat st;
if (::stat(local_file.c_str(), &st)) { if (::stat(local_file.c_str(), &st)) {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
" Cannot find file: " << local_file.c_str() << std::endl); " Cannot find file: " << local_file << std::endl);
return false; return false;
} }
@ -927,15 +926,15 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
// make sure the file is not too big. // make sure the file is not too big.
if (static_cast<off_t>(static_cast<size_t>(st.st_size)) != if (static_cast<off_t>(static_cast<size_t>(st.st_size)) !=
static_cast<off_t>(st.st_size)) { static_cast<off_t>(st.st_size)) {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE, " File too big: " << local_file
" File too big: " << local_file.c_str() << std::endl); << std::endl);
return false; return false;
} }
size_t fileSize = static_cast<size_t>(st.st_size); size_t fileSize = static_cast<size_t>(st.st_size);
FILE* fp = cmsys::SystemTools::Fopen(local_file.c_str(), "rb"); FILE* fp = cmsys::SystemTools::Fopen(local_file.c_str(), "rb");
if (!fp) { if (!fp) {
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
" Cannot open file: " << local_file.c_str() << std::endl); " Cannot open file: " << local_file << std::endl);
return false; return false;
} }
@ -944,7 +943,7 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
delete[] fileBuffer; delete[] fileBuffer;
fclose(fp); fclose(fp);
cmCTestLog(this->CTest, ERROR_MESSAGE, cmCTestLog(this->CTest, ERROR_MESSAGE,
" Cannot read file: " << local_file.c_str() << std::endl); " Cannot read file: " << local_file << std::endl);
return false; return false;
} }
fclose(fp); fclose(fp);

View File

@ -1321,7 +1321,7 @@ std::string cmCTestTestHandler::FindExecutable(
<< "Looked in the following places:\n"); << "Looked in the following places:\n");
for (std::vector<std::string>::iterator i = failed.begin(); for (std::vector<std::string>::iterator i = failed.begin();
i != failed.end(); ++i) { i != failed.end(); ++i) {
cmCTestLog(ctest, HANDLER_OUTPUT, i->c_str() << "\n"); cmCTestLog(ctest, HANDLER_OUTPUT, *i << "\n");
} }
} }

View File

@ -1245,16 +1245,16 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
if (output) { if (output) {
*output += outerr; *output += outerr;
} }
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr.c_str() << std::endl cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl
<< std::flush); << std::flush);
} else if (result == cmsysProcess_State_Error) { } else if (result == cmsysProcess_State_Error) {
std::string outerr = "\n*** ERROR executing: "; std::string outerr = "\n*** ERROR executing: ";
outerr += cmsysProcess_GetErrorString(cp); outerr += cmsysProcess_GetErrorString(cp);
if (output) { if (output) {
*output += outerr; *output += outerr;
} }
cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr.c_str() << std::endl cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, outerr << std::endl
<< std::flush); << std::flush);
} }
cmsysProcess_Delete(cp); cmsysProcess_Delete(cp);

View File

@ -105,8 +105,8 @@ HRESULT InstanceCallMacro(IDispatch* vsIDE, const std::string& macro,
std::ostringstream oss; std::ostringstream oss;
oss << std::endl; oss << std::endl;
oss << "Invoke(ExecuteCommand)" << std::endl; oss << "Invoke(ExecuteCommand)" << std::endl;
oss << " Macro: " << macro.c_str() << std::endl; oss << " Macro: " << macro << std::endl;
oss << " Args: " << args.c_str() << std::endl; oss << " Args: " << args << std::endl;
if (DISP_E_EXCEPTION == hr) { if (DISP_E_EXCEPTION == hr) {
oss << "DISP_E_EXCEPTION EXCEPINFO:" << excep.wCode << std::endl; oss << "DISP_E_EXCEPTION EXCEPINFO:" << excep.wCode << std::endl;

View File

@ -343,16 +343,16 @@ void cmDependsC::WriteCacheFile() const
this->FileCache.begin(); this->FileCache.begin();
fileIt != this->FileCache.end(); ++fileIt) { fileIt != this->FileCache.end(); ++fileIt) {
if (fileIt->second->Used) { if (fileIt->second->Used) {
cacheOut << fileIt->first.c_str() << std::endl; cacheOut << fileIt->first << std::endl;
for (std::vector<UnscannedEntry>::const_iterator incIt = for (std::vector<UnscannedEntry>::const_iterator incIt =
fileIt->second->UnscannedEntries.begin(); fileIt->second->UnscannedEntries.begin();
incIt != fileIt->second->UnscannedEntries.end(); ++incIt) { incIt != fileIt->second->UnscannedEntries.end(); ++incIt) {
cacheOut << incIt->FileName.c_str() << std::endl; cacheOut << incIt->FileName << std::endl;
if (incIt->QuotedLocation.empty()) { if (incIt->QuotedLocation.empty()) {
cacheOut << "-" << std::endl; cacheOut << "-" << std::endl;
} else { } else {
cacheOut << incIt->QuotedLocation.c_str() << std::endl; cacheOut << incIt->QuotedLocation << std::endl;
} }
} }
cacheOut << std::endl; cacheOut << std::endl;

View File

@ -213,7 +213,7 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile(
cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); cmSystemTools::ReplaceString(tmp, projectDir.c_str(), "");
// only put relative paths // only put relative paths
if (!tmp.empty() && tmp[0] != '/') { if (!tmp.empty() && tmp[0] != '/') {
fout << tmp.c_str() << "\n"; fout << tmp << "\n";
} }
} }
return true; return true;

View File

@ -1544,7 +1544,7 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
std::string echo_cmd = "echo "; std::string echo_cmd = "echo ";
echo_cmd += (this->CurrentLocalGenerator->EscapeForShell( echo_cmd += (this->CurrentLocalGenerator->EscapeForShell(
comment, ccg.GetCC().GetEscapeAllowMakeVars())); 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. // Add each command line to the set of commands.
@ -1562,7 +1562,7 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
} }
cmd += cmd2; cmd += cmd2;
ccg.AppendArguments(c, cmd); ccg.AppendArguments(c, cmd);
makefileStream << "\t" << cmd.c_str() << "\n"; makefileStream << "\t" << cmd << "\n";
} }
} }
} }

View File

@ -427,7 +427,7 @@ int cmGraphVizWriter::CollectAllTargets()
// Skip ignored targets // Skip ignored targets
continue; continue;
} }
// std::cout << "Found target: " << tit->first.c_str() << std::endl; // std::cout << "Found target: " << tit->first << std::endl;
std::ostringstream ostr; std::ostringstream ostr;
ostr << this->GraphNodePrefix << cnt++; ostr << this->GraphNodePrefix << cnt++;
this->TargetNamesNodes[realTargetName] = ostr.str(); this->TargetNamesNodes[realTargetName] = ostr.str();
@ -469,7 +469,7 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
ostr << this->GraphNodePrefix << cnt++; ostr << this->GraphNodePrefix << cnt++;
this->TargetNamesNodes[libName] = ostr.str(); this->TargetNamesNodes[libName] = ostr.str();
this->TargetPtrs[libName] = NULL; this->TargetPtrs[libName] = NULL;
// str << " \"" << ostr.c_str() << "\" [ label=\"" << libName // str << " \"" << ostr << "\" [ label=\"" << libName
// << "\" shape=\"ellipse\"];" << std::endl; // << "\" shape=\"ellipse\"];" << std::endl;
} }
} }

View File

@ -1688,12 +1688,12 @@ bool cmLocalVisualStudio7Generator::WriteGroup(
ppLang); ppLang);
} }
if (!fc.AdditionalDeps.empty()) { if (!fc.AdditionalDeps.empty()) {
fout << "\t\t\t\t\tAdditionalDependencies=\"" fout << "\t\t\t\t\tAdditionalDependencies=\"" << fc.AdditionalDeps
<< fc.AdditionalDeps.c_str() << "\"\n"; << "\"\n";
} }
if (!fc.ObjectName.empty()) { if (!fc.ObjectName.empty()) {
fout << "\t\t\t\t\tObjectFile=\"$(IntDir)/" fout << "\t\t\t\t\tObjectFile=\"$(IntDir)/" << fc.ObjectName
<< fc.ObjectName.c_str() << "\"\n"; << "\"\n";
} }
fout << "\t\t\t\t\t/>\n" fout << "\t\t\t\t\t/>\n"
<< "\t\t\t\t</FileConfiguration>\n"; << "\t\t\t\t</FileConfiguration>\n";

View File

@ -3416,7 +3416,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
while (cmSystemTools::GetLineFromStream(fin, inLine)) { while (cmSystemTools::GetLineFromStream(fin, inLine)) {
outLine = ""; outLine = "";
this->ConfigureString(inLine, outLine, atOnly, escapeQuotes); this->ConfigureString(inLine, outLine, atOnly, escapeQuotes);
fout << outLine.c_str() << newLineCharacters; fout << outLine << newLineCharacters;
} }
// close the files before attempting to copy // close the files before attempting to copy
fin.close(); fin.close();

View File

@ -31,8 +31,7 @@ int main()
kwsys::DynamicLoader::LibraryHandle handle = kwsys::DynamicLoader::LibraryHandle handle =
kwsys::DynamicLoader::OpenLibrary(libName.c_str()); kwsys::DynamicLoader::OpenLibrary(libName.c_str());
if (!handle) { if (!handle) {
std::cerr << "Could not open plugin \"" << libName.c_str() << "\"!" std::cerr << "Could not open plugin \"" << libName << "\"!" << std::endl;
<< std::endl;
return 1; return 1;
} }
kwsys::DynamicLoader::SymbolPointer sym = kwsys::DynamicLoader::SymbolPointer sym =