[Piglit] [PATCH 2/3] cl-program-tester: Avoid void pointer arithmetic.

Tom Stellard tom at stellard.net
Tue Mar 3 06:02:17 PST 2015


On Tue, Mar 03, 2015 at 01:46:18PM +0000, Jose Fonseca wrote:
> Although CL tests are not built with MSVC, this is the single instance
> of void pointer arithmetic in them, so updating it to not use void
> pointer arithmetic will enable us to use -Werror=pointer-arith option
> universally in a follow on change.

Reviewed-by: Tom Stellard <thomas.stellard at amd.com>

> ---
>  tests/cl/program/program-tester.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/cl/program/program-tester.c b/tests/cl/program/program-tester.c
> index 3905679..314871a 100644
> --- a/tests/cl/program/program-tester.c
> +++ b/tests/cl/program/program-tester.c
> @@ -188,7 +188,7 @@ add_dynamic_array(void** array,
>  		free(old_array);
>  	}
>  
> -	memcpy((*array) + ((*count)*element_size), data, element_size);
> +	memcpy((char *)(*array) + ((*count)*element_size), data, element_size);
>  	(*count)++;
>  #undef GROW_SIZE
>  }
> -- 
> 2.1.0
> 
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list