From 39f0e07a3e093bb07ef343454f5e0b40e37b4f4c Mon Sep 17 00:00:00 2001
From: Thomas Faber <thfabba@gmx.de>
Date: Sat, 28 Apr 2012 09:56:09 +0200
Subject: wined3d: Fix build with MSVC.

---
 dlls/wined3d/state.c           |    3 ++-
 dlls/wined3d/wined3d_private.h |   14 ++++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 5e6c537..53b65a1 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1027,6 +1027,7 @@ void state_fogstartend(struct wined3d_context *context, const struct wined3d_sta
         DWORD d;
         float f;
     } tmpvalue;
+    const float zero = 0.0f;
 
     switch(context->fog_source) {
         case FOGSOURCE_VS:
@@ -1046,7 +1047,7 @@ void state_fogstartend(struct wined3d_context *context, const struct wined3d_sta
             fogend = tmpvalue.f;
             /* In GL, fogstart == fogend disables fog, in D3D everything's fogged.*/
             if(fogstart == fogend) {
-                fogstart = -1.0f / 0.0f;
+                fogstart = -1.0f / zero;
                 fogend = 0.0f;
             }
             break;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 92b259e..fa51b72 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -192,15 +192,16 @@ static inline float float_16_to_32(const unsigned short *in) {
     const unsigned short e = ((*in) & 0x7C00) >> 10;
     const unsigned short m = (*in) & 0x3FF;
     const float sgn = (s ? -1.0f : 1.0f);
+    const float zero = 0.0f;
 
     if(e == 0) {
-        if(m == 0) return sgn * 0.0f; /* +0.0 or -0.0 */
+        if(m == 0) return sgn * zero; /* +0.0 or -0.0 */
         else return sgn * powf(2, -14.0f) * ((float)m / 1024.0f);
     } else if(e < 31) {
         return sgn * powf(2, (float)e - 15.0f) * (1.0f + ((float)m / 1024.0f));
     } else {
-        if(m == 0) return sgn / 0.0f; /* +INF / -INF */
-        else return 0.0f / 0.0f; /* NAN */
+        if(m == 0) return sgn / zero; /* +INF / -INF */
+        else return zero / zero; /* NAN */
     }
 }
 
@@ -209,10 +210,11 @@ static inline float float_24_to_32(DWORD in)
     const float sgn = in & 0x800000 ? -1.0f : 1.0f;
     const unsigned short e = (in & 0x780000) >> 19;
     const unsigned int m = in & 0x7ffff;
+    const float zero = 0.0f;
 
     if (e == 0)
     {
-        if (m == 0) return sgn * 0.0f; /* +0.0 or -0.0 */
+        if (m == 0) return sgn * zero; /* +0.0 or -0.0 */
         else return sgn * powf(2, -6.0f) * ((float)m / 524288.0f);
     }
     else if (e < 15)
@@ -221,8 +223,8 @@ static inline float float_24_to_32(DWORD in)
     }
     else
     {
-        if (m == 0) return sgn / 0.0f; /* +INF / -INF */
-        else return 0.0f / 0.0f; /* NAN */
+        if (m == 0) return sgn / zero; /* +INF / -INF */
+        else return zero / zero; /* NAN */
     }
 }
 
-- 
1.7.1.GIT
