diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-02-10 05:21:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-08 18:05:35 (GMT) |
commit | 270eb96df05b93023cdd3d3a186b44b4ece1d655 (patch) | |
tree | 25d3037b5412b24242c631cccfe36e16a0fa8e1c /Source/CTest/cmCTestMemCheckHandler.cxx | |
parent | 215b1addf09359507281359cd7d478c61c01a9f2 (diff) | |
download | CMake-270eb96df05b93023cdd3d3a186b44b4ece1d655.zip CMake-270eb96df05b93023cdd3d3a186b44b4ece1d655.tar.gz CMake-270eb96df05b93023cdd3d3a186b44b4ece1d655.tar.bz2 |
strings: Remove cmStdString references
Casts from std::string -> cmStdString were high on the list of things
taking up time. Avoid such implicit casts across function calls by just
using std::string everywhere.
The comment that the symbol name is too long is no longer relevant since
modern debuggers alias the templates anyways and the size is a
non-issue since the underlying methods are generated since it's
inherited.
Diffstat (limited to 'Source/CTest/cmCTestMemCheckHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index fdce04d..f2982a4 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -246,8 +246,8 @@ int cmCTestMemCheckHandler::PostProcessHandler() void cmCTestMemCheckHandler::GenerateTestCommand( std::vector<std::string>& args, int test) { - std::vector<cmStdString>::size_type pp; - cmStdString index; + std::vector<std::string>::size_type pp; + std::string index; cmOStringStream stream; std::string memcheckcommand = cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str()); @@ -255,9 +255,9 @@ void cmCTestMemCheckHandler::GenerateTestCommand( index = stream.str(); for ( pp = 0; pp < this->MemoryTesterDynamicOptions.size(); pp ++ ) { - cmStdString arg = this->MemoryTesterDynamicOptions[pp]; - cmStdString::size_type pos = arg.find("??"); - if (pos != cmStdString::npos) + std::string arg = this->MemoryTesterDynamicOptions[pp]; + std::string::size_type pos = arg.find("??"); + if (pos != std::string::npos) { arg.replace(pos, 2, index); } @@ -580,7 +580,7 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking() return false; } - std::vector<cmStdString>::size_type cc; + std::vector<std::string>::size_type cc; for ( cc = 0; cmCTestMemCheckResultStrings[cc]; cc ++ ) { this->MemoryTesterGlobalResults[cc] = 0; @@ -627,7 +627,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( const std::string& str, std::string& log, int* results) { - std::vector<cmStdString> lines; + std::vector<std::string> lines; cmSystemTools::Split(str.c_str(), lines); cmOStringStream ostr; log = ""; @@ -636,7 +636,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( int defects = 0; - for( std::vector<cmStdString>::iterator i = lines.begin(); + for( std::vector<std::string>::iterator i = lines.begin(); i != lines.end(); ++i) { int failure = cmCTestMemCheckHandler::NO_MEMORY_FAULT; @@ -681,7 +681,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( const std::string& str, std::string& log, int* results) { - std::vector<cmStdString> lines; + std::vector<std::string> lines; cmSystemTools::Split(str.c_str(), lines); bool unlimitedOutput = false; if(str.find("CTEST_FULL_OUTPUT") != str.npos || @@ -864,10 +864,10 @@ bool cmCTestMemCheckHandler::ProcessMemCheckBoundsCheckerOutput( { log = ""; double sttime = cmSystemTools::GetTime(); - std::vector<cmStdString> lines; + std::vector<std::string> lines; cmSystemTools::Split(str.c_str(), lines); cmCTestLog(this->CTest, DEBUG, "Start test: " << lines.size() << std::endl); - std::vector<cmStdString>::size_type cc; + std::vector<std::string>::size_type cc; for ( cc = 0; cc < lines.size(); cc ++ ) { if(lines[cc] == BOUNDS_CHECKER_MARKER) @@ -923,7 +923,7 @@ cmCTestMemCheckHandler::PostProcessBoundsCheckerTest(cmCTestTestResult& res, cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "PostProcessBoundsCheckerTest for : " << res.Name.c_str() << std::endl); - cmStdString ofile = testOutputFileName(test); + std::string ofile = testOutputFileName(test); if ( ofile.empty() ) { return; @@ -979,7 +979,7 @@ void cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res, int test) { - cmStdString ofile = testOutputFileName(test); + std::string ofile = testOutputFileName(test); if ( ofile.empty() ) { @@ -1000,15 +1000,15 @@ cmCTestMemCheckHandler::appendMemTesterOutput(cmCTestTestResult& res, } } -cmStdString +std::string cmCTestMemCheckHandler::testOutputFileName(int test) { - cmStdString index; + std::string index; cmOStringStream stream; stream << test; index = stream.str(); - cmStdString ofile = this->MemoryTesterOutputFile; - cmStdString::size_type pos = ofile.find("??"); + std::string ofile = this->MemoryTesterOutputFile; + std::string::size_type pos = ofile.find("??"); ofile.replace(pos, 2, index); if ( !cmSystemTools::FileExists(ofile.c_str()) ) |