From 7975908caf06d5a8c664428b2d14f2a9067e52e8 Mon Sep 17 00:00:00 2001 From: Maged Elnaggar Date: Mon, 5 Jan 2026 11:48:08 +0000 Subject: [PATCH] Fix build warning created by "Add -Wshadow -Wconversion" Signed-off-by: Maged Elnaggar --- wsi/extensions/present_timing.cpp | 6 +++--- wsi/extensions/present_timing.hpp | 2 +- wsi/headless/present_timing_handler.cpp | 2 +- wsi/headless/swapchain.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wsi/extensions/present_timing.cpp b/wsi/extensions/present_timing.cpp index 6427c96..9c670e3 100644 --- a/wsi/extensions/present_timing.cpp +++ b/wsi/extensions/present_timing.cpp @@ -168,9 +168,9 @@ VkResult wsi_ext_present_timing::write_pending_results() } uint64_t timestamp; - VkResult res = m_device.disp.GetQueryPoolResults(m_device.device, m_queue_family_resources.m_query_pool, - slot.m_image_index, 1, sizeof(timestamp), ×tamp, 0, - VK_QUERY_RESULT_64_BIT); + VkResult res = m_device.disp.GetQueryPoolResults( + m_device.device, m_queue_family_resources.m_query_pool, slot.m_image_index, 1u, sizeof(timestamp), + ×tamp, static_cast(0), static_cast(VK_QUERY_RESULT_64_BIT)); if (res != VK_SUCCESS && res != VK_NOT_READY) { return res; diff --git a/wsi/extensions/present_timing.hpp b/wsi/extensions/present_timing.hpp index 37aed0e..a7a860b 100644 --- a/wsi/extensions/present_timing.hpp +++ b/wsi/extensions/present_timing.hpp @@ -380,7 +380,7 @@ public: for (uint32_t image_index = 0; image_index < num_images; image_index++) { TRY_LOG_CALL(m_device.disp.BeginCommandBuffer(m_command_buffer[image_index], &begin_info)); - m_device.disp.CmdResetQueryPool(m_command_buffer[image_index], m_query_pool, image_index, 1); + m_device.disp.CmdResetQueryPool(m_command_buffer[image_index], m_query_pool, image_index, 1u); m_device.disp.CmdWriteTimestamp(m_command_buffer[image_index], VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, m_query_pool, image_index); TRY_LOG_CALL(m_device.disp.EndCommandBuffer(m_command_buffer[image_index])); diff --git a/wsi/headless/present_timing_handler.cpp b/wsi/headless/present_timing_handler.cpp index ff2be8d..9bd9d83 100644 --- a/wsi/headless/present_timing_handler.cpp +++ b/wsi/headless/present_timing_handler.cpp @@ -154,7 +154,7 @@ std::optional wsi_ext_present_timing_headless::get_current_clock_time_ return std::nullopt; } - return now.tv_sec * static_cast(1e9) + now.tv_nsec; + return static_cast(now.tv_sec) * static_cast(1e9) + static_cast(now.tv_nsec); } std::optional wsi_ext_present_timing_headless::get_first_pixel_visible_timestamp_for_last_image() const diff --git a/wsi/headless/swapchain.cpp b/wsi/headless/swapchain.cpp index 566c49e..e7b93b6 100644 --- a/wsi/headless/swapchain.cpp +++ b/wsi/headless/swapchain.cpp @@ -208,7 +208,7 @@ void swapchain::present_image(const pending_present_request &pending_present) * This is OK as the sleep should only be dispatched on the page_flip thread and not on main. */ assert(m_page_flip_thread_run); - int64_t time_diff = absolute_future_present_time_ns - *current_time_ns; + int64_t time_diff = static_cast(absolute_future_present_time_ns - *current_time_ns); std::this_thread::sleep_for(std::chrono::nanoseconds(time_diff)); } }