Francois Gouget : ddraw/tests: Fix compilation with Visual C++ 2005.

Alexandre Julliard julliard at wine.codeweavers.com
Tue May 29 08:05:38 CDT 2007


Module: wine
Branch: master
Commit: 77440b098f090e36cdd63578c2b45bd45ab87680
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=77440b098f090e36cdd63578c2b45bd45ab87680

Author: Francois Gouget <fgouget at free.fr>
Date:   Sun May 27 16:08:39 2007 +0200

ddraw/tests: Fix compilation with Visual C++ 2005.

---

 dlls/ddraw/tests/d3d.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c
index bb52816..5de0e2f 100644
--- a/dlls/ddraw/tests/d3d.c
+++ b/dlls/ddraw/tests/d3d.c
@@ -142,6 +142,8 @@ static void LightTest(void)
     D3DLIGHT7 light;
     D3DLIGHT7 defaultlight;
     BOOL bEnabled = FALSE;
+    float one = 1.0f;
+    float zero= 0.0f;
 
     /* Set a few lights with funky indices. */
     memset(&light, 0, sizeof(light));
@@ -256,7 +258,7 @@ static void LightTest(void)
     U3(light.dcvDiffuse).b = 1.f;
     U3(light.dvDirection).z = 1.f;
 
-    light.dvAttenuation0 = -1.0 / 0.0; /* -INFINITY */
+    light.dvAttenuation0 = -one / zero; /* -INFINITY */
     rc = IDirect3DDevice7_SetLight(lpD3DDevice, 103, &light);
     ok(rc==DDERR_INVALIDPARAMS, "SetLight returned: %x\n", rc);
 
@@ -272,11 +274,11 @@ static void LightTest(void)
     rc = IDirect3DDevice7_SetLight(lpD3DDevice, 103, &light);
     ok(rc==D3D_OK, "SetLight returned: %x\n", rc);
 
-    light.dvAttenuation0 = 1.0 / 0.0; /* +INFINITY */
+    light.dvAttenuation0 = one / zero; /* +INFINITY */
     rc = IDirect3DDevice7_SetLight(lpD3DDevice, 103, &light);
     ok(rc==D3D_OK, "SetLight returned: %x\n", rc);
 
-    light.dvAttenuation0 = 0.0 / 0.0; /* NaN */
+    light.dvAttenuation0 = zero / zero; /* NaN */
     rc = IDirect3DDevice7_SetLight(lpD3DDevice, 103, &light);
     ok(rc==D3D_OK, "SetLight returned: %x\n", rc);
 




More information about the wine-cvs mailing list