Fix a few warnings
authorPyry Haulos <phaulos@google.com>
Sat, 12 Dec 2015 00:38:04 +0000 (16:38 -0800)
committerPyry Haulos <phaulos@google.com>
Sat, 12 Dec 2015 00:38:04 +0000 (16:38 -0800)
Change-Id: I610d4a27f49298c46f848666b0654209138d272d

external/vulkancts/modules/vulkan/memory/vktMemoryAllocationTests.cpp
external/vulkancts/modules/vulkan/shaderrender/vktShaderRender.cpp
external/vulkancts/modules/vulkan/shaderrender/vktShaderRender.hpp
external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderMatrixTests.cpp

index 7e8d642..1ad6702 100644 (file)
@@ -566,7 +566,7 @@ tcu::TestCaseGroup* createAllocationTests (tcu::TestContext& testCtx)
                                {
                                        const int allocationCount = allocationCounts[allocationCountNdx];
 
-                                       if (allocationCount != -1 && allocationCount * allocationPercent > 0.25f)
+                                       if ((allocationCount != -1) && ((float)allocationCount * allocationPercent > 0.25f))
                                                continue;
 
                                        TestConfig config;
index 81bd927..6e062fb 100644 (file)
@@ -517,7 +517,7 @@ tcu::TestStatus ShaderRenderCaseInstance::iterate (void)
                return tcu::TestStatus::fail("Image mismatch");
 }
 
-void ShaderRenderCaseInstance::setupUniformData (deUint32 bindingLocation, deUint32 size, const void* dataPtr)
+void ShaderRenderCaseInstance::setupUniformData (deUint32 bindingLocation, size_t size, const void* dataPtr)
 {
        const VkDevice                                  vkDevice                        = m_context.getDevice();
        const DeviceInterface&                  vk                                      = m_context.getDeviceInterface();
@@ -544,7 +544,7 @@ void ShaderRenderCaseInstance::setupUniformData (deUint32 bindingLocation, deUin
 
        // \todo [2015-10-09 elecro] remove the 'hackPadding' variable if the driver support small uniforms,
        // that is for example one float big uniforms.
-       const deUint32 hackPadding = size < 4 * sizeof(float) ? (deUint32)(3u * sizeof(float)) : 0u;
+       const size_t hackPadding = size < 4 * sizeof(float) ? 3 * sizeof(float) : 0;
 
        de::MovePtr<BufferUniform> uniformInfo(new BufferUniform());
        uniformInfo->type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
@@ -556,7 +556,7 @@ void ShaderRenderCaseInstance::setupUniformData (deUint32 bindingLocation, deUin
        m_uniformInfos.push_back(UniformInfoSp(new de::UniquePtr<UniformInfo>(uniformInfo)));
 }
 
-void ShaderRenderCaseInstance::addUniform (deUint32 bindingLocation, vk::VkDescriptorType descriptorType, deUint32 dataSize, const void* data)
+void ShaderRenderCaseInstance::addUniform (deUint32 bindingLocation, vk::VkDescriptorType descriptorType, size_t dataSize, const void* data)
 {
        m_descriptorSetLayoutBuilder.addSingleBinding(descriptorType, vk::VK_SHADER_STAGE_ALL);
        m_descriptorPoolBuilder.addType(descriptorType);
index 6df46d9..3368fa3 100644 (file)
@@ -398,7 +398,7 @@ public:
                                                                                                                                                                        const T&                                data);
        void                                                                                            addUniform                                      (deUint32                               bindingLocation,
                                                                                                                                                                        vk::VkDescriptorType    descriptorType,
-                                                                                                                                                                       deUint32                                dataSize,
+                                                                                                                                                                       size_t                                  dataSize,
                                                                                                                                                                        const void*                             data);
        void                                                                                            useUniform                                      (deUint32                               bindingLocation,
                                                                                                                                                                        BaseUniformType                 type);
@@ -431,7 +431,7 @@ private:
                                                                                                                                                                         deInt32                                                width,
                                                                                                                                                                         deInt32                                                height);
 
-       void                                                                                            setupUniformData                        (deUint32 bindingLocation, deUint32 size, const void* dataPtr);
+       void                                                                                            setupUniformData                        (deUint32 bindingLocation, size_t size, const void* dataPtr);
        void                                                                                            setupDefaultInputs                      (const QuadGrid& quadGrid);
 
        void                                                                                            render                                          (tcu::Surface& result, const QuadGrid& quadGrid);
index dba861e..2d325f3 100644 (file)
@@ -1508,8 +1508,8 @@ ShaderMatrixInstance::~ShaderMatrixInstance (void)
 
 void ShaderMatrixInstance::addMatrixUniform(deUint32 bindingLocation, DataType dataType, const float *dataPtr)
 {
-       Mat4 result;
-       const deUint32 matrixSize = sizeof(float) * 4 *4 ;
+       Mat4                    result;
+       const size_t    matrixSize = sizeof(float) * 4 * 4;
 
        switch(dataType)
        {