Add casts to quiet compiler warnings.
authorKarl Schultz <kschultz@freedesktop.org>
Thu, 17 Oct 2002 22:26:06 +0000 (22:26 +0000)
committerKarl Schultz <kschultz@freedesktop.org>
Thu, 17 Oct 2002 22:26:06 +0000 (22:26 +0000)
src/mesa/main/api_loopback.c
src/mesa/main/attrib.c
src/mesa/main/teximage.c
src/mesa/main/texstate.c

index 6838f4f7c16eef1c4e51168cefd9163452a73bdd..0addf1ef55df03e1d68a6895c5edf506ac9d81a8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: api_loopback.c,v 1.15 2002/01/14 16:06:35 brianp Exp $ */
+/* $Id: api_loopback.c,v 1.16 2002/10/17 22:26:06 kschultz Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -1408,7 +1408,7 @@ loopback_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
 static void
 loopback_VertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y)
 {
-   ATTRIB(index, (GLfloat) x, y, 0.0F, 1.0F);
+   ATTRIB(index, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
 }
 
 static void
@@ -1481,7 +1481,7 @@ loopback_VertexAttrib2fvNV(GLuint index, const GLfloat *v)
 static void
 loopback_VertexAttrib2dvNV(GLuint index, const GLdouble *v)
 {
-   ATTRIB(index, (GLfloat) v[0], (GLdouble) v[1], 0.0F, 1.0F);
+   ATTRIB(index, (GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
 }
 
 static void
index 5c02a6c41edf220bc299ed42b48e50f8f26678ef..32a87f33ce3052c6eb4e3b531264ebb5ea3bd26a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: attrib.c,v 1.73 2002/10/11 21:42:08 brianp Exp $ */
+/* $Id: attrib.c,v 1.74 2002/10/17 22:26:06 kschultz Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -421,8 +421,8 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
    for (i=0;i<MAX_CLIP_PLANES;i++) {
       const GLuint mask = 1 << i;
       if ((ctx->Transform.ClipPlanesEnabled & mask) != (enable->ClipPlanes & mask))
-         _mesa_set_enable(ctx, (GLenum) (GL_CLIP_PLANE0 + i),
-                          (enable->ClipPlanes & mask) ? GL_TRUE : GL_FALSE);
+         _mesa_set_enable(ctx, (GLenum) (GL_CLIP_PLANE0 + i),
+                          (GLboolean) ((enable->ClipPlanes & mask) ? GL_TRUE : GL_FALSE));
    }
 
    TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial,
index afc5db761dee42329a579088fae9584c2e052121..792fe352c35be48b7518e88b6e0fa32199acdcb7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: teximage.c,v 1.119 2002/10/10 14:12:09 brianp Exp $ */
+/* $Id: teximage.c,v 1.120 2002/10/17 22:26:06 kschultz Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -1162,12 +1162,12 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions,
          return GL_TRUE;
       }
       /* size must be multiple of 4 or equal to whole texture size */
-      if ((width & 3) && width != texImage->Width) {
+      if ((width & 3) && (GLuint) width != texImage->Width) {
          _mesa_error(ctx, GL_INVALID_OPERATION,
                      "glTexSubImage%D(width)", dimensions);
          return GL_TRUE;
       }         
-      if ((height & 3) && height != texImage->Height) {
+      if ((height & 3) && (GLuint) height != texImage->Height) {
          _mesa_error(ctx, GL_INVALID_OPERATION,
                      "glTexSubImage%D(width)", dimensions);
          return GL_TRUE;
@@ -1411,12 +1411,12 @@ copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions,
          return GL_TRUE;
       }
       /* size must be multiple of 4 */
-      if ((width & 3) != 0 && width != teximage->Width) {
+      if ((width & 3) != 0 && (GLuint) width != teximage->Width) {
          _mesa_error(ctx, GL_INVALID_VALUE,
                      "glCopyTexSubImage%D(width)", dimensions);
          return GL_TRUE;
       }         
-      if ((height & 3) != 0 && height != teximage->Height) {
+      if ((height & 3) != 0 && (GLuint) height != teximage->Height) {
          _mesa_error(ctx, GL_INVALID_VALUE,
                      "glCopyTexSubImage%D(height)", dimensions);
          return GL_TRUE;
@@ -2741,13 +2741,13 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
    texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
    assert(texImage);
 
-   if (format != texImage->IntFormat) {
+   if ((GLint) format != texImage->IntFormat) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
                   "glCompressedTexSubImage1D(format)");
       return;
    }
 
-   if ((width == 1 || width == 2) && width != texImage->Width) {
+   if ((width == 1 || width == 2) && (GLuint) width != texImage->Width) {
       _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage1D(width)");
       return;
    }
@@ -2790,14 +2790,14 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
    texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
    assert(texImage);
 
-   if (format != texImage->IntFormat) {
+   if ((GLint) format != texImage->IntFormat) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
                   "glCompressedTexSubImage2D(format)");
       return;
    }
 
-   if (((width == 1 || width == 2) && width != texImage->Width) ||
-       ((height == 1 || height == 2) && height != texImage->Height)) {
+   if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) ||
+       ((height == 1 || height == 2) && (GLuint) height != texImage->Height)) {
       _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage2D(size)");
       return;
    }
@@ -2840,15 +2840,15 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
    texImage = _mesa_select_tex_image(ctx, texUnit, target, level);
    assert(texImage);
 
-   if (format != texImage->IntFormat) {
+   if ((GLint) format != texImage->IntFormat) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
                   "glCompressedTexSubImage3D(format)");
       return;
    }
 
-   if (((width == 1 || width == 2) && width != texImage->Width) ||
-       ((height == 1 || height == 2) && height != texImage->Height) ||
-       ((depth == 1 || depth == 2) && depth != texImage->Depth)) {
+   if (((width == 1 || width == 2) && (GLuint) width != texImage->Width) ||
+       ((height == 1 || height == 2) && (GLuint) height != texImage->Height) ||
+       ((depth == 1 || depth == 2) && (GLuint) depth != texImage->Depth)) {
       _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage3D(size)");
       return;
    }
index e5c82e1514dbd6892701befd989e19f6f79ea1d0..0da213404b9f9be7d687c70a59647803d97e4df6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: texstate.c,v 1.80 2002/10/04 19:10:08 brianp Exp $ */
+/* $Id: texstate.c,v 1.81 2002/10/17 22:26:06 kschultz Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -554,7 +554,7 @@ _mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param )
       p[3] = INT_TO_FLOAT( param[3] );
    }
    else {
-      p[0] = (GLint) param[0];
+      p[0] = (GLfloat) param[0];
       p[1] = p[2] = p[3] = 0;  /* init to zero, just to be safe */
    }
    _mesa_TexEnvfv( target, pname, p );