[1/2] fbo: Silence compiler warnings about const mismatches

Submitted by Ian Romanick on Jan. 22, 2019, 9:33 p.m.

Details

Message ID 20190122213311.1806-1-idr@freedesktop.org
State Accepted
Commit 20a342e60a81b03c436cb2dead431536db338447
Headers show
Series "Series without cover letter" ( rev: 1 ) in Piglit

Browsing this patch as part of:
"Series without cover letter" rev 1 in Piglit
<< prev patch [1/2] next patch >>

Commit Message

Ian Romanick Jan. 22, 2019, 9:33 p.m.
From: Ian Romanick <ian.d.romanick@intel.com>

tests/fbo/fbo-blending-format-quirks.c: In function ‘piglit_display’:
tests/fbo/fbo-blending-format-quirks.c:157:40: warning: passing argument 2 of ‘test_formats’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   result = test_formats(cases[i].name, cases[i].formats,
                                        ^~~~~
tests/fbo/fbo-blending-format-quirks.c:45:27: note: expected ‘GLenum * {aka unsigned int *}’ but argument is of type ‘const GLenum * {aka const unsigned int *}’
 static enum piglit_result test_formats(const char *name, GLenum formats[2],
                           ^~~~~~~~~~~~
tests/fbo/fbo-blending-format-quirks.c:158:11: warning: passing argument 3 of ‘test_formats’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-array-qualifiers]
           cases[i].expect, cases[i].factors);
           ^~~~~
tests/fbo/fbo-blending-format-quirks.c:45:27: note: expected ‘float (*)[4]’ but argument is of type ‘const float (*)[4]’
 static enum piglit_result test_formats(const char *name, GLenum formats[2],
                           ^~~~~~~~~~~~
tests/fbo/fbo-blending-format-quirks.c:158:28: warning: passing argument 4 of ‘test_formats’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
           cases[i].expect, cases[i].factors);
                            ^~~~~
tests/fbo/fbo-blending-format-quirks.c:45:27: note: expected ‘GLenum * {aka unsigned int *}’ but argument is of type ‘const GLenum * {aka const unsigned int *}’
 static enum piglit_result test_formats(const char *name, GLenum formats[2],
                           ^~~~~~~~~~~~
---
 tests/fbo/fbo-blending-format-quirks.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/fbo/fbo-blending-format-quirks.c b/tests/fbo/fbo-blending-format-quirks.c
index 1b71b3252..1e931e970 100644
--- a/tests/fbo/fbo-blending-format-quirks.c
+++ b/tests/fbo/fbo-blending-format-quirks.c
@@ -42,8 +42,9 @@  PIGLIT_GL_TEST_CONFIG_BEGIN
 
 PIGLIT_GL_TEST_CONFIG_END
 
-static enum piglit_result test_formats(const char *name, GLenum formats[2],
-				       float expect[2][4], GLenum factors[2])
+static enum piglit_result
+test_formats(const char *name, const GLenum formats[2],
+	     const float expect[2][4], const GLenum factors[2])
 {
 	GLboolean pass = GL_TRUE;
 	GLuint tex[2], fb;

Comments

This and the other patch are

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>


On Tue, Jan 22, 2019 at 01:33:10PM -0800, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick@intel.com>
> 
> tests/fbo/fbo-blending-format-quirks.c: In function ‘piglit_display’:
> tests/fbo/fbo-blending-format-quirks.c:157:40: warning: passing argument 2 of ‘test_formats’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
>    result = test_formats(cases[i].name, cases[i].formats,
>                                         ^~~~~
> tests/fbo/fbo-blending-format-quirks.c:45:27: note: expected ‘GLenum * {aka unsigned int *}’ but argument is of type ‘const GLenum * {aka const unsigned int *}’
>  static enum piglit_result test_formats(const char *name, GLenum formats[2],
>                            ^~~~~~~~~~~~
> tests/fbo/fbo-blending-format-quirks.c:158:11: warning: passing argument 3 of ‘test_formats’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-array-qualifiers]
>            cases[i].expect, cases[i].factors);
>            ^~~~~
> tests/fbo/fbo-blending-format-quirks.c:45:27: note: expected ‘float (*)[4]’ but argument is of type ‘const float (*)[4]’
>  static enum piglit_result test_formats(const char *name, GLenum formats[2],
>                            ^~~~~~~~~~~~
> tests/fbo/fbo-blending-format-quirks.c:158:28: warning: passing argument 4 of ‘test_formats’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
>            cases[i].expect, cases[i].factors);
>                             ^~~~~
> tests/fbo/fbo-blending-format-quirks.c:45:27: note: expected ‘GLenum * {aka unsigned int *}’ but argument is of type ‘const GLenum * {aka const unsigned int *}’
>  static enum piglit_result test_formats(const char *name, GLenum formats[2],
>                            ^~~~~~~~~~~~
> ---
>  tests/fbo/fbo-blending-format-quirks.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/fbo/fbo-blending-format-quirks.c b/tests/fbo/fbo-blending-format-quirks.c
> index 1b71b3252..1e931e970 100644
> --- a/tests/fbo/fbo-blending-format-quirks.c
> +++ b/tests/fbo/fbo-blending-format-quirks.c
> @@ -42,8 +42,9 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
>  
>  PIGLIT_GL_TEST_CONFIG_END
>  
> -static enum piglit_result test_formats(const char *name, GLenum formats[2],
> -				       float expect[2][4], GLenum factors[2])
> +static enum piglit_result
> +test_formats(const char *name, const GLenum formats[2],
> +	     const float expect[2][4], const GLenum factors[2])
>  {
>  	GLboolean pass = GL_TRUE;
>  	GLuint tex[2], fb;
> -- 
> 2.14.5
> 
> _______________________________________________
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit


	Caio