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

Brian Paul brianp at vmware.com
Mon Jan 6 12:21:04 PST 2014


On 12/24/2013 04:57 PM, Vinson Lee wrote:
> 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,
>

Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the Piglit mailing list