Skip to content

Commit

Permalink
LineBufferOverlay: Result is not floating-point
Browse files Browse the repository at this point in the history
dec/2 is an integer and calling round() doesn't make sense, dec/2.0 is a double

From coverity 'integer_division: Dividing integer expressions dec and 2,
and then converting the integer quotient to type double.
Any remainder, or fractional part of the quotient, is ignored.'
  • Loading branch information
did-g committed Sep 12, 2018
1 parent 78d9223 commit 25da387
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/LineBufferOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ void LineBufferOverlay::setLineBuffer()

arrow.pushLine( 0, dec, 0, dec - windArrowSize ); // hampe
// Right arrow
arrow.pushLine(0, dec - ceil(m_lineWidth / 2 * sqrt(2)), round(dec/4 + (m_lineWidth / 2 * sqrt(2))), round(dec/2));
arrow.pushLine(0, dec - ceil(m_lineWidth / 2 * sqrt(2)), round(dec/4 + (m_lineWidth / 2 * sqrt(2))), round(dec/2.));
// Left arrow
arrow.pushLine(0, dec - ceil(m_lineWidth / 2 * sqrt(2)), round(-dec/4 - (m_lineWidth / 2 * sqrt(2))), round(dec/2));
arrow.pushLine(0, dec - ceil(m_lineWidth / 2 * sqrt(2)), round(-dec/4 - (m_lineWidth / 2 * sqrt(2))), round(dec/2.));
}

float alpha = 0.38;
Expand Down

0 comments on commit 25da387

Please sign in to comment.