mirror of
https://github.com/reactos/CMake.git
synced 2024-11-23 11:39:48 +00:00
clang-tidy: Enable checks from bugprone set
This commit is contained in:
parent
4e0c75b78f
commit
ce2570b207
@ -1,5 +1,8 @@
|
||||
---
|
||||
Checks: "-*,\
|
||||
bugprone-*,\
|
||||
-bugprone-macro-parentheses,\
|
||||
-bugprone-misplaced-widening-cast,\
|
||||
google-readability-casting,\
|
||||
misc-*,\
|
||||
-misc-incorrect-roundings,\
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "cmCTestTestHandler.h"
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
#include <cmath>
|
||||
#include <cmsys/Base64.h>
|
||||
#include <cmsys/Directory.hxx>
|
||||
#include <cmsys/RegularExpression.hxx>
|
||||
@ -544,8 +545,7 @@ int cmCTestTestHandler::ProcessHandler()
|
||||
}
|
||||
cmCTestLog(this->CTest, HANDLER_OUTPUT,
|
||||
std::endl
|
||||
<< passColorCode << static_cast<int>(percent + .5f)
|
||||
<< "% tests passed"
|
||||
<< passColorCode << std::lround(percent) << "% tests passed"
|
||||
<< this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)
|
||||
<< ", " << failedColorCode << failed.size() << " tests failed"
|
||||
<< this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <assert.h>
|
||||
#include <cmath>
|
||||
#include <ctype.h>
|
||||
#include <memory> // IWYU pragma: keep
|
||||
#include <sstream>
|
||||
@ -2602,10 +2603,10 @@ public:
|
||||
|
||||
bool UpdatePercentage(double value, double total, std::string& status)
|
||||
{
|
||||
int OldPercentage = this->CurrentPercentage;
|
||||
long OldPercentage = this->CurrentPercentage;
|
||||
|
||||
if (total > 0.0) {
|
||||
this->CurrentPercentage = static_cast<int>(value / total * 100.0 + 0.5);
|
||||
this->CurrentPercentage = std::lround(value / total * 100.0);
|
||||
if (this->CurrentPercentage > 100) {
|
||||
// Avoid extra progress reports for unexpected data beyond total.
|
||||
this->CurrentPercentage = 100;
|
||||
@ -2627,7 +2628,7 @@ public:
|
||||
cmFileCommand* GetFileCommand() { return this->FileCommand; }
|
||||
|
||||
private:
|
||||
int CurrentPercentage;
|
||||
long CurrentPercentage;
|
||||
cmFileCommand* FileCommand;
|
||||
std::string Text;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user