From: Brian Date: Sat, 29 Mar 2008 00:18:55 +0000 (-0600) Subject: gallium: added an (int) cast in setup_bitmap_vertex_data() to fix a signed/unsigned... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6908a766dce645d610ff04bb49eaa8c5ee9e65a;p=mesa.git gallium: added an (int) cast in setup_bitmap_vertex_data() to fix a signed/unsigned arithmetic problem Negative values became very large uints. --- diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 464e22d576b..b600b92dc6e 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -351,7 +351,7 @@ setup_bitmap_vertex_data(struct st_context *st, const GLboolean invert = (st_fb_orientation(fb) == Y_0_TOP); const GLfloat x0 = x; const GLfloat x1 = x + width; - const GLfloat y0 = invert ? (fb->Height - y - height) : y; + const GLfloat y0 = invert ? ((int) fb->Height - y - height) : y; const GLfloat y1 = invert ? (y0 + height) : y + height; const GLfloat bias = st->bitmap_texcoord_bias; const GLfloat xBias = bias / (x1-x0);