clang-tidy: Add performance-type-promotion-in-math-fn check

https://clang.llvm.org/extra/clang-tidy/checks/performance/type-promotion-in-math-fn.html
This commit is contained in:
Hennadii Stepanov 2023-03-26 20:18:03 +01:00
parent 7e975e6cf8
commit 2400437230
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
2 changed files with 3 additions and 2 deletions

View file

@ -10,6 +10,7 @@ performance-for-range-copy,
performance-inefficient-vector-operation,
performance-move-const-arg,
performance-no-automatic-move,
performance-type-promotion-in-math-fn
performance-unnecessary-copy-initialization,
readability-const-return-type,
readability-redundant-declaration,

View file

@ -68,8 +68,8 @@ void TrafficGraphWidget::paintEvent(QPaintEvent *)
painter.drawLine(XMARGIN, YMARGIN + h, width() - XMARGIN, YMARGIN + h);
// decide what order of magnitude we are
int base = floor(log10(fMax));
float val = pow(10.0f, base);
int base = std::floor(std::log10(fMax));
float val = std::pow(10.0f, base);
const QString units = tr("kB/s");
const float yMarginText = 2.0;