diff options
Diffstat (limited to 'Source/CTest/cmCTestBZR.cxx')
-rw-r--r-- | Source/CTest/cmCTestBZR.cxx | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx index dd53be8..0e08e1c 100644 --- a/Source/CTest/cmCTestBZR.cxx +++ b/Source/CTest/cmCTestBZR.cxx @@ -61,8 +61,9 @@ extern "C" int cmBZRXMLParserUnknownEncodingHandler(void*, // workaround for these unknown encodings. if (name == std::string("ascii") || name == std::string("cp1252") || name == std::string("ANSI_X3.4-1968")) { - for (unsigned int i = 0; i < 256; ++i) + for (unsigned int i = 0; i < 256; ++i) { info->map[i] = latin1[i]; + } return 1; } @@ -100,7 +101,7 @@ private: bool CheckOutFound; cmsys::RegularExpression RegexCheckOut; cmsys::RegularExpression RegexParent; - virtual bool ProcessLine() + bool ProcessLine() CM_OVERRIDE { if (this->RegexCheckOut.find(this->Line)) { this->BZR->URL = this->RegexCheckOut.match(1); @@ -125,7 +126,7 @@ public: private: std::string& Rev; cmsys::RegularExpression RegexRevno; - virtual bool ProcessLine() + bool ProcessLine() CM_OVERRIDE { if (this->RegexRevno.find(this->Line)) { this->Rev = this->RegexRevno.match(1); @@ -138,13 +139,13 @@ std::string cmCTestBZR::LoadInfo() { // Run "bzr info" to get the repository info from the work tree. const char* bzr = this->CommandLineTool.c_str(); - const char* bzr_info[] = { bzr, "info", 0 }; + const char* bzr_info[] = { bzr, "info", CM_NULLPTR }; InfoParser iout(this, "info-out> "); OutputLogger ierr(this->Log, "info-err> "); this->RunChild(bzr_info, &iout, &ierr); // Run "bzr revno" to get the repository revision number from the work tree. - const char* bzr_revno[] = { bzr, "revno", 0 }; + const char* bzr_revno[] = { bzr, "revno", CM_NULLPTR }; std::string rev; RevnoParser rout(this, "revno-out> ", rev); OutputLogger rerr(this->Log, "revno-err> "); @@ -182,14 +183,15 @@ public: { this->InitializeParser(); } - ~LogParser() { this->CleanupParser(); } + ~LogParser() CM_OVERRIDE { this->CleanupParser(); } - virtual int InitializeParser() + int InitializeParser() CM_OVERRIDE { int res = cmXMLParser::InitializeParser(); if (res) { XML_SetUnknownEncodingHandler(static_cast<XML_Parser>(this->Parser), - cmBZRXMLParserUnknownEncodingHandler, 0); + cmBZRXMLParserUnknownEncodingHandler, + CM_NULLPTR); } return res; } @@ -206,14 +208,14 @@ private: cmsys::RegularExpression EmailRegex; - virtual bool ProcessChunk(const char* data, int length) + bool ProcessChunk(const char* data, int length) CM_OVERRIDE { this->OutputLogger::ProcessChunk(data, length); this->ParseChunk(data, length); return true; } - virtual void StartElement(const std::string& name, const char**) + void StartElement(const std::string& name, const char**) CM_OVERRIDE { this->CData.clear(); if (name == "log") { @@ -238,12 +240,12 @@ private: } } - virtual void CharacterDataHandler(const char* data, int length) + void CharacterDataHandler(const char* data, int length) CM_OVERRIDE { this->CData.insert(this->CData.end(), data, data + length); } - virtual void EndElement(const std::string& name) + void EndElement(const std::string& name) CM_OVERRIDE { if (name == "log") { this->BZR->DoRevision(this->Rev, this->Changes); @@ -273,7 +275,7 @@ private: this->CData.clear(); } - virtual void ReportError(int, int, const char* msg) + void ReportError(int, int, const char* msg) CM_OVERRIDE { this->BZR->Log << "Error parsing bzr log xml: " << msg << "\n"; } @@ -293,7 +295,7 @@ private: cmCTestBZR* BZR; cmsys::RegularExpression RegexUpdate; - virtual bool ProcessChunk(const char* first, int length) + bool ProcessChunk(const char* first, int length) CM_OVERRIDE { bool last_is_new_line = (*first == '\r' || *first == '\n'); @@ -324,7 +326,7 @@ private: return true; } - bool ProcessLine() + bool ProcessLine() CM_OVERRIDE { if (this->RegexUpdate.find(this->Line)) { this->DoPath(this->RegexUpdate.match(1)[0], @@ -336,8 +338,9 @@ private: void DoPath(char c0, char c1, char c2, std::string path) { - if (path.empty()) + if (path.empty()) { return; + } cmSystemTools::ConvertToUnixSlashes(path); const std::string dir = cmSystemTools::GetFilenamePath(path); @@ -378,7 +381,7 @@ bool cmCTestBZR::UpdateImpl() bzr_update.push_back(this->URL.c_str()); - bzr_update.push_back(0); + bzr_update.push_back(CM_NULLPTR); // For some reason bzr uses stderr to display the update status. OutputLogger out(this->Log, "pull-out> "); @@ -406,7 +409,8 @@ void cmCTestBZR::LoadRevisions() // Run "bzr log" to get all global revisions of interest. const char* bzr = this->CommandLineTool.c_str(); const char* bzr_log[] = { - bzr, "log", "-v", "-r", revs.c_str(), "--xml", this->URL.c_str(), 0 + bzr, "log", "-v", "-r", revs.c_str(), "--xml", this->URL.c_str(), + CM_NULLPTR }; { LogParser out(this, "log-out> "); @@ -429,7 +433,7 @@ public: private: cmCTestBZR* BZR; cmsys::RegularExpression RegexStatus; - bool ProcessLine() + bool ProcessLine() CM_OVERRIDE { if (this->RegexStatus.find(this->Line)) { this->DoPath(this->RegexStatus.match(1)[0], @@ -441,8 +445,9 @@ private: void DoPath(char c0, char c1, char c2, std::string path) { - if (path.empty()) + if (path.empty()) { return; + } cmSystemTools::ConvertToUnixSlashes(path); if (c0 == 'C') { @@ -462,7 +467,7 @@ void cmCTestBZR::LoadModifications() { // Run "bzr status" which reports local modifications. const char* bzr = this->CommandLineTool.c_str(); - const char* bzr_status[] = { bzr, "status", "-SV", 0 }; + const char* bzr_status[] = { bzr, "status", "-SV", CM_NULLPTR }; StatusParser out(this, "status-out> "); OutputLogger err(this->Log, "status-err> "); this->RunChild(bzr_status, &out, &err); |