From df8fa90a3494e8853159a4d3d810bcecca13bb36 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 30 Mar 2019 11:15:49 +0200 Subject: [PATCH] - fixed compilation warnings reported by Clang src/rendering/vulkan/renderer/vk_renderpass.cpp:44:22: warning: comparison of integers of different signs: 'std::__1::vector >::size_type' (aka 'unsigned long') and 'int' [-Wsign-compare] src/rendering/vulkan/system/vk_framebuffer.cpp:860:55: warning: format specifies type 'int' but the argument has type 'VkDeviceSize' (aka 'unsigned long long') [-Wformat] src/rendering/vulkan/system/vk_objects.h:471:23: warning: suggest braces around initialization of subobject [-Wmissing-braces] --- src/rendering/vulkan/renderer/vk_renderpass.cpp | 2 +- src/rendering/vulkan/system/vk_framebuffer.cpp | 2 +- src/rendering/vulkan/system/vk_objects.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rendering/vulkan/renderer/vk_renderpass.cpp b/src/rendering/vulkan/renderer/vk_renderpass.cpp index 4c0a65d73..4e91efab1 100644 --- a/src/rendering/vulkan/renderer/vk_renderpass.cpp +++ b/src/rendering/vulkan/renderer/vk_renderpass.cpp @@ -41,7 +41,7 @@ int VkRenderPassManager::GetVertexFormat(int numBindingPoints, int numAttributes for (size_t i = 0; i < VertexFormats.size(); i++) { const auto &f = VertexFormats[i]; - if (f.Attrs.size() == numAttributes && f.NumBindingPoints == numBindingPoints && f.Stride == stride) + if (f.Attrs.size() == (size_t)numAttributes && f.NumBindingPoints == numBindingPoints && f.Stride == stride) { bool matches = true; for (int j = 0; j < numAttributes; j++) diff --git a/src/rendering/vulkan/system/vk_framebuffer.cpp b/src/rendering/vulkan/system/vk_framebuffer.cpp index 30ba16f45..41b618f69 100644 --- a/src/rendering/vulkan/system/vk_framebuffer.cpp +++ b/src/rendering/vulkan/system/vk_framebuffer.cpp @@ -857,7 +857,7 @@ void VulkanFrameBuffer::PrintStartupLog() const auto &limits = props.limits; Printf("Max. texture size: %d\n", limits.maxImageDimension2D); Printf("Max. uniform buffer range: %d\n", limits.maxUniformBufferRange); - Printf("Min. uniform buffer offset alignment: %d\n", limits.minUniformBufferOffsetAlignment); + Printf("Min. uniform buffer offset alignment: %llu\n", limits.minUniformBufferOffsetAlignment); } void VulkanFrameBuffer::CreateFanToTrisIndexBuffer() diff --git a/src/rendering/vulkan/system/vk_objects.h b/src/rendering/vulkan/system/vk_objects.h index 275508b0a..d12cf8614 100644 --- a/src/rendering/vulkan/system/vk_objects.h +++ b/src/rendering/vulkan/system/vk_objects.h @@ -468,7 +468,7 @@ inline void RenderPassBegin::setFramebuffer(VulkanFramebuffer *framebuffer) inline void RenderPassBegin::addClearColor(float r, float g, float b, float a) { VkClearValue clearValue = { }; - clearValue.color = { r, g, b, a }; + clearValue.color = { {r, g, b, a} }; clearValues.push_back(clearValue); renderPassInfo.clearValueCount = (uint32_t)clearValues.size();