diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index bb528164cf4..5de0e2f5c92 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);