This MR fixes remaining Clang warnings related to enums for vkd3d in Wine tree, both in mingw and msvc mode.
-- v2: configure: Enable -Wenum-conversion warnings. gitlab: Remove no longer needed -Wno-enum-conversion from build-mac.
From: Jacek Caban jacek@codeweavers.com
--- libs/vkd3d/command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 77d0f2751..15c8317b1 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -6852,7 +6852,7 @@ fail: static HRESULT d3d12_command_queue_wait_binary_semaphore_locked(struct d3d12_command_queue *command_queue, struct d3d12_fence *fence, uint64_t value) { - static const VkPipelineStageFlagBits wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + static const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; const struct vkd3d_vk_device_procs *vk_procs; struct vkd3d_signaled_semaphore *semaphore; uint64_t completed_value = 0; @@ -6948,7 +6948,7 @@ fail: static HRESULT d3d12_command_queue_wait_locked(struct d3d12_command_queue *command_queue, struct d3d12_fence *fence, uint64_t value) { - static const VkPipelineStageFlagBits wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; + static const VkPipelineStageFlags wait_stage_mask = VK_PIPELINE_STAGE_ALL_COMMANDS_BIT; VkTimelineSemaphoreSubmitInfoKHR timeline_submit_info; const struct vkd3d_vk_device_procs *vk_procs; struct vkd3d_queue *queue;
From: Jacek Caban jacek@codeweavers.com
--- libs/vkd3d-shader/dxil.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index ca7e0e723..17c9082a8 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -4498,8 +4498,7 @@ static enum vkd3d_result sm6_parser_resources_init(struct sm6_parser *sm6) static void signature_element_read_additional_element_values(struct signature_element *e, const struct sm6_metadata_node *node, struct sm6_parser *sm6) { - unsigned int i, operand_count, value; - enum dxil_element_additional_tag tag; + unsigned int i, operand_count, value, tag;
if (node->operand_count < 11 || !node->operands[10]) return; @@ -4857,8 +4856,7 @@ static enum vkd3d_result sm6_parser_entry_point_init(struct sm6_parser *sm6) { const struct sm6_metadata_value *m = sm6_parser_find_named_metadata(sm6, "dx.entryPoints"); const struct sm6_metadata_node *node, *entry_node = m ? m->u.node : NULL; - enum dxil_shader_properties_tag tag; - unsigned int i, operand_count; + unsigned int i, operand_count, tag; const struct sm6_value *value; enum vkd3d_result ret;
From: Jacek Caban jacek@codeweavers.com
--- libs/vkd3d-shader/hlsl_codegen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 5a70878bc..294a8156b 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -4089,7 +4089,7 @@ static void allocate_semantic_register(struct hlsl_ctx *ctx, struct hlsl_ir_var [VKD3D_SHADER_TYPE_COMPUTE] = "Compute", };
- unsigned int type; + enum vkd3d_shader_register_type type; uint32_t reg; bool builtin;
@@ -4097,6 +4097,7 @@ static void allocate_semantic_register(struct hlsl_ctx *ctx, struct hlsl_ir_var
if (ctx->profile->major_version < 4) { + D3DSHADER_PARAM_REGISTER_TYPE sm1_type; D3DDECLUSAGE usage; uint32_t usage_idx;
@@ -4104,7 +4105,7 @@ static void allocate_semantic_register(struct hlsl_ctx *ctx, struct hlsl_ir_var if (ctx->profile->major_version == 1 && output && ctx->profile->type == VKD3D_SHADER_TYPE_PIXEL) return;
- builtin = hlsl_sm1_register_from_semantic(ctx, &var->semantic, output, &type, ®); + builtin = hlsl_sm1_register_from_semantic(ctx, &var->semantic, output, &sm1_type, ®); if (!builtin && !hlsl_sm1_usage_from_semantic(&var->semantic, &usage, &usage_idx)) { hlsl_error(ctx, &var->loc, VKD3D_SHADER_ERROR_HLSL_INVALID_SEMANTIC, @@ -4114,6 +4115,7 @@ static void allocate_semantic_register(struct hlsl_ctx *ctx, struct hlsl_ir_var
if ((!output && !var->last_read) || (output && !var->first_write)) return; + type = (enum vkd3d_shader_register_type)sm1_type; } else {
From: Jacek Caban jacek@codeweavers.com
--- gitlab/build-mac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gitlab/build-mac b/gitlab/build-mac index 27c70d316..17a8c7a0d 100755 --- a/gitlab/build-mac +++ b/gitlab/build-mac @@ -11,7 +11,7 @@ set -Eeuxo pipefail rm -fr build mkdir build cd build -if ../configure CFLAGS="-g -O2 -Wno-implicit-fallthrough -Wno-enum-conversion -Werror" && \ +if ../configure CFLAGS="-g -O2 -Wno-implicit-fallthrough -Werror" && \ make -j$(sysctl -n hw.ncpu) ; then make -j$(sysctl -n hw.ncpu) check || \ touch ../tests_failed
From: Jacek Caban jacek@codeweavers.com
--- configure.ac | 1 + 1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac index 3f6e6b789..44263fc72 100644 --- a/configure.ac +++ b/configure.ac @@ -64,6 +64,7 @@ AS_IF([test "x${GCC}" = "xyes"], VKD3D_CHECK_CFLAGS([-Wunused-but-set-parameter]) VKD3D_CHECK_CFLAGS([-Wvla]) VKD3D_CHECK_CFLAGS([-Wpointer-arith]) + VKD3D_CHECK_CFLAGS([-Wenum-conversion]) VKD3D_CHECK_CFLAGS([-Wl,--no-undefined])])
dnl Check for cross compilers
On Mon Nov 27 15:02:56 2023 +0000, Giovanni Mascellani wrote:
I think you should be able to remove `-Wno-enum-conversion` from `gitlab/build-mac`. I guess `-Wno-implicit-fallthrough` is still needed, though.
Yes. We can also enable -Wenum-conversion on GCC to catch problems earlier.
This merge request was approved by Henri Verbeet.