From 6bdd84b8d5a8671d0a574739b27a1ddbdfa88e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 29 Sep 2021 15:23:12 +0200 Subject: [PATCH] Fix -Wextra warnings from GCC 11 --- core/io/compression.cpp | 1 + core/math/convex_hull.cpp | 2 +- drivers/gles2/rasterizer_gles2.cpp | 2 +- drivers/gles2/shader_gles2.h | 2 +- drivers/gles3/rasterizer_gles3.cpp | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/io/compression.cpp b/core/io/compression.cpp index 62989b1d2cb..5a8893d6e20 100644 --- a/core/io/compression.cpp +++ b/core/io/compression.cpp @@ -235,6 +235,7 @@ int Compression::decompress_dynamic(PoolVector *p_dst, int p_max_dst_si switch (ret) { case Z_NEED_DICT: ret = Z_DATA_ERROR; + FALLTHROUGH; case Z_DATA_ERROR: case Z_MEM_ERROR: case Z_STREAM_ERROR: diff --git a/core/math/convex_hull.cpp b/core/math/convex_hull.cpp index 6c6df6a45e5..1bfdb706bb3 100644 --- a/core/math/convex_hull.cpp +++ b/core/math/convex_hull.cpp @@ -1046,8 +1046,8 @@ void ConvexHullInternal::compute_internal(int32_t p_start, int32_t p_end, Interm return; } + FALLTHROUGH; } - // lint -fallthrough case 1: { Vertex *v = original_vertices[p_start]; v->edges = nullptr; diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 4ab5b610028..2ea1b99accc 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -355,7 +355,7 @@ void RasterizerGLES2::set_boot_image(const Ref &p_image, const Color &p_c canvas->canvas_begin(); RID texture = storage->texture_create(); - storage->texture_allocate(texture, p_image->get_width(), p_image->get_height(), 0, p_image->get_format(), VS::TEXTURE_TYPE_2D, p_use_filter ? VS::TEXTURE_FLAG_FILTER : 0); + storage->texture_allocate(texture, p_image->get_width(), p_image->get_height(), 0, p_image->get_format(), VS::TEXTURE_TYPE_2D, p_use_filter ? (uint32_t)VS::TEXTURE_FLAG_FILTER : 0); storage->texture_set_data(texture, p_image); Rect2 imgrect(0, 0, p_image->get_width(), p_image->get_height()); diff --git a/drivers/gles2/shader_gles2.h b/drivers/gles2/shader_gles2.h index 20c844c5036..eb614d3d67b 100644 --- a/drivers/gles2/shader_gles2.h +++ b/drivers/gles2/shader_gles2.h @@ -261,7 +261,7 @@ int ShaderGLES2::_get_uniform(int p_which) const { void ShaderGLES2::_set_conditional(int p_which, bool p_value) { ERR_FAIL_INDEX(p_which, conditional_count); - ERR_FAIL_INDEX(static_cast(p_which), sizeof(new_conditional_version.version) * 8); + ERR_FAIL_INDEX(p_which, (int)sizeof(new_conditional_version.version) * 8); if (p_value) { new_conditional_version.version |= (uint64_t(1) << p_which); diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index 447c3382a24..6789d46f74f 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -289,7 +289,7 @@ void RasterizerGLES3::set_boot_image(const Ref &p_image, const Color &p_c canvas->canvas_begin(); RID texture = storage->texture_create(); - storage->texture_allocate(texture, p_image->get_width(), p_image->get_height(), 0, p_image->get_format(), VS::TEXTURE_TYPE_2D, p_use_filter ? VS::TEXTURE_FLAG_FILTER : 0); + storage->texture_allocate(texture, p_image->get_width(), p_image->get_height(), 0, p_image->get_format(), VS::TEXTURE_TYPE_2D, p_use_filter ? (uint32_t)VS::TEXTURE_FLAG_FILTER : 0); storage->texture_set_data(texture, p_image); Rect2 imgrect(0, 0, p_image->get_width(), p_image->get_height());