From d5871d21a5d16d7fad334ad9ee24402c9d70ea1b Mon Sep 17 00:00:00 2001 From: Michel Zou Date: Thu, 13 Apr 2023 19:03:56 +0200 Subject: [PATCH] vulkan/wsi: fix -Wnarrowing warning else I get this output: [11/600] Compiling C++ object src/vulkan/wsi/libvulkan_wsi.a.p/wsi_common_win32.cpp.obj ../src/vulkan/wsi/wsi_common_win32.cpp: In function 'VkResult wsi_win32_surface_create_swapchain_dxgi(wsi_win32_surface*, VkDevice, wsi_win32*, const VkSwapchainCreateInfoKHR*, wsi_win32_swapchain*)': ../src/vulkan/wsi/wsi_common_win32.cpp:757:65: warning: narrowing conversion of '((((int)chain->wsi_win32_swapchain::base.wsi_swapchain::present_mode) == ((int)VK_PRESENT_MODE_IMMEDIATE_KHR)) ? ((int)DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING) : 0)' from 'int' to 'UINT' {aka 'unsigned int'} [-Wnarrowing] 757 | chain->base.present_mode == VK_PRESENT_MODE_IMMEDIATE_KHR ? | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ 758 | DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fixes: d7730fcf22adae92b0e7a82e36cfe28200920b5f Reviewed-by: Jesse Natalie Part-of: --- src/vulkan/wsi/wsi_common_win32.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_win32.cpp b/src/vulkan/wsi/wsi_common_win32.cpp index 0456666..329e587 100644 --- a/src/vulkan/wsi/wsi_common_win32.cpp +++ b/src/vulkan/wsi/wsi_common_win32.cpp @@ -755,7 +755,7 @@ wsi_win32_surface_create_swapchain_dxgi( DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL, DXGI_ALPHA_MODE_UNSPECIFIED, chain->base.present_mode == VK_PRESENT_MODE_IMMEDIATE_KHR ? - DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0 + DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0u }; if (create_info->imageUsage & -- 2.7.4