[Mesa-dev] [PATCH] swrast: add casts for ImageSlices pointer arithmetic

Jose Fonseca jfonseca at vmware.com
Wed May 1 03:56:46 PDT 2013


----- Original Message -----
> MSVC doesn't like pointer arithmetic with void * so use GLubyte *.
> ---
>  src/mesa/swrast/s_texfetch_tmp.h |    8 ++++----
>  src/mesa/swrast/s_texfilter.c    |    2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/mesa/swrast/s_texfetch_tmp.h
> b/src/mesa/swrast/s_texfetch_tmp.h
> index c9991cd..714226c 100644
> --- a/src/mesa/swrast/s_texfetch_tmp.h
> +++ b/src/mesa/swrast/s_texfetch_tmp.h
> @@ -44,15 +44,15 @@
>  #if DIM == 1
>  
>  #define TEXEL_ADDR( type, image, i, j, k, size ) \
> -	((void) (j), (void) (k), ((type *)(image)->ImageSlices[0] + (i) * (size)))
> +       ((void) (j), (void) (k), ((type *)((GLubyte *)

Having MSVC build broken for long time prevents tests to run, and issues to pile up, so I went ahead and committed this.  But as I was about to commit this, I noticed that this hunk is unnecessary and a bit confusing, so I left it out.

If there are further concerns (or a cleaner way of avoiding void * arithmetic), it can be addressed in follow-on commits.

Jose


More information about the mesa-dev mailing list