s3tc-errors: Fix GCC unused-variable warning.

Submitted by Vinson Lee on April 22, 2019, 10:59 p.m.

Details

Message ID 20190422225927.3330-1-vlee@freedesktop.org
State New
Headers show
Series "s3tc-errors: Fix GCC unused-variable warning." ( rev: 2 ) in Piglit

Not browsing as part of any series.

Commit Message

Vinson Lee April 22, 2019, 10:59 p.m.
s3tc-errors.c: In function ‘test_format’:
s3tc-errors.c:175:9: warning: unused variable ‘format2’ [-Wunused-variable]
  GLenum format2;
         ^~~~~~~

Fixes: d433792407e7 ("s3tc-errors: port to gles31")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
---
 tests/texturing/s3tc-errors.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/tests/texturing/s3tc-errors.c b/tests/texturing/s3tc-errors.c
index ccc0be9a785f..6b2658c9a1d1 100644
--- a/tests/texturing/s3tc-errors.c
+++ b/tests/texturing/s3tc-errors.c
@@ -171,8 +171,8 @@  test_format(int width, int height, GLfloat *image, GLenum requested_format)
 {
 #ifdef PIGLIT_USE_OPENGL
 	GLubyte *compressed_image;
-#endif
 	GLenum format2;
+#endif
 	int x, y, w, h;
 	GLuint tex;
 	bool pass = true;

Comments

On 04/22/2019 04:59 PM, Vinson Lee wrote:
> s3tc-errors.c: In function ‘test_format’:
> s3tc-errors.c:175:9: warning: unused variable ‘format2’ [-Wunused-variable]
>    GLenum format2;
>           ^~~~~~~
> 
> Fixes: d433792407e7 ("s3tc-errors: port to gles31")
> Signed-off-by: Vinson Lee <vlee@freedesktop.org>
> ---
>   tests/texturing/s3tc-errors.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/texturing/s3tc-errors.c b/tests/texturing/s3tc-errors.c
> index ccc0be9a785f..6b2658c9a1d1 100644
> --- a/tests/texturing/s3tc-errors.c
> +++ b/tests/texturing/s3tc-errors.c
> @@ -171,8 +171,8 @@ test_format(int width, int height, GLfloat *image, GLenum requested_format)
>   {
>   #ifdef PIGLIT_USE_OPENGL
>   	GLubyte *compressed_image;
> -#endif
>   	GLenum format2;
> +#endif
>   	int x, y, w, h;
>   	GLuint tex;
>   	bool pass = true;
> 


Reviewed-by: Brian Paul <brianp@vmware.com>
On Mon, 2019-04-22 at 22:59 +0000, Vinson Lee wrote:
> s3tc-errors.c: In function ‘test_format’:
> s3tc-errors.c:175:9: warning: unused variable ‘format2’ [-Wunused-
> variable]
>   GLenum format2;
>          ^~~~~~~
> 
> Fixes: d433792407e7 ("s3tc-errors: port to gles31")
> Signed-off-by: Vinson Lee <vlee@freedesktop.org>

Looks good, thanks for fixing!

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>

> ---
>  tests/texturing/s3tc-errors.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/texturing/s3tc-errors.c b/tests/texturing/s3tc-
> errors.c
> index ccc0be9a785f..6b2658c9a1d1 100644
> --- a/tests/texturing/s3tc-errors.c
> +++ b/tests/texturing/s3tc-errors.c
> @@ -171,8 +171,8 @@ test_format(int width, int height, GLfloat
> *image, GLenum requested_format)
>  {
>  #ifdef PIGLIT_USE_OPENGL
>  	GLubyte *compressed_image;
> -#endif
>  	GLenum format2;
> +#endif
>  	int x, y, w, h;
>  	GLuint tex;
>  	bool pass = true;