Mesa (master): util: silence some MSVC type conversion warnings

Brian Paul brianp at kemper.freedesktop.org
Sat Jan 7 21:19:01 UTC 2012


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

Author: Brian Paul <brianp at vmware.com>
Date:   Sat Jan  7 14:16:27 2012 -0700

util: silence some MSVC type conversion warnings

---

 src/gallium/auxiliary/util/u_format_r11g11b10f.h |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_format_r11g11b10f.h b/src/gallium/auxiliary/util/u_format_r11g11b10f.h
index 6bb4302..bd64b28 100644
--- a/src/gallium/auxiliary/util/u_format_r11g11b10f.h
+++ b/src/gallium/auxiliary/util/u_format_r11g11b10f.h
@@ -119,12 +119,12 @@ static INLINE float uf11_to_f32(uint16_t val)
       float scale, decimal;
       exponent -= 15;
       if (exponent < 0) {
-         scale = 1.0 / (1 << -exponent);
+         scale = 1.0f / (1 << -exponent);
       }
       else {
-         scale = 1 << exponent;
+         scale = (float) (1 << exponent);
       }
-      decimal = 1.0 + (float) mantissa / 64;
+      decimal = 1.0f + (float) mantissa / 64;
       f32.f = scale * decimal;
    }
 
@@ -208,9 +208,9 @@ static INLINE float uf10_to_f32(uint16_t val)
          scale = 1.0 / (1 << -exponent);
       }
       else {
-         scale = 1 << exponent;
+         scale = (float) (1 << exponent);
       }
-      decimal = 1.0 + (float) mantissa / 32;
+      decimal = 1.0f + (float) mantissa / 32;
       f32.f = scale * decimal;
    }
 




More information about the mesa-commit mailing list