OSDN Git Service

mesa: Silence compiler warnings on Windows.
authorMichal Krol <michal@tungstengraphics.com>
Tue, 15 Jul 2008 09:15:27 +0000 (11:15 +0200)
committerKeith Whitwell <keith@tungstengraphics.com>
Mon, 22 Sep 2008 05:13:57 +0000 (22:13 -0700)
src/mesa/main/texformat.c
src/mesa/main/texrender.c
src/mesa/main/texstore.c

index ae9ed0a..d4ccdf9 100644 (file)
@@ -55,10 +55,10 @@ nonlinear_to_linear(GLubyte cs8)
       for (i = 0; i < 256; i++) {
          const GLfloat cs = UBYTE_TO_FLOAT(i);
          if (cs <= 0.04045) {
-            table[i] = cs / 12.92;
+            table[i] = cs / 12.92f;
          }
          else {
-            table[i] = _mesa_pow((cs + 0.055) / 1.055, 2.4);
+            table[i] = (GLfloat) _mesa_pow((cs + 0.055) / 1.055, 2.4);
          }
       }
       tableReady = GL_TRUE;
index 8d5468a..163bda4 100644 (file)
@@ -159,7 +159,7 @@ texture_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
       const GLuint *zValues = (const GLuint *) values;
       for (i = 0; i < count; i++) {
          if (!mask || mask[i]) {
-            GLfloat flt = (zValues[i] >> 8) * (1.0 / 0xffffff);
+            GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff));
             trb->Store(trb->TexImage, x + i, y, z, &flt);
          }
       }
@@ -199,7 +199,7 @@ texture_put_mono_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
    }
    else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
       const GLuint zValue = *((const GLuint *) value);
-      const GLfloat flt = (zValue >> 8) * (1.0 / 0xffffff);
+      const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff));
       for (i = 0; i < count; i++) {
          if (!mask || mask[i]) {
             trb->Store(trb->TexImage, x + i, y, z, &flt);
@@ -244,7 +244,7 @@ texture_put_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
       const GLuint *zValues = (const GLuint *) values;
       for (i = 0; i < count; i++) {
          if (!mask || mask[i]) {
-            GLfloat flt = (zValues[i] >> 8) * (1.0 / 0xffffff);
+            GLfloat flt = (GLfloat) ((zValues[i] >> 8) * (1.0 / 0xffffff));
             trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt);
          }
       }
@@ -283,7 +283,7 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb,
    }
    else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
       const GLuint zValue = *((const GLuint *) value);
-      const GLfloat flt = (zValue >> 8) * (1.0 / 0xffffff);
+      const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff));
       for (i = 0; i < count; i++) {
          if (!mask || mask[i]) {
             trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt);
index e422980..79ef881 100644 (file)
@@ -2439,7 +2439,7 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS)
             _mesa_unpack_depth_span(ctx, srcWidth,
                                     GL_UNSIGNED_INT_24_8_EXT, /* dst type */
                                     dstRow, /* dst addr */
-                                    depthScale,
+                                    (GLuint) depthScale,
                                     srcType, src, srcPacking);
             /* get the 8-bit stencil values */
             _mesa_unpack_stencil_span(ctx, srcWidth,