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

Caio Marcelo de Oliveira Filho caio.oliveira at intel.com
Tue Jan 22 21:59:06 UTC 2019


This and the other patch are

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


On Tue, Jan 22, 2019 at 01:33:10PM -0800, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at 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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit


	Caio


More information about the Piglit mailing list