[Mesa-dev] [PATCH] mesa: typecast arguments to printf to avoid 32-bit warnings

Alejandro Piñeiro apinheiro at igalia.com
Mon Apr 11 07:22:17 UTC 2016


On 04/04/16 03:57, Ilia Mirkin wrote:
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  src/mesa/main/bufferobj.c     | 3 ++-
>  src/mesa/vbo/vbo_exec_array.c | 8 ++++----
>  2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index 731b62e..9a59043 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -3750,7 +3750,8 @@ _mesa_BindBufferRange(GLenum target, GLuint index,
>  
>     if (MESA_VERBOSE & VERBOSE_API) {
>        _mesa_debug(ctx, "glBindBufferRange(%s, %u, %u, %ld, %ld)\n",
> -                  _mesa_enum_to_string(target), index, buffer, offset, size);
> +                  _mesa_enum_to_string(target), index, buffer,
> +                  (long)offset, (long)size);

As far as I see, on that source file and others at the same directory,
there is always a space between the (type) and the variable typecasted
(so "(long) offset").

>     }
>  
>     if (buffer == 0) {
> diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
> index 40cf3ff..88a7b9c 100644
> --- a/src/mesa/vbo/vbo_exec_array.c
> +++ b/src/mesa/vbo/vbo_exec_array.c
> @@ -1659,8 +1659,8 @@ vbo_exec_MultiDrawArraysIndirectCount(GLenum mode,
>     if (MESA_VERBOSE & VERBOSE_DRAW)
>        _mesa_debug(ctx, "glMultiDrawArraysIndirectCountARB"
>                    "(%s, %lx, %lx, %i, %i)\n",
> -                  _mesa_enum_to_string(mode), indirect,
> -                  drawcount, maxdrawcount, stride);
> +                  _mesa_enum_to_string(mode), (long)indirect,
> +                  (long)drawcount, maxdrawcount, stride);

Ditto.

>  
>     /* If <stride> is zero, the array elements are treated as tightly packed. */
>     if (stride == 0)
> @@ -1688,8 +1688,8 @@ vbo_exec_MultiDrawElementsIndirectCount(GLenum mode, GLenum type,
>        _mesa_debug(ctx, "glMultiDrawElementsIndirectCountARB"
>                    "(%s, %s, %lx, %lx, %i, %i)\n",
>                    _mesa_enum_to_string(mode),
> -                  _mesa_enum_to_string(type), indirect,
> -                  drawcount, maxdrawcount, stride);
> +                  _mesa_enum_to_string(type), (long)indirect,
> +                  (long)drawcount, maxdrawcount, stride);

Ditto.
>  
>     /* If <stride> is zero, the array elements are treated as tightly packed. */
>     if (stride == 0)

With that nitpick fixed:

Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>


More information about the mesa-dev mailing list