Fix warnings found by Emscripten 3.1.10

Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and
`-Wliteral-range` warnings.
This commit is contained in:
Rémi Verschelde 2022-05-10 12:05:52 +02:00
parent ccb583be09
commit d8935b27a9
10 changed files with 15 additions and 47 deletions

View file

@ -137,7 +137,7 @@ Vector<Vector2> PolygonPathFinder::find_path(const Vector2 &p_from, const Vector
Edge ignore_to_edge(-1, -1);
if (!_is_point_inside(from)) {
float closest_dist = 1e20;
float closest_dist = 1e20f;
Vector2 closest_point;
for (Set<Edge>::Element *E = edges.front(); E; E = E->next()) {
@ -161,7 +161,7 @@ Vector<Vector2> PolygonPathFinder::find_path(const Vector2 &p_from, const Vector
};
if (!_is_point_inside(to)) {
float closest_dist = 1e20;
float closest_dist = 1e20f;
Vector2 closest_point;
for (Set<Edge>::Element *E = edges.front(); E; E = E->next()) {
@ -489,7 +489,7 @@ bool PolygonPathFinder::is_point_inside(const Vector2 &p_point) const {
}
Vector2 PolygonPathFinder::get_closest_point(const Vector2 &p_point) const {
float closest_dist = 1e20;
float closest_dist = 1e20f;
Vector2 closest_point;
for (Set<Edge>::Element *E = edges.front(); E; E = E->next()) {
@ -508,7 +508,7 @@ Vector2 PolygonPathFinder::get_closest_point(const Vector2 &p_point) const {
}
}
ERR_FAIL_COND_V(closest_dist == 1e20, Vector2());
ERR_FAIL_COND_V(Math::is_equal_approx(closest_dist, 1e20f), Vector2());
return closest_point;
}