Mesa (master): mesa: silence MSVC double/ float assignment warnings in pixel unpack code

Brian Paul brianp at kemper.freedesktop.org
Mon Oct 29 23:57:03 UTC 2012


Module: Mesa
Branch: master
Commit: 298d7a20e1fb5eeed9832ea34f674e12aca59f4c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=298d7a20e1fb5eeed9832ea34f674e12aca59f4c

Author: Brian Paul <brianp at vmware.com>
Date:   Sat Oct 27 08:58:19 2012 -0600

mesa: silence MSVC double/float assignment warnings in pixel unpack code

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>

---

 src/mesa/main/format_unpack.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
index 7b46dfc..04fd1d6 100644
--- a/src/mesa/main/format_unpack.c
+++ b/src/mesa/main/format_unpack.c
@@ -633,7 +633,7 @@ unpack_Z24_S8(const void *src, GLfloat dst[][4], GLuint n)
    for (i = 0; i < n; i++) {
       dst[i][0] =
       dst[i][1] =
-      dst[i][2] = (s[i] >> 8) * scale;
+      dst[i][2] = (GLfloat) ((s[i] >> 8) * scale);
       dst[i][3] = 1.0F;
       ASSERT(dst[i][0] >= 0.0F);
       ASSERT(dst[i][0] <= 1.0F);
@@ -650,7 +650,7 @@ unpack_S8_Z24(const void *src, GLfloat dst[][4], GLuint n)
    for (i = 0; i < n; i++) {
       dst[i][0] =
       dst[i][1] =
-      dst[i][2] = (s[i] & 0x00ffffff) * scale;
+      dst[i][2] = (float) ((s[i] & 0x00ffffff) * scale);
       dst[i][3] = 1.0F;
       ASSERT(dst[i][0] >= 0.0F);
       ASSERT(dst[i][0] <= 1.0F);
@@ -2856,7 +2856,7 @@ unpack_float_z_Z24_X8(GLuint n, const void *src, GLfloat *dst)
    const GLdouble scale = 1.0 / (GLdouble) 0xffffff;
    GLuint i;
    for (i = 0; i < n; i++) {
-      dst[i] = (s[i] >> 8) * scale;
+      dst[i] = (GLfloat) ((s[i] >> 8) * scale);
       ASSERT(dst[i] >= 0.0F);
       ASSERT(dst[i] <= 1.0F);
    }
@@ -2870,7 +2870,7 @@ unpack_float_z_X8_Z24(GLuint n, const void *src, GLfloat *dst)
    const GLdouble scale = 1.0 / (GLdouble) 0xffffff;
    GLuint i;
    for (i = 0; i < n; i++) {
-      dst[i] = (s[i] & 0x00ffffff) * scale;
+      dst[i] = (GLfloat) ((s[i] & 0x00ffffff) * scale);
       ASSERT(dst[i] >= 0.0F);
       ASSERT(dst[i] <= 1.0F);
    }




More information about the mesa-commit mailing list