From b2153068ca8cf27c630b0d88f00c2374361316d8 Mon Sep 17 00:00:00 2001 From: Pyry Haulos Date: Thu, 19 May 2016 10:39:50 -0700 Subject: [PATCH] Fix various compiler warnings --- .../modules/vulkan/rasterization/vktRasterizationTests.cpp | 4 ++-- .../vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp | 5 ++--- framework/common/tcuRasterizationVerifier.cpp | 12 ++++++------ modules/egl/teglMutableRenderBufferTests.cpp | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp b/external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp index 3ce3290..fdbf547 100644 --- a/external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp +++ b/external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp @@ -719,8 +719,8 @@ void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std: { 0.0f, // float originX; 0.0f, // float originY; - m_renderSize, // float width; - m_renderSize, // float height; + (float)m_renderSize, // float width; + (float)m_renderSize, // float height; 0.0f, // float minDepth; 1.0f // float maxDepth; }; diff --git a/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp b/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp index c6ccae5..12e2e86 100644 --- a/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp +++ b/external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp @@ -341,7 +341,7 @@ vector generateSwapchainParameterCases (Type ws { const PlatformProperties& platformProperties = getPlatformProperties(wsiType); vector cases; - const VkSurfaceTransformFlagBitsKHR transform = (capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) ? VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : capabilities.currentTransform; + const VkSurfaceTransformFlagBitsKHR defaultTransform = (capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) ? VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR : capabilities.currentTransform; const VkSwapchainCreateInfoKHR baseParameters = { VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, @@ -358,7 +358,7 @@ vector generateSwapchainParameterCases (Type ws VK_SHARING_MODE_EXCLUSIVE, 0u, (const deUint32*)DE_NULL, - transform, + defaultTransform, VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR, VK_PRESENT_MODE_FIFO_KHR, VK_FALSE, // clipped @@ -1238,7 +1238,6 @@ void TriangleRenderer::recordFrame (VkCommandBuffer cmdBuffer, deUint32 imageNdx, deUint32 frameNdx) const { - const VkImage curImage = m_swapchainImages[imageNdx]; const VkFramebuffer curFramebuffer = **m_framebuffers[imageNdx]; { diff --git a/framework/common/tcuRasterizationVerifier.cpp b/framework/common/tcuRasterizationVerifier.cpp index 77df56c..56a9bb7 100644 --- a/framework/common/tcuRasterizationVerifier.cpp +++ b/framework/common/tcuRasterizationVerifier.cpp @@ -879,20 +879,20 @@ void applyClippingBox (tcu::Vec2 line[2], float w) { const int sign = ((side / 2) * -2) + 1; const int component = side % 2; - const float t = calculateIntersectionParameter(line, w * sign, component); + const float t = calculateIntersectionParameter(line, w * (float)sign, component); - if (t > 0 && t < 1) + if ((t > 0) && (t < 1)) { - float newCoord = t * line[1][1 - component] + (1 - t) * line[0][1 - component]; + const float newCoord = t * line[1][1 - component] + (1 - t) * line[0][1 - component]; - if (line[1][component] > w * sign) + if (line[1][component] > (w * (float)sign)) { - line[1 - side / 2][component] = w * sign; + line[1 - side / 2][component] = w * (float)sign; line[1 - side / 2][1 - component] = newCoord; } else { - line[side / 2][component] = w * sign; + line[side / 2][component] = w * (float)sign; line[side / 2][1 - component] = newCoord; } } diff --git a/modules/egl/teglMutableRenderBufferTests.cpp b/modules/egl/teglMutableRenderBufferTests.cpp index 2fd036b..934a18a 100644 --- a/modules/egl/teglMutableRenderBufferTests.cpp +++ b/modules/egl/teglMutableRenderBufferTests.cpp @@ -179,7 +179,7 @@ void MutableRenderBufferTest::deinit (void) deUint32 MutableRenderBufferTest::drawAndSwap (const Library& egl, deUint32 color, bool flush) { DE_ASSERT(color < 256); - m_gl.clearColor(color/255.f, color/255.f, color/255.f, color/255.f); + m_gl.clearColor((float)color/255.f, (float)color/255.f, (float)color/255.f, (float)color/255.f); m_gl.clear(GL_COLOR_BUFFER_BIT); if (flush) { -- 2.7.4