From fc08cb17f98a082979cbd9b3959ba067cbbe4536 Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Fri, 2 Jul 2021 08:29:35 +0100 Subject: [PATCH] Fix VS2019 compiler warnings in demos solution --- util/test/demos/test_common.h | 2 +- util/test/demos/vk/vk_descriptor_reuse.cpp | 4 ++-- util/test/demos/vk/vk_overlay_test.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/util/test/demos/test_common.h b/util/test/demos/test_common.h index e25eb360f..96e6d5cd5 100644 --- a/util/test/demos/test_common.h +++ b/util/test/demos/test_common.h @@ -104,7 +104,7 @@ public: return Vec3f(y * o.z - z * o.y, z * o.x - x * o.z, x * o.y - y * o.x); } - inline float Length() const { return sqrt(Dot(*this)); } + inline float Length() const { return sqrtf(Dot(*this)); } inline void Normalise() { float l = Length(); diff --git a/util/test/demos/vk/vk_descriptor_reuse.cpp b/util/test/demos/vk/vk_descriptor_reuse.cpp index e5b744e95..cbfa95620 100644 --- a/util/test/demos/vk/vk_descriptor_reuse.cpp +++ b/util/test/demos/vk/vk_descriptor_reuse.cpp @@ -364,8 +364,8 @@ void main() vkh::cmdBindVertexBuffers(cmd, 0, {vb.buffer}, {0}); VkRect2D s = {{0, 0}, - {uint32_t(screenWidth / (int)sqrt(descriptorCount)), - uint32_t(screenHeight / (int)sqrt(descriptorCount))}}; + {uint32_t(screenWidth / (int)sqrtf((float)descriptorCount)), + uint32_t(screenHeight / (int)sqrtf((float)descriptorCount))}}; VkViewport v = {0, 0, (float)s.extent.width, (float)s.extent.height, 0, 1}; size_t randSeed = curFrame * threadIndex + threadIndex; diff --git a/util/test/demos/vk/vk_overlay_test.cpp b/util/test/demos/vk/vk_overlay_test.cpp index 0375bb770..54e239083 100644 --- a/util/test/demos/vk/vk_overlay_test.cpp +++ b/util/test/demos/vk/vk_overlay_test.cpp @@ -552,8 +552,8 @@ void main() v = mainWindow->viewport; v.width /= 8.0f; v.height /= 8.0f; - v.width = floor(v.width); - v.height = floor(v.height); + v.width = floorf(v.width); + v.height = floorf(v.height); v.x += 2.0f; v.y += 2.0f; v.width -= 4.0f;