[Piglit] [PATCH] fbo-generatemipmap-formats: Fix uninitialized variable warnings.

Vinson Lee vlee at freedesktop.org
Tue Dec 24 15:57:45 PST 2013


Fix GCC maybe-uninitialized warnings.

fbo-generatemipmap-formats.c: In function 'test_format':
fbo-generatemipmap-formats.c:112:15: warning: 'format' may be used uninitialized in this function [-Wmaybe-uninitialized]
   glTexImage2D(GL_TEXTURE_2D, i, internalformat,
               ^
fbo-generatemipmap-formats.c:80:15: note: 'format' was declared here
  GLenum type, format;
               ^
fbo-generatemipmap-formats.c:112:15: warning: 'type' may be used uninitialized in this function [-Wmaybe-uninitialized]
   glTexImage2D(GL_TEXTURE_2D, i, internalformat,
               ^
fbo-generatemipmap-formats.c:80:9: note: 'type' was declared here
  GLenum type, format;
         ^

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/fbo/fbo-generatemipmap-formats.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/fbo/fbo-generatemipmap-formats.c b/tests/fbo/fbo-generatemipmap-formats.c
index d0a738c..666030f 100644
--- a/tests/fbo/fbo-generatemipmap-formats.c
+++ b/tests/fbo/fbo-generatemipmap-formats.c
@@ -94,6 +94,8 @@ create_tex(GLenum internalformat, GLenum baseformat, GLenum basetype)
 			type = GL_FLOAT;
 		} else {
 			assert(0);
+			format = GL_NONE;
+			type = GL_NONE;
 		}
 	} else {
 		tex = piglit_rgbw_texture(internalformat,
-- 
1.8.5.2



More information about the Piglit mailing list