[Mesa-dev] [PATCH] swrast: silence texture_slices warning

Brian Paul brianp at vmware.com
Tue Mar 22 14:44:43 UTC 2016


I just pushed a (trivial) patch that fixed this.

-Brian

On 03/21/2016 05:52 PM, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> In file included from ../../src/compiler/glsl/list.h:74:0,
>                   from ./main/mtypes.h:47,
>                   from ./main/errors.h:43,
>                   from ./main/imports.h:44,
>                   from ./main/context.h:52,
>                   from swrast/s_texture.c:30:
> swrast/s_texture.c: In function ‘check_map_teximage’:
> swrast/s_texture.c:191:34: warning: passing argument 1 of ‘texture_slices’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
>      assert(slice < texture_slices(texImage));
>                                    ^
> swrast/s_texture.c:63:1: note: expected ‘struct gl_texture_image *’ but argument is of type ‘const struct gl_texture_image *’
>   texture_slices(struct gl_texture_image *texImage)
>   ^
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>   src/mesa/swrast/s_texture.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
> index 25918e3..d35bea9 100644
> --- a/src/mesa/swrast/s_texture.c
> +++ b/src/mesa/swrast/s_texture.c
> @@ -60,7 +60,7 @@ _swrast_delete_texture_image(struct gl_context *ctx,
>   }
>
>   static unsigned int
> -texture_slices(struct gl_texture_image *texImage)
> +texture_slices(const struct gl_texture_image *texImage)
>   {
>      if (texImage->TexObject->Target == GL_TEXTURE_1D_ARRAY)
>         return texImage->Height;
>



More information about the mesa-dev mailing list