Add casts to quiet compiler warnings.
authorKarl Schultz <kschultz@freedesktop.org>
Mon, 28 Oct 2002 23:01:24 +0000 (23:01 +0000)
committerKarl Schultz <kschultz@freedesktop.org>
Mon, 28 Oct 2002 23:01:24 +0000 (23:01 +0000)
src/mesa/main/texstore.c
src/mesa/swrast/s_texture.c

index 046e5289c52ad0e9f7fecc206a906f81b7a5b32c..d144d8095f22a053baa7dbe46d8211eb5e2befd6 100644 (file)
@@ -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;
index 06ca19d0a23aa919cfb858106f0a04e435fc1869..73fbccff64184a817b7b5b96e41d02e837627e30 100644 (file)
@@ -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)                                                      \
          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                                                             \
       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                                                             \
    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)                                              \
       /* 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)                                                        \