diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 4c439c92e..263d7ec28 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -3161,7 +3161,11 @@ Error String::parse_utf8(const char *p_utf8, int p_len, bool p_skip_cr) { int skip = 0; uint8_t c_start = 0; while (ptrtmp != ptrtmp_limit && *ptrtmp) { +#if CHAR_MIN == 0 + uint8_t c = *ptrtmp; +#else uint8_t c = *ptrtmp >= 0 ? *ptrtmp : uint8_t(256 + *ptrtmp); +#endif if (skip == 0) { if (p_skip_cr && c == '\r') { diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h index 534bef940..dc47cb988 100644 --- a/drivers/gles2/rasterizer_storage_gles2.h +++ b/drivers/gles2/rasterizer_storage_gles2.h @@ -1087,10 +1087,10 @@ public: struct MipMaps { struct Size { - GLuint fbo; - GLuint color; - int width; - int height; + GLuint fbo = 0; + GLuint color = 0; + int width = 0; + int height = 0; }; Vector sizes; diff --git a/modules/csg/csg.h b/modules/csg/csg.h index 6106c11df..c06180077 100644 --- a/modules/csg/csg.h +++ b/modules/csg/csg.h @@ -162,7 +162,7 @@ struct CSGBrushOperation { }; struct Face2D { - int vertex_idx[3]; + int vertex_idx[3] = {}; }; Vector vertices; @@ -170,7 +170,7 @@ struct CSGBrushOperation { Plane plane; Transform to_2D; Transform to_3D; - float vertex_snap2; + float vertex_snap2 = 0.0; inline int _get_point_idx(const Vector2 &p_point); inline int _add_vertex(const Vertex2D &p_vertex); diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp index bfc81ec1f..bf449c20b 100644 --- a/servers/physics/space_sw.cpp +++ b/servers/physics/space_sw.cpp @@ -116,8 +116,8 @@ bool PhysicsDirectSpaceStateSW::intersect_ray(const Vector3 &p_from, const Vecto bool collided = false; Vector3 res_point, res_normal; - int res_shape; - const CollisionObjectSW *res_obj; + int res_shape = 0; + const CollisionObjectSW *res_obj = nullptr; real_t min_d = 1e10; for (int i = 0; i < amount; i++) { diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 607d463b0..d4b7afc1e 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -138,8 +138,8 @@ bool Physics2DDirectSpaceStateSW::intersect_ray(const Vector2 &p_from, const Vec bool collided = false; Vector2 res_point, res_normal; - int res_shape; - const CollisionObject2DSW *res_obj; + int res_shape = 0; + const CollisionObject2DSW *res_obj = nullptr; real_t min_d = 1e10; for (int i = 0; i < amount; i++) {