mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Replace C-style casts with C++ ones
This commit is contained in:
parent
e3671050d1
commit
74cecb1b6c
20 changed files with 41 additions and 39 deletions
|
@ -44,7 +44,7 @@ QVector<float> PieceAvailabilityBar::intToFloatVector(const QVector<int> &vecin,
|
|||
QVector<float> result(reqSize, 0.0);
|
||||
if (vecin.isEmpty()) return result;
|
||||
|
||||
const float ratio = vecin.size() / (float)reqSize;
|
||||
const float ratio = static_cast<float>(vecin.size()) / reqSize;
|
||||
|
||||
const int maxElement = *std::max_element(vecin.begin(), vecin.end());
|
||||
|
||||
|
@ -112,7 +112,7 @@ QVector<float> PieceAvailabilityBar::intToFloatVector(const QVector<int> &vecin,
|
|||
value /= ratio * maxElement;
|
||||
|
||||
// float precision sometimes gives > 1, because in not possible to store irrational numbers
|
||||
value = qMin(value, (float)1.0);
|
||||
value = qMin(value, 1.0f);
|
||||
|
||||
result[x] = value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue