diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2022-05-17 17:10:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-05-24 13:09:43 (GMT) |
commit | 6ff03d463f40176389943100690cf1ca8593d739 (patch) | |
tree | 09ad876ecf9d635108df5374f8c0f5ebb4400506 /Source/CTest | |
parent | 9409e5c04f0a534b53ce2f0e0a81c5e7e70c38f1 (diff) | |
download | CMake-6ff03d463f40176389943100690cf1ca8593d739.zip CMake-6ff03d463f40176389943100690cf1ca8593d739.tar.gz CMake-6ff03d463f40176389943100690cf1ca8593d739.tar.bz2 |
clang-tidy: address `google-readability-casting` lints
At least those involving `static_cast`.
Diffstat (limited to 'Source/CTest')
-rw-r--r-- | Source/CTest/cmCTestBinPacker.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestGIT.cxx | 3 | ||||
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 3 | ||||
-rw-r--r-- | Source/CTest/cmCTestP4.cxx | 3 | ||||
-rw-r--r-- | Source/CTest/cmCTestSubmitHandler.cxx | 6 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 3 |
7 files changed, 13 insertions, 9 deletions
diff --git a/Source/CTest/cmCTestBinPacker.cxx b/Source/CTest/cmCTestBinPacker.cxx index e21b14d..239499c 100644 --- a/Source/CTest/cmCTestBinPacker.cxx +++ b/Source/CTest/cmCTestBinPacker.cxx @@ -108,7 +108,7 @@ static bool AllocateCTestResources( // Do the actual allocation return AllocateCTestResources<AllocationStrategy>( - resources, resourcesSorted, std::size_t(0), allocationsPtr); + resources, resourcesSorted, static_cast<std::size_t>(0), allocationsPtr); } class RoundRobinAllocationStrategy diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index aef58c5..f7c6a9c 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -2210,7 +2210,7 @@ int cmCTestCoverageHandler::GetLabelId(std::string const& label) { auto i = this->LabelIdMap.find(label); if (i == this->LabelIdMap.end()) { - int n = int(this->Labels.size()); + int n = static_cast<int>(this->Labels.size()); this->Labels.push_back(label); LabelIdMapType::value_type entry(label, n); i = this->LabelIdMap.insert(entry).first; diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx index 0b09f47..b2fb069 100644 --- a/Source/CTest/cmCTestGIT.cxx +++ b/Source/CTest/cmCTestGIT.cxx @@ -535,7 +535,8 @@ private: void NextSection() { - this->Section = SectionType((this->Section + 1) % SectionCount); + this->Section = + static_cast<SectionType>((this->Section + 1) % SectionCount); this->Separator = SectionSep[this->Section]; if (this->Section == SectionHeader) { this->GIT->DoRevision(this->Rev, this->Changes); diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 2d8276a..788845b 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -1207,7 +1207,8 @@ bool cmCTestMemCheckHandler::ProcessMemCheckCudaOutput( if (failure >= 0) { ostr << "<b>" << this->ResultStrings[failure] << "</b> "; - if (results.empty() || unsigned(failure) > results.size() - 1) { + if (results.empty() || + static_cast<unsigned>(failure) > results.size() - 1) { results.push_back(1); } else { results[failure]++; diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx index ce8b7c7..0e67c41 100644 --- a/Source/CTest/cmCTestP4.cxx +++ b/Source/CTest/cmCTestP4.cxx @@ -248,7 +248,8 @@ private: this->Rev = Revision(); } - this->Section = SectionType((this->Section + 1) % SectionCount); + this->Section = + static_cast<SectionType>((this->Section + 1) % SectionCount); } void DoHeaderLine() diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index e5b18f4..da085a6 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -124,7 +124,7 @@ void cmCTestSubmitHandler::Initialize() { // We submit all available parts by default. for (cmCTest::Part p = cmCTest::PartStart; p != cmCTest::PartCount; - p = cmCTest::Part(p + 1)) { + p = static_cast<cmCTest::Part>(p + 1)) { this->SubmitPart[p] = true; } this->HasWarnings = false; @@ -810,7 +810,7 @@ int cmCTestSubmitHandler::ProcessHandler() // Query parts for files to submit. for (cmCTest::Part p = cmCTest::PartStart; p != cmCTest::PartCount; - p = cmCTest::Part(p + 1)) { + p = static_cast<cmCTest::Part>(p + 1)) { // Skip parts we are not submitting. if (!this->SubmitPart[p]) { continue; @@ -894,7 +894,7 @@ void cmCTestSubmitHandler::SelectParts(std::set<cmCTest::Part> const& parts) { // Check whether each part is selected. for (cmCTest::Part p = cmCTest::PartStart; p != cmCTest::PartCount; - p = cmCTest::Part(p + 1)) { + p = static_cast<cmCTest::Part>(p + 1)) { this->SubmitPart[p] = parts.find(p) != parts.end(); } } diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 696a5ea..248533a 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -586,7 +586,8 @@ void cmCTestTestHandler::LogTestSummary(const std::vector<std::string>& passed, { std::size_t total = passed.size() + failed.size(); - float percent = float(passed.size()) * 100.0f / float(total); + float percent = + static_cast<float>(passed.size()) * 100.0f / static_cast<float>(total); if (!failed.empty() && percent > 99) { percent = 99; } |