Fix various compiler warnings
authorPyry Haulos <phaulos@google.com>
Thu, 19 May 2016 17:39:50 +0000 (10:39 -0700)
committerPyry Haulos <phaulos@google.com>
Thu, 19 May 2016 17:39:50 +0000 (10:39 -0700)
external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp
external/vulkancts/modules/vulkan/wsi/vktWsiSwapchainTests.cpp
framework/common/tcuRasterizationVerifier.cpp
modules/egl/teglMutableRenderBufferTests.cpp

index 3ce3290..fdbf547 100644 (file)
@@ -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;
                };
index c6ccae5..12e2e86 100644 (file)
@@ -341,7 +341,7 @@ vector<VkSwapchainCreateInfoKHR> generateSwapchainParameterCases (Type                                                              ws
 {
        const PlatformProperties&                       platformProperties      = getPlatformProperties(wsiType);
        vector<VkSwapchainCreateInfoKHR>        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<VkSwapchainCreateInfoKHR> 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];
 
        {
index 77df56c..56a9bb7 100644 (file)
@@ -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;
                        }
                }
index 2fd036b..934a18a 100644 (file)
@@ -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)
        {