Skip to content

Commit

Permalink
Preventing C4244 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tkhisak authored and Taku Hisaki committed May 7, 2024
1 parent bf56169 commit 0de8e70
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions CPP/Clipper2Lib/include/clipper2/clipper.core.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,10 @@ namespace Clipper2Lib
}
else
{
result.left = rect.left * scale;
result.top = rect.top * scale;
result.right = rect.right * scale;
result.bottom = rect.bottom * scale;
result.left = static_cast<T1>(rect.left * scale);
result.top = static_cast<T1>(rect.top * scale);
result.right = static_cast<T1>(rect.right * scale);
result.bottom = static_cast<T1>(rect.bottom * scale);
}
return result;
}
Expand Down Expand Up @@ -437,10 +437,10 @@ namespace Clipper2Lib
T ymax = std::numeric_limits<T>::lowest();
for (const auto& p : path)
{
if (p.x < xmin) xmin = p.x;
if (p.x > xmax) xmax = p.x;
if (p.y < ymin) ymin = p.y;
if (p.y > ymax) ymax = p.y;
if (p.x < xmin) xmin = static_cast<T>(p.x);
if (p.x > xmax) xmax = static_cast<T>(p.x);
if (p.y < ymin) ymin = static_cast<T>(p.y);
if (p.y > ymax) ymax = static_cast<T>(p.y);
}
return Rect<T>(xmin, ymin, xmax, ymax);
}
Expand All @@ -455,10 +455,10 @@ namespace Clipper2Lib
for (const Path<T2>& path : paths)
for (const Point<T2>& p : path)
{
if (p.x < xmin) xmin = p.x;
if (p.x > xmax) xmax = p.x;
if (p.y < ymin) ymin = p.y;
if (p.y > ymax) ymax = p.y;
if (p.x < xmin) xmin = static_cast<T>(p.x);
if (p.x > xmax) xmax = static_cast<T>(p.x);
if (p.y < ymin) ymin = static_cast<T>(p.y);
if (p.y > ymax) ymax = static_cast<T>(p.y);
}
return Rect<T>(xmin, ymin, xmax, ymax);
}
Expand Down

0 comments on commit 0de8e70

Please sign in to comment.