mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 20:19:09 +08:00
Fixed compiler warnings
This commit is contained in:
parent
cf44ad22fe
commit
11273b29ac
@ -94,7 +94,7 @@ void fill_distances(const Polygon &poly, std::vector<double> &distances)
|
|||||||
|
|
||||||
double dist = 0.;
|
double dist = 0.;
|
||||||
auto lrange = line_range(poly);
|
auto lrange = line_range(poly);
|
||||||
for (const Line &l : lrange) {
|
for (const Line l : lrange) {
|
||||||
dist += l.length();
|
dist += l.length();
|
||||||
distances.emplace_back(dist);
|
distances.emplace_back(dist);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ Polygon ifp_convex_convex(const Polygon &fixed, const Polygon &movable)
|
|||||||
// the zero area polygon formed by the edge. The union of all these sub-nfps
|
// the zero area polygon formed by the edge. The union of all these sub-nfps
|
||||||
// will contain a hole that is the actual ifp.
|
// will contain a hole that is the actual ifp.
|
||||||
auto lrange = line_range(fixed);
|
auto lrange = line_range(fixed);
|
||||||
for (const Line &l : lrange) { // Older mac compilers generate warnging if line_range is called in-place
|
for (const Line l : lrange) { // Older mac compilers generate warnging if line_range is called in-place
|
||||||
Polygon fixed = {l.a, l.b};
|
Polygon fixed = {l.a, l.b};
|
||||||
subnfps.emplace_back(nfp_convex_convex_legacy(fixed, movable));
|
subnfps.emplace_back(nfp_convex_convex_legacy(fixed, movable));
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ static void RGBtoHSV(float r, float g, float b, float& h, float& s, float& v)
|
|||||||
h = 60.0f * (std::fmod(((g - b) / delta), 6.0f));
|
h = 60.0f * (std::fmod(((g - b) / delta), 6.0f));
|
||||||
else if (max_comp == g)
|
else if (max_comp == g)
|
||||||
h = 60.0f * (((b - r) / delta) + 2.0f);
|
h = 60.0f * (((b - r) / delta) + 2.0f);
|
||||||
else if (max_comp == b)
|
else // max_comp == b
|
||||||
h = 60.0f * (((r - g) / delta) + 4.0f);
|
h = 60.0f * (((r - g) / delta) + 4.0f);
|
||||||
|
|
||||||
s = (max_comp > 0.0f) ? delta / max_comp : 0.0f;
|
s = (max_comp > 0.0f) ? delta / max_comp : 0.0f;
|
||||||
|
@ -81,7 +81,7 @@ static inline void validate_range(const MultiPoint &mp)
|
|||||||
validate_range(mp.points);
|
validate_range(mp.points);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void validate_range(const Polygons &polygons)
|
[[maybe_unused]] static inline void validate_range(const Polygons &polygons)
|
||||||
{
|
{
|
||||||
for (const Polygon &p : polygons)
|
for (const Polygon &p : polygons)
|
||||||
validate_range(p);
|
validate_range(p);
|
||||||
|
@ -154,7 +154,7 @@ TextLines select_closest_contour(const std::vector<Polygons> &line_contours) {
|
|||||||
std::vector<Linef> linesf = to_linesf(expolygons);
|
std::vector<Linef> linesf = to_linesf(expolygons);
|
||||||
AABBTreeIndirect::Tree2d tree = AABBTreeLines::build_aabb_tree_over_indexed_lines(linesf);
|
AABBTreeIndirect::Tree2d tree = AABBTreeLines::build_aabb_tree_over_indexed_lines(linesf);
|
||||||
|
|
||||||
size_t line_idx;
|
size_t line_idx = 0;
|
||||||
Vec2d hit_point;
|
Vec2d hit_point;
|
||||||
// double distance =
|
// double distance =
|
||||||
AABBTreeLines::squared_distance_to_indexed_lines(linesf, tree, zero, line_idx, hit_point);
|
AABBTreeLines::squared_distance_to_indexed_lines(linesf, tree, zero, line_idx, hit_point);
|
||||||
|
@ -72,7 +72,7 @@ TEST_CASE("Moments calculation for rotated axis.", "[SupportSpotsGenerator]") {
|
|||||||
Integrals integrals{{polygon}};
|
Integrals integrals{{polygon}};
|
||||||
|
|
||||||
std::mt19937 generator{std::random_device{}()};
|
std::mt19937 generator{std::random_device{}()};
|
||||||
std::uniform_real_distribution<float> angle_distribution{0, 2*M_PI};
|
std::uniform_real_distribution<float> angle_distribution{0.f, float(2*M_PI)};
|
||||||
|
|
||||||
// Meassured counterclockwise from (1, 0)
|
// Meassured counterclockwise from (1, 0)
|
||||||
const float angle = angle_distribution(generator);
|
const float angle = angle_distribution(generator);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user