summaryrefslogtreecommitdiffstats
path: root/Source/CTest
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-05-17 16:54:39 (GMT)
committerBrad King <brad.king@kitware.com>2022-05-24 13:09:43 (GMT)
commit9409e5c04f0a534b53ce2f0e0a81c5e7e70c38f1 (patch)
tree65f6c53b866517b13a3b42ce4bd7b091f38f7808 /Source/CTest
parenta5f8cbe8b149d4b3e1136aa4c07691397d693038 (diff)
downloadCMake-9409e5c04f0a534b53ce2f0e0a81c5e7e70c38f1.zip
CMake-9409e5c04f0a534b53ce2f0e0a81c5e7e70c38f1.tar.gz
CMake-9409e5c04f0a534b53ce2f0e0a81c5e7e70c38f1.tar.bz2
clang-tidy: address `readability-container-data-pointer` lints
Diffstat (limited to 'Source/CTest')
-rw-r--r--Source/CTest/cmCTestBZR.cxx14
-rw-r--r--Source/CTest/cmCTestCVS.cxx4
-rw-r--r--Source/CTest/cmCTestGIT.cxx4
-rw-r--r--Source/CTest/cmCTestHG.cxx10
-rw-r--r--Source/CTest/cmCTestP4.cxx14
-rw-r--r--Source/CTest/cmCTestSVN.cxx12
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx2
-rw-r--r--Source/CTest/cmCTestVC.cxx2
8 files changed, 31 insertions, 31 deletions
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index eb8ee0a..81a866a 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/Source/CTest/cmCTestBZR.cxx
@@ -254,26 +254,26 @@ private:
this->BZR->DoRevision(this->Rev, this->Changes);
} else if (!this->CData.empty() &&
(name == "file" || name == "directory")) {
- this->CurChange.Path.assign(&this->CData[0], this->CData.size());
+ this->CurChange.Path.assign(this->CData.data(), this->CData.size());
cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path);
this->Changes.push_back(this->CurChange);
} else if (!this->CData.empty() && name == "symlink") {
// symlinks have an arobase at the end in the log
- this->CurChange.Path.assign(&this->CData[0], this->CData.size() - 1);
+ this->CurChange.Path.assign(this->CData.data(), this->CData.size() - 1);
cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path);
this->Changes.push_back(this->CurChange);
} else if (!this->CData.empty() && name == "committer") {
- this->Rev.Author.assign(&this->CData[0], this->CData.size());
+ this->Rev.Author.assign(this->CData.data(), this->CData.size());
if (this->EmailRegex.find(this->Rev.Author)) {
this->Rev.Author = this->EmailRegex.match(1);
this->Rev.EMail = this->EmailRegex.match(2);
}
} else if (!this->CData.empty() && name == "timestamp") {
- this->Rev.Date.assign(&this->CData[0], this->CData.size());
+ this->Rev.Date.assign(this->CData.data(), this->CData.size());
} else if (!this->CData.empty() && name == "message") {
- this->Rev.Log.assign(&this->CData[0], this->CData.size());
+ this->Rev.Log.assign(this->CData.data(), this->CData.size());
} else if (!this->CData.empty() && name == "revno") {
- this->Rev.Rev.assign(&this->CData[0], this->CData.size());
+ this->Rev.Rev.assign(this->CData.data(), this->CData.size());
}
this->CData.clear();
}
@@ -388,7 +388,7 @@ bool cmCTestBZR::UpdateImpl()
// For some reason bzr uses stderr to display the update status.
OutputLogger out(this->Log, "pull-out> ");
UpdateParser err(this, "pull-err> ");
- return this->RunUpdateCommand(&bzr_update[0], &out, &err);
+ return this->RunUpdateCommand(bzr_update.data(), &out, &err);
}
bool cmCTestBZR::LoadRevisions()
diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx
index 8f5542e..87ab762 100644
--- a/Source/CTest/cmCTestCVS.cxx
+++ b/Source/CTest/cmCTestCVS.cxx
@@ -101,7 +101,7 @@ bool cmCTestCVS::UpdateImpl()
UpdateParser out(this, "up-out> ");
UpdateParser err(this, "up-err> ");
- return this->RunUpdateCommand(&cvs_update[0], &out, &err);
+ return this->RunUpdateCommand(cvs_update.data(), &out, &err);
}
class cmCTestCVS::LogParser : public cmCTestVC::LineParser
@@ -258,7 +258,7 @@ void cmCTestCVS::WriteXMLDirectory(cmXMLWriter& xml, std::string const& path,
revisions.resize(2, this->Unknown);
// Write the entry for this file with these revisions.
- File f(fi.second, &revisions[0], &revisions[1]);
+ File f(fi.second, revisions.data(), revisions.data() + 1);
this->WriteXMLEntry(xml, path, fi.first, full, f);
}
xml.EndElement(); // Directory
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index a55f3e8..0b09f47 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -176,7 +176,7 @@ bool cmCTestGIT::UpdateByFetchAndReset()
// Fetch upstream refs.
OutputLogger fetch_out(this->Log, "fetch-out> ");
OutputLogger fetch_err(this->Log, "fetch-err> ");
- if (!this->RunUpdateCommand(&git_fetch[0], &fetch_out, &fetch_err)) {
+ if (!this->RunUpdateCommand(git_fetch.data(), &fetch_out, &fetch_err)) {
return false;
}
@@ -225,7 +225,7 @@ bool cmCTestGIT::UpdateByCustom(std::string const& custom)
OutputLogger custom_out(this->Log, "custom-out> ");
OutputLogger custom_err(this->Log, "custom-err> ");
- return this->RunUpdateCommand(&git_custom[0], &custom_out, &custom_err);
+ return this->RunUpdateCommand(git_custom.data(), &custom_out, &custom_err);
}
bool cmCTestGIT::UpdateInternal()
diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx
index 5f4581e..97b01ba 100644
--- a/Source/CTest/cmCTestHG.cxx
+++ b/Source/CTest/cmCTestHG.cxx
@@ -157,7 +157,7 @@ bool cmCTestHG::UpdateImpl()
OutputLogger out(this->Log, "update-out> ");
OutputLogger err(this->Log, "update-err> ");
- return this->RunUpdateCommand(&hg_update[0], &out, &err);
+ return this->RunUpdateCommand(hg_update.data(), &out, &err);
}
class cmCTestHG::LogParser
@@ -213,13 +213,13 @@ private:
if (name == "logentry") {
this->HG->DoRevision(this->Rev, this->Changes);
} else if (!this->CData.empty() && name == "author") {
- this->Rev.Author.assign(&this->CData[0], this->CData.size());
+ this->Rev.Author.assign(this->CData.data(), this->CData.size());
} else if (!this->CData.empty() && name == "email") {
- this->Rev.EMail.assign(&this->CData[0], this->CData.size());
+ this->Rev.EMail.assign(this->CData.data(), this->CData.size());
} else if (!this->CData.empty() && name == "date") {
- this->Rev.Date.assign(&this->CData[0], this->CData.size());
+ this->Rev.Date.assign(this->CData.data(), this->CData.size());
} else if (!this->CData.empty() && name == "msg") {
- this->Rev.Log.assign(&this->CData[0], this->CData.size());
+ this->Rev.Log.assign(this->CData.data(), this->CData.size());
} else if (!this->CData.empty() && name == "files") {
std::vector<std::string> paths = this->SplitCData();
for (std::string const& path : paths) {
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 2a7c3ad..ce8b7c7 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -160,7 +160,7 @@ cmCTestP4::User cmCTestP4::GetUserData(const std::string& username)
UserParser out(this, "users-out> ");
OutputLogger err(this->Log, "users-err> ");
- this->RunChild(&p4_users[0], &out, &err);
+ this->RunChild(p4_users.data(), &out, &err);
// The user should now be added to the map. Search again.
it = this->Users.find(username);
@@ -352,7 +352,7 @@ std::string cmCTestP4::GetWorkingRevision()
IdentifyParser out(this, "p4_changes-out> ", rev);
OutputLogger err(this->Log, "p4_changes-err> ");
- bool result = this->RunChild(&p4_identify[0], &out, &err);
+ bool result = this->RunChild(p4_identify.data(), &out, &err);
// If there was a problem contacting the server return "<unknown>"
if (!result) {
@@ -416,7 +416,7 @@ bool cmCTestP4::LoadRevisions()
OutputLogger err(this->Log, "p4_changes-err> ");
this->ChangeLists.clear();
- this->RunChild(&p4_changes[0], &out, &err);
+ this->RunChild(p4_changes.data(), &out, &err);
if (this->ChangeLists.empty()) {
return true;
@@ -433,7 +433,7 @@ bool cmCTestP4::LoadRevisions()
DescribeParser outDescribe(this, "p4_describe-out> ");
OutputLogger errDescribe(this->Log, "p4_describe-err> ");
- this->RunChild(&p4_describe[0], &outDescribe, &errDescribe);
+ this->RunChild(p4_describe.data(), &outDescribe, &errDescribe);
}
return true;
}
@@ -453,7 +453,7 @@ bool cmCTestP4::LoadModifications()
DiffParser out(this, "p4_diff-out> ");
OutputLogger err(this->Log, "p4_diff-err> ");
- this->RunChild(&p4_diff[0], &out, &err);
+ this->RunChild(p4_diff.data(), &out, &err);
return true;
}
@@ -471,7 +471,7 @@ bool cmCTestP4::UpdateCustom(const std::string& custom)
OutputLogger custom_out(this->Log, "p4_customsync-out> ");
OutputLogger custom_err(this->Log, "p4_customsync-err> ");
- return this->RunUpdateCommand(&p4_custom[0], &custom_out, &custom_err);
+ return this->RunUpdateCommand(p4_custom.data(), &custom_out, &custom_err);
}
bool cmCTestP4::UpdateImpl()
@@ -521,5 +521,5 @@ bool cmCTestP4::UpdateImpl()
OutputLogger out(this->Log, "p4_sync-out> ");
OutputLogger err(this->Log, "p4_sync-err> ");
- return this->RunUpdateCommand(&p4_sync[0], &out, &err);
+ return this->RunUpdateCommand(p4_sync.data(), &out, &err);
}
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index 4692dbd..4c98fdf 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -286,9 +286,9 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
args.push_back(nullptr);
if (strcmp(parameters[0], "update") == 0) {
- return this->RunUpdateCommand(&args[0], out, err);
+ return this->RunUpdateCommand(args.data(), out, err);
}
- return this->RunChild(&args[0], out, err);
+ return this->RunChild(args.data(), out, err);
}
class cmCTestSVN::LogParser
@@ -353,16 +353,16 @@ private:
if (name == "logentry") {
this->SVN->DoRevisionSVN(this->Rev, this->Changes);
} else if (!this->CData.empty() && name == "path") {
- std::string orig_path(&this->CData[0], this->CData.size());
+ std::string orig_path(this->CData.data(), this->CData.size());
std::string new_path = this->SVNRepo.BuildLocalPath(orig_path);
this->CurChange.Path.assign(new_path);
this->Changes.push_back(this->CurChange);
} else if (!this->CData.empty() && name == "author") {
- this->Rev.Author.assign(&this->CData[0], this->CData.size());
+ this->Rev.Author.assign(this->CData.data(), this->CData.size());
} else if (!this->CData.empty() && name == "date") {
- this->Rev.Date.assign(&this->CData[0], this->CData.size());
+ this->Rev.Date.assign(this->CData.data(), this->CData.size());
} else if (!this->CData.empty() && name == "msg") {
- this->Rev.Log.assign(&this->CData[0], this->CData.size());
+ this->Rev.Log.assign(this->CData.data(), this->CData.size());
}
this->CData.clear();
}
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index a8e0652..e5b18f4 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -56,7 +56,7 @@ private:
{
std::string val;
if (!this->CurrentValue.empty()) {
- val.assign(&this->CurrentValue[0], this->CurrentValue.size());
+ val.assign(this->CurrentValue.data(), this->CurrentValue.size());
}
return val;
}
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index d5711c5..609ccba 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -66,7 +66,7 @@ bool cmCTestVC::InitialCheckout(const std::string& command)
this->Log << "--- Begin Initial Checkout ---\n";
OutputLogger out(this->Log, "co-out> ");
OutputLogger err(this->Log, "co-err> ");
- bool result = this->RunChild(&vc_co[0], &out, &err, parent.c_str());
+ bool result = this->RunChild(vc_co.data(), &out, &err, parent.c_str());
this->Log << "--- End Initial Checkout ---\n";
if (!result) {
cmCTestLog(this->CTest, ERROR_MESSAGE,