[Mesa-dev] [PATCH 05/11] st/mesa: silence assorted MSVC warnings

Ian Romanick idr at freedesktop.org
Wed Jan 23 06:18:09 PST 2013


On 01/22/2013 07:51 PM, Brian Paul wrote:
> ---
>   src/mesa/state_tracker/st_cb_drawpixels.c |    6 +++---
>   1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
> index ff8a9dc..4d9c825 100644
> --- a/src/mesa/state_tracker/st_cb_drawpixels.c
> +++ b/src/mesa/state_tracker/st_cb_drawpixels.c
> @@ -795,7 +795,7 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
>      y1 = y + height * ctx->Pixel.ZoomY;
>
>      /* convert Z from [0,1] to [-1,-1] to match viewport Z scale/bias */
> -   z = z * 2.0 - 1.0;
> +   z = z * 2.0f - 1.0f;
>
>      draw_quad(ctx, x0, y0, z, x1, y1, color, invertTex,
>                normalized ? ((GLfloat) width / sv[0]->texture->width0) : (GLfloat)width,
> @@ -1067,12 +1067,12 @@ clamp_size(struct pipe_context *pipe, GLsizei *width, GLsizei *height,
>         1 << (pipe->screen->get_param(pipe->screen,
>                                       PIPE_CAP_MAX_TEXTURE_2D_LEVELS) - 1);
>
> -   if (*width > maxSize) {
> +   if (*width > (int) maxSize) {
>         if (unpack->RowLength == 0)
>            unpack->RowLength = *width;
>         *width = maxSize;
>      }
> -   if (*height > maxSize) {
> +   if (*height > (int) maxSize) {
>         *height = maxSize;

The comparisons generate warnings, but the assignments do not?  I guess 
that makes sense... Instead of adding casts, can the type of maxSize or 
width / height change?

>      }
>   }
>



More information about the mesa-dev mailing list