[Piglit] [PATCH] tex3d-maxsize: Silence uninitialized variable warnings.

Vinson Lee vlee at freedesktop.org
Fri Jan 17 17:11:25 PST 2014


This patch fixes these GCC maybe-uninitialized warnings.

tex3d-maxsize.c: In function 'piglit_display':
tex3d-maxsize.c:123:15: warning: 'depth' may be used uninitialized in this function [-Wmaybe-uninitialized]
   glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA8, width, height, depth, 0,
               ^
tex3d-maxsize.c:123:15: warning: 'height' may be used uninitialized in this function [-Wmaybe-uninitialized]
tex3d-maxsize.c:123:15: warning: 'width' may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/texturing/tex3d-maxsize.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/texturing/tex3d-maxsize.c b/tests/texturing/tex3d-maxsize.c
index ae3aa10..9edc6ed 100644
--- a/tests/texturing/tex3d-maxsize.c
+++ b/tests/texturing/tex3d-maxsize.c
@@ -118,6 +118,7 @@ piglit_display(void)
 	if (err == GL_OUT_OF_MEMORY) {
 
 		/* use proxy texture to find working max texture size */
+		width = height = depth = 0;
 		find_max_tex3d_size(maxsize, &width, &height, &depth);
 
 		glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA8, width, height, depth, 0,
-- 
1.8.4.2



More information about the Piglit mailing list