[Piglit] [PATCH] gl-2.0: Remove unused variable.

Alejandro Piñeiro apinheiro at igalia.com
Wed Nov 23 10:49:07 UTC 2016


Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>

On 22/11/16 22:32, Vinson Lee wrote:
> Fix GCC maybe-uninitialized warning.
>
> vertexattribpointer-size-3.c: In function ‘piglit_display’:
> vertexattribpointer-size-3.c:243:11: warning: ‘size’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>     pass = test_array(types[t], size, normalized)
>            ^
>
> Fixes: 65e68a7ae42b ("Add gl-2.0/vertexattribpointer-size-3 test")
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  tests/spec/gl-2.0/vertexattribpointer-size-3.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tests/spec/gl-2.0/vertexattribpointer-size-3.c b/tests/spec/gl-2.0/vertexattribpointer-size-3.c
> index d98946af9213..f886d4d3c8df 100644
> --- a/tests/spec/gl-2.0/vertexattribpointer-size-3.c
> +++ b/tests/spec/gl-2.0/vertexattribpointer-size-3.c
> @@ -76,10 +76,10 @@ static GLint ToleranceUniform, ExpectedUniform, AttrAttrib;
>  
>  
>  /*
> - * Test glVertexAttribArray(type, size, normalized)
> + * Test glVertexAttribArray(type, normalized)
>   */
>  static bool
> -test_array(GLenum type, GLuint size, GLboolean normalized)
> +test_array(GLenum type, GLboolean normalized)
>  {
>  	static const GLfloat verts[4][2] = {
>  		{ -1.0, -1.0 },
> @@ -236,11 +236,11 @@ piglit_display(void)
>  		GL_FLOAT,
>  	};
>  	bool pass = true;
> -	int t, size, normalized;
> +	int t, normalized;
>  
>  	for (t = 0; t < ARRAY_SIZE(types); t++) {
>  		for (normalized = 0; normalized < (types[t] == GL_FLOAT ? 1 : 2); normalized++) {
> -			pass = test_array(types[t], size, normalized)
> +			pass = test_array(types[t], normalized)
>  				&& pass;
>  		}
>  	}



More information about the Piglit mailing list