Skip to content

Commit

Permalink
quell clang static analyzer report, potential false-positive, confuse…
Browse files Browse the repository at this point in the history
…d by the shadowing
  • Loading branch information
brlcad committed Feb 4, 2024
1 parent b4f76ca commit dcc458b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/librt/primitives/sketch/sketch_tess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,18 @@ static ON_2dPoint
incenter(const ON_2dPoint a, const ON_2dPoint b, const ON_2dPoint c)
{
fastf_t a_b, a_c, b_c, sum;
ON_2dPoint incenter;
ON_2dPoint incenter_pnt(0.0, 0.0);

a_b = a.DistanceTo(b);
a_c = a.DistanceTo(c);
b_c = b.DistanceTo(c);
sum = a_b + a_c + b_c;

incenter.x = (b_c * a.x + a_c * b.x + a_b * c.x) / sum;
incenter.y = (b_c * a.y + a_c * b.y + a_b * c.y) / sum;
return incenter;
if (sum > 0.0) {
incenter_pnt.x = (b_c * a.x + a_c * b.x + a_b * c.x) / sum;
incenter_pnt.y = (b_c * a.y + a_c * b.y + a_b * c.y) / sum;
}
return incenter_pnt;
}


Expand Down

0 comments on commit dcc458b

Please sign in to comment.