Base/App: fix warnings from code analysers:
* convert old-style-casts to explicit C++ casts where possible * make some implicit conversions explicit
This commit is contained in:
@@ -43,7 +43,7 @@ double Vector2d::GetAngle (const Vector2d &rclVect) const
|
||||
{
|
||||
fNum = (*this * rclVect) / fDivid;
|
||||
if (fNum < -1)
|
||||
return F_PI;
|
||||
return D_PI;
|
||||
else
|
||||
if (fNum > 1)
|
||||
return 0.0;
|
||||
@@ -186,11 +186,11 @@ bool Line2d::Intersect (const Line2d& rclLine, Vector2d &rclV) const
|
||||
if (fabs (clV2.x - clV1.x) > 1e-10)
|
||||
m1 = (clV2.y - clV1.y) / (clV2.x - clV1.x);
|
||||
else
|
||||
m1 = FLOAT_MAX;
|
||||
m1 = DOUBLE_MAX;
|
||||
if (fabs (rclLine.clV2.x - rclLine.clV1.x) > 1e-10)
|
||||
m2 = (rclLine.clV2.y - rclLine.clV1.y) / (rclLine.clV2.x - rclLine.clV1.x);
|
||||
else
|
||||
m2 = FLOAT_MAX;
|
||||
m2 = DOUBLE_MAX;
|
||||
if (m1 == m2) /****** RETURN ERR (parallel lines) *************/
|
||||
return false;
|
||||
|
||||
@@ -198,13 +198,13 @@ bool Line2d::Intersect (const Line2d& rclLine, Vector2d &rclV) const
|
||||
b2 = rclLine.clV1.y - m2 * rclLine.clV1.x;
|
||||
|
||||
// calc intersection
|
||||
if (m1 == FLOAT_MAX)
|
||||
if (m1 == DOUBLE_MAX)
|
||||
{
|
||||
rclV.x = clV1.x;
|
||||
rclV.y = m2 * rclV.x + b2;
|
||||
}
|
||||
else
|
||||
if (m2 == FLOAT_MAX)
|
||||
if (m2 == DOUBLE_MAX)
|
||||
{
|
||||
rclV.x = rclLine.clV1.x;
|
||||
rclV.y = m1 * rclV.x + b1;
|
||||
|
||||
Reference in New Issue
Block a user