[Mesa-dev] [PATCH 2/2] mesa/compute: drop pointless casts.

Anuj Phogat anuj.phogat at gmail.com
Thu May 5 08:19:41 UTC 2016


On Wed, May 4, 2016 at 5:41 PM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> We already are a GLintptr, casting won't help.
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
>  src/mesa/main/api_validate.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
> index d455f19..421ae8b 100644
> --- a/src/mesa/main/api_validate.c
> +++ b/src/mesa/main/api_validate.c
> @@ -1107,20 +1107,20 @@ valid_dispatch_indirect(struct gl_context *ctx,
>                          GLintptr indirect,
>                          GLsizei size, const char *name)
>  {
> -   GLintptr end = (GLintptr)indirect + size;
> +   GLintptr end = indirect + size;
>
>     /* From the OpenGL 4.3 Core Specification, Chapter 19, Compute Shaders:
>      *
>      * "An INVALID_VALUE error is generated if indirect is negative or is not a
>      *  multiple of four."
>      */
> -   if ((GLintptr)indirect & (sizeof(GLuint) - 1)) {
> +   if (indirect & (sizeof(GLuint) - 1)) {
>        _mesa_error(ctx, GL_INVALID_VALUE,
>                    "%s(indirect is not aligned)", name);
>        return GL_FALSE;
>     }
>
> -   if ((GLintptr)indirect < 0) {
> +   if (indirect < 0) {
>        _mesa_error(ctx, GL_INVALID_VALUE,
>                    "%s(indirect is less than zero)", name);
>        return GL_FALSE;
> --
> 2.5.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>


More information about the mesa-dev mailing list