[Piglit] [PATCH 09/11] max-texture-size: Change variable to uint64_t rather than casting.

Kenneth Graunke kenneth at whitecape.org
Sun Feb 2 03:13:57 PST 2014


Every single usage of this variable cast it to uint64_t.  Clearly the
function parameter should be uint64_t, and we should have the compiler
automatically convert values when passed in.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 tests/texturing/max-texture-size.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/tests/texturing/max-texture-size.c b/tests/texturing/max-texture-size.c
index 3c95ffb..63c038f 100644
--- a/tests/texturing/max-texture-size.c
+++ b/tests/texturing/max-texture-size.c
@@ -137,20 +137,17 @@ isValidTexSize(GLenum target, GLenum internalFormat, int sideLength)
 }
 
 static GLfloat *
-initTexData (GLenum target, int sideLength)
+initTexData(GLenum target, uint64_t sideLength)
 {
 	uint64_t nPixels;
 	if (target == GL_TEXTURE_1D)
-		nPixels = (uint64_t)(sideLength);
+		nPixels = sideLength;
 	else if (target == GL_TEXTURE_2D ||
 		 target == GL_TEXTURE_RECTANGLE ||
 		 target == GL_TEXTURE_CUBE_MAP)
-		nPixels = (uint64_t)(sideLength) *
-			  (uint64_t)(sideLength);
+		nPixels = sideLength * sideLength;
 	else if (target == GL_TEXTURE_3D)
-		nPixels = (uint64_t)(sideLength) *
-			  (uint64_t)(sideLength) *
-			  (uint64_t)(sideLength);
+		nPixels = sideLength * sideLength * sideLength;
 	else {
 		assert(!"Unexpected target");
 		return NULL;
-- 
1.8.5.2



More information about the Piglit mailing list