diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-06-06 21:53:32 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2016-06-06 21:53:32 (GMT) |
commit | fa277b29e41a8de43913f0a63b273bb3dbc759e8 (patch) | |
tree | f3b7bf879516bb09d46fad80ddd7e22fafa1a77f /Source/CTest | |
parent | ba5fb16519d095051ea90e642cbf41a28be6a03d (diff) | |
download | CMake-fa277b29e41a8de43913f0a63b273bb3dbc759e8.zip CMake-fa277b29e41a8de43913f0a63b273bb3dbc759e8.tar.gz CMake-fa277b29e41a8de43913f0a63b273bb3dbc759e8.tar.bz2 |
Remove c_str() calls from stream arguments.
Mostly automated:
git grep -l '.c_str() <<' | xargs sed -i 's|\.c_str() <<| <<|g'
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestBuildAndTestHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 4 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 8 | ||||
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 6 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 15 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 2 |
6 files changed, 18 insertions, 19 deletions
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 0cba8b2..632f452 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 ba9e546..a631db9 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 5b5caea..5f70f66 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 6f19b32..7b384ad 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -449,7 +449,7 @@ void cmCTestMultiProcessHandler::UpdateCostData() fout << "---\n"; for (std::vector<std::string>::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 015b908..69f2ac5 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<off_t>(static_cast<size_t>(st.st_size)) != static_cast<off_t>(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<size_t>(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 f461ca8..96a22d9 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<std::string>::iterator i = failed.begin(); i != failed.end(); ++i) { - cmCTestLog(ctest, HANDLER_OUTPUT, i->c_str() << "\n"); + cmCTestLog(ctest, HANDLER_OUTPUT, *i << "\n"); } } |