summaryrefslogtreecommitdiffstats
path: root/Source/cmCTest.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2022-05-17 17:10:30 (GMT)
committerBrad King <brad.king@kitware.com>2022-05-24 13:09:43 (GMT)
commit6ff03d463f40176389943100690cf1ca8593d739 (patch)
tree09ad876ecf9d635108df5374f8c0f5ebb4400506 /Source/cmCTest.cxx
parent9409e5c04f0a534b53ce2f0e0a81c5e7e70c38f1 (diff)
downloadCMake-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/cmCTest.cxx')
-rw-r--r--Source/cmCTest.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 3673dfb..d4c0e77 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -322,7 +322,7 @@ std::string cmCTest::DecodeURL(const std::string& in)
for (const char* c = in.c_str(); *c; ++c) {
if (*c == '%' && isxdigit(*(c + 1)) && isxdigit(*(c + 2))) {
char buf[3] = { *(c + 1), *(c + 2), 0 };
- out.append(1, char(strtoul(buf, nullptr, 16)));
+ out.append(1, static_cast<char>(strtoul(buf, nullptr, 16)));
c += 2;
} else {
out.append(1, *c);
@@ -357,7 +357,7 @@ cmCTest::cmCTest()
this->Impl->Parts[PartDone].SetName("Done");
// Fill the part name-to-id map.
- for (Part p = PartStart; p != PartCount; p = Part(p + 1)) {
+ for (Part p = PartStart; p != PartCount; p = static_cast<Part>(p + 1)) {
this->Impl
->PartMap[cmSystemTools::LowerCase(this->Impl->Parts[p].GetName())] = p;
}
@@ -643,7 +643,7 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
std::string src_dir = this->GetCTestConfiguration("SourceDirectory");
std::string bld_dir = this->GetCTestConfiguration("BuildDirectory");
this->Impl->BuildID = "";
- for (Part p = PartStart; p != PartCount; p = Part(p + 1)) {
+ for (Part p = PartStart; p != PartCount; p = static_cast<Part>(p + 1)) {
this->Impl->Parts[p].SubmitFiles.clear();
}
@@ -797,7 +797,7 @@ int cmCTest::GetTestModel() const
bool cmCTest::SetTest(const std::string& ttype, bool report)
{
if (cmSystemTools::LowerCase(ttype) == "all") {
- for (Part p = PartStart; p != PartCount; p = Part(p + 1)) {
+ for (Part p = PartStart; p != PartCount; p = static_cast<Part>(p + 1)) {
this->Impl->Parts[p].Enable();
}
return true;
@@ -935,7 +935,8 @@ int cmCTest::ProcessSteps()
bool notest = true;
int update_count = 0;
- for (Part p = PartStart; notest && p != PartCount; p = Part(p + 1)) {
+ for (Part p = PartStart; notest && p != PartCount;
+ p = static_cast<Part>(p + 1)) {
notest = !this->Impl->Parts[p];
}
if (this->Impl->Parts[PartUpdate] &&
@@ -2019,7 +2020,8 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
i++;
long outputSize;
if (cmStrToLong(args[i], &outputSize)) {
- this->Impl->TestHandler.SetTestOutputSizePassed(int(outputSize));
+ this->Impl->TestHandler.SetTestOutputSizePassed(
+ static_cast<int>(outputSize));
} else {
cmCTestLog(this, WARNING,
"Invalid value for '--test-output-size-passed': " << args[i]
@@ -2030,7 +2032,8 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
i++;
long outputSize;
if (cmStrToLong(args[i], &outputSize)) {
- this->Impl->TestHandler.SetTestOutputSizeFailed(int(outputSize));
+ this->Impl->TestHandler.SetTestOutputSizeFailed(
+ static_cast<int>(outputSize));
} else {
cmCTestLog(this, WARNING,
"Invalid value for '--test-output-size-failed': " << args[i]