From 0d4aebd2e7fec4fe42a015d514ec45f5a364dfa3 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Fri, 20 Oct 2023 15:01:35 +0200 Subject: [PATCH] vkd3d-shader: Explicitly cast vkd3d_shader_global_flags to uint64_t. On macOS vkd3d_shader_global_flags has underlying type unsigned long, while uint64_t is defined as unsigned long long. This difference causes a few warnings to be raised. --- libs/vkd3d-shader/d3d_asm.c | 2 +- libs/vkd3d-shader/dxil.c | 2 +- libs/vkd3d-shader/spirv.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/vkd3d-shader/d3d_asm.c b/libs/vkd3d-shader/d3d_asm.c index eae7e6b7..e01b607a 100644 --- a/libs/vkd3d-shader/d3d_asm.c +++ b/libs/vkd3d-shader/d3d_asm.c @@ -419,7 +419,7 @@ static void shader_dump_global_flags(struct vkd3d_d3d_asm_compiler *compiler, } if (global_flags) - vkd3d_string_buffer_printf(&compiler->buffer, "unknown_flags(%#"PRIx64")", global_flags); + vkd3d_string_buffer_printf(&compiler->buffer, "unknown_flags(%#"PRIx64")", (uint64_t)global_flags); } static void shader_dump_sync_flags(struct vkd3d_d3d_asm_compiler *compiler, uint32_t sync_flags) diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 94f5b862..213f8703 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -4150,7 +4150,7 @@ static void sm6_parser_emit_global_flags(struct sm6_parser *sm6, const struct sm enum vkd3d_shader_global_flags global_flags, mask, rotated_flags; struct vkd3d_shader_instruction *ins; - if (!sm6_metadata_get_uint64_value(sm6, m, &global_flags)) + if (!sm6_metadata_get_uint64_value(sm6, m, (uint64_t*)&global_flags)) { WARN("Failed to load global flags.\n"); vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_INVALID_PROPERTIES, diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index aa037b62..42f1aabc 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -5425,9 +5425,9 @@ static void spirv_compiler_emit_dcl_global_flags(struct spirv_compiler *compiler } if (flags & ~(VKD3DSGF_REFACTORING_ALLOWED | VKD3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS)) - FIXME("Unhandled global flags %#"PRIx64".\n", flags); + FIXME("Unhandled global flags %#"PRIx64".\n", (uint64_t)flags); else - WARN("Unhandled global flags %#"PRIx64".\n", flags); + WARN("Unhandled global flags %#"PRIx64".\n", (uint64_t)flags); } static void spirv_compiler_emit_temps(struct spirv_compiler *compiler, uint32_t count)