Hello,
I think there is a false positive message:
CWE: 571 Condition 'alpha>=1' is always true
on the following code:
i2d::CVector2d CLine2d::GetNearestPoint(const i2d::CVector2d& point) const { double alpha = GetCastAlpha(point); if (alpha <= 0){ return m_point1; } else if (alpha >= 1){ return m_point2; } else{ return GetPositionFromAlpha(alpha); } }
i2d::CVector2d CLine2d::GetNearestPoint(const i2d::CVector2d& point) const { double alpha = GetCastAlpha(point);
if (alpha <= 0){ return m_point1; } else if (alpha >= 1){ return m_point2; } else{ return GetPositionFromAlpha(alpha); } }
Because alpha can be between 0 and 1 as well.
PS: thank you for the great software!
Thanks! I created ticket https://trac.cppcheck.net/ticket/9817
Log in to post a comment.
Hello,
I think there is a false positive message:
on the following code:
Because alpha can be between 0 and 1 as well.
PS: thank you for the great software!
Thanks! I created ticket https://trac.cppcheck.net/ticket/9817