From: Michel Zou Date: Thu, 13 Apr 2023 17:03:56 +0000 (+0200) Subject: vulkan/wsi: fix -Wnarrowing warning X-Git-Tag: upstream/23.3.3~9745 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5871d21a5d16d7fad334ad9ee24402c9d70ea1b;p=platform%2Fupstream%2Fmesa.git 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: --- 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 &