Fix -Wconversion warnings in buffer test util.
authorJarkko Pöyry <jpoyry@google.com>
Fri, 22 May 2015 03:12:00 +0000 (20:12 -0700)
committerJarkko Pöyry <jpoyry@google.com>
Fri, 22 May 2015 18:13:21 +0000 (11:13 -0700)
Bug: 21161908

Change-Id: Ie092de2b1559ea2f44d745985ecd37bfb20fa7fe

modules/gles2/functional/es2fBufferTestUtil.cpp

index a94025b..59360d3 100644 (file)
@@ -319,10 +319,10 @@ static void computePositions (vector<tcu::Vec2>& positions, int gridSizeX, int g
        for (int y = 0; y < gridSizeY; y++)
        for (int x = 0; x < gridSizeX; x++)
        {
-               float   sx0                     = (x+0) / (float)gridSizeX;
-               float   sy0                     = (y+0) / (float)gridSizeY;
-               float   sx1                     = (x+1) / (float)gridSizeX;
-               float   sy1                     = (y+1) / (float)gridSizeY;
+               float   sx0                     = (float)(x+0) / (float)gridSizeX;
+               float   sy0                     = (float)(y+0) / (float)gridSizeY;
+               float   sx1                     = (float)(x+1) / (float)gridSizeX;
+               float   sy1                     = (float)(y+1) / (float)gridSizeY;
                float   fx0                     = 2.0f * sx0 - 1.0f;
                float   fy0                     = 2.0f * sy0 - 1.0f;
                float   fx1                     = 2.0f * sx1 - 1.0f;
@@ -388,8 +388,8 @@ static void renderQuadGridReference (tcu::Surface& dst, int numQuads, int rowLen
                for (int y = 0; y < VERIFY_QUAD_SIZE; y++)
                for (int x = 0; x < VERIFY_QUAD_SIZE; x++)
                {
-                       float           fx              = (float)(x+0.5f) / (float)VERIFY_QUAD_SIZE;
-                       float           fy              = (float)(y+0.5f) / (float)VERIFY_QUAD_SIZE;
+                       float           fx              = ((float)x+0.5f) / (float)VERIFY_QUAD_SIZE;
+                       float           fy              = ((float)y+0.5f) / (float)VERIFY_QUAD_SIZE;
 
                        bool            tri             = fx + fy <= 1.0f;
                        float           tx              = tri ? fx : (1.0f-fx);