Fix some casts/calculations to keep PVS Studio happy

* It identifies some potential overflows which we know likely won't happen, but
  the fixes are harmless.
* Some issues are definitely bad, though not actual bugs.
This commit is contained in:
baldurk
2020-01-21 14:00:22 +00:00
parent baac06ca93
commit 8fa93105f2
17 changed files with 45 additions and 42 deletions
+2 -1
View File
@@ -260,7 +260,8 @@ void TimelineBar::layout()
qreal virtualSize = m_dataArea.width() * m_zoom;
while(virtualSize > 0 && (maxEID / m_eidAxisLabelStep) * m_eidAxisLabelWidth > virtualSize)
while(virtualSize > 0 &&
(qreal(maxEID) / qreal(m_eidAxisLabelStep)) * m_eidAxisLabelWidth > virtualSize)
{
// increment 1, 2, 5, 10, 20, 50, 100, ...
if(stepSize == 1)