From d3975341e743b3436a69dedd864ccedc56b0db03 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Mon, 28 Oct 2002 23:01:24 +0000 Subject: Add casts to quiet compiler warnings. --- src/mesa/main/texstore.c | 7 ++++--- src/mesa/swrast/s_texture.c | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 046e5289c5..d144d8095f 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1,4 +1,4 @@ -/* $Id: texstore.c,v 1.45 2002/10/24 23:57:21 brianp Exp $ */ +/* $Id: texstore.c,v 1.46 2002/10/28 23:01:24 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -1909,7 +1909,8 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, /* Find convertFormat - the format that do_row() will process */ if (srcImage->IsCompressed) { /* setup for compressed textures */ - GLint row, components, size; + GLuint row; + GLint components, size; GLchan *dst; assert(texObj->Target == GL_TEXTURE_2D); @@ -1946,7 +1947,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, /* decompress base image here */ dst = (GLchan *) srcData; for (row = 0; row < srcImage->Height; row++) { - GLint col; + GLuint col; for (col = 0; col < srcImage->Width; col++) { (*srcImage->FetchTexel)(srcImage, col, row, 0, (GLvoid *) dst); dst += components; diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 06ca19d0a2..73fbccff64 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -1,4 +1,4 @@ -/* $Id: s_texture.c,v 1.73 2002/10/24 23:57:24 brianp Exp $ */ +/* $Id: s_texture.c,v 1.74 2002/10/28 23:01:24 kschultz Exp $ */ /* * Mesa 3-D graphics library @@ -97,7 +97,7 @@ U = 1.0F - (S - (GLfloat) flr); /* flr is odd */ \ else \ U = S - (GLfloat) flr; /* flr is even */ \ - U = (U * SIZE) - 0.5; \ + U = (U * SIZE) - 0.5F; \ I0 = IFLOOR(U); \ I1 = I0 + 1; \ if (I0 < 0) \ @@ -106,7 +106,7 @@ I1 = SIZE - 1; \ } \ else if (wrapMode == GL_MIRROR_CLAMP_ATI) { \ - U = fabs(S); \ + U = (GLfloat) fabs(S); \ if (U >= 1.0F) \ U = (GLfloat) SIZE; \ else \ @@ -116,7 +116,7 @@ I1 = I0 + 1; \ } \ else if (wrapMode == GL_MIRROR_CLAMP_TO_EDGE_ATI) { \ - U = fabs(S); \ + U = (GLfloat) fabs(S); \ if (U >= 1.0F) \ U = (GLfloat) SIZE; \ else \ @@ -198,7 +198,7 @@ else if (wrapMode == GL_MIRROR_CLAMP_ATI) { \ /* s limited to [0,1] */ \ /* i limited to [0,size-1] */ \ - const GLfloat u = fabs(S); \ + const GLfloat u = (GLfloat) fabs(S); \ if (u <= 0.0F) \ I = 0; \ else if (u >= 1.0F) \ @@ -211,7 +211,7 @@ /* i limited to [0, size-1] */ \ const GLfloat min = 1.0F / (2.0F * SIZE); \ const GLfloat max = 1.0F - min; \ - const GLfloat u = fabs(S); \ + const GLfloat u = (GLfloat) fabs(S); \ if (u < min) \ I = 0; \ else if (u > max) \ -- cgit v1.2.3