summaryrefslogtreecommitdiff
path: root/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-02-18 14:57:11 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-02-18 20:51:25 +0100
commit49fec646cbf3afdf5e7d55589ab359a5ebcdb897 (patch)
treef5e52fb159af51e1e3f4872415fc201c345fbad5 /servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
parente866b4043c0fc14700672713a91ec4a86c667607 (diff)
Fix compilation warnings and re-enable werror=yes on Travis
Fix -Wunused-variable, -Wunused-but-set-variable and -Wswitch warnings raised by GCC 8 and 9. Fix -Wunused-function, -Wunused-private-field and -Wtautological-constant-out-of-range-compare raised by Clang. Fix MSVC 2019 warning C4804 (unsafe use of type 'bool' in comparison operation). GCC -Wcpp warnings/Clang -W#warnings (`#warning`) are no longer raising errors and will thus not abort compilation with `werror=yes`. Treat glslang headers are system headers to avoid raising warnings. Re-enables us to build with `werror=yes` on Linux and macOS, thus catching warnings that would be introduced by new code. Fixes #36132.
Diffstat (limited to 'servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp')
-rw-r--r--servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
index 9f6b1a2b35..09767cb5a9 100644
--- a/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
+++ b/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
@@ -1944,7 +1944,7 @@ int RasterizerStorageRD::mesh_get_blend_shape_count(RID p_mesh) const {
void RasterizerStorageRD::mesh_set_blend_shape_mode(RID p_mesh, VS::BlendShapeMode p_mode) {
Mesh *mesh = mesh_owner.getornull(p_mesh);
ERR_FAIL_COND(!mesh);
- ERR_FAIL_INDEX(p_mode, 2);
+ ERR_FAIL_INDEX((int)p_mode, 2);
mesh->blend_shape_mode = p_mode;
}
@@ -2636,7 +2636,7 @@ void RasterizerStorageRD::multimesh_instance_set_custom_data(RID p_multimesh, in
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND(!multimesh);
ERR_FAIL_INDEX(p_index, multimesh->instances);
- ERR_FAIL_INDEX(p_index, !multimesh->uses_custom_data);
+ ERR_FAIL_COND(!multimesh->uses_custom_data);
_multimesh_make_local(multimesh);
@@ -2723,7 +2723,7 @@ Color RasterizerStorageRD::multimesh_instance_get_color(RID p_multimesh, int p_i
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND_V(!multimesh, Color());
ERR_FAIL_INDEX_V(p_index, multimesh->instances, Color());
- ERR_FAIL_INDEX_V(p_index, !multimesh->uses_colors, Color());
+ ERR_FAIL_COND_V(!multimesh->uses_colors, Color());
_multimesh_make_local(multimesh);
@@ -2746,7 +2746,7 @@ Color RasterizerStorageRD::multimesh_instance_get_custom_data(RID p_multimesh, i
MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh);
ERR_FAIL_COND_V(!multimesh, Color());
ERR_FAIL_INDEX_V(p_index, multimesh->instances, Color());
- ERR_FAIL_INDEX_V(p_index, !multimesh->uses_custom_data, Color());
+ ERR_FAIL_COND_V(!multimesh->uses_custom_data, Color());
_multimesh_make_local(multimesh);