[PATCH 5/5] d3d9/tests: Add some missing float suffixes to number literals.
Stefan Dösinger
stefan at codeweavers.com
Tue Feb 1 07:58:25 CST 2022
Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>
---
Visual Studio got a bit smarter over time and stopped warning about 0.0 and
1.0 values. We have plenty more of those, but I am not changing them to
avoid code churn. I am fixing them near code I am touching anyway.
---
dlls/d3d9/tests/visual.c | 54 ++++++++++++++++++++--------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index f7eb52d1f41..bff309aa9aa 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -699,7 +699,7 @@ static void test_specular_lighting(void)
100.0f,
1.0f,
0.0f, 0.0f, 1.0f,
- M_PI / 12.0f, M_PI / 3.0f
+ (float)M_PI / 12.0f, (float)M_PI / 3.0f
},
/* The chosen range value makes the test fail when using a manhattan
* distance metric vs the correct euclidean distance. */
@@ -2224,8 +2224,8 @@ static void fog_test(void)
/* Test "reversed" fog without shaders. With shaders this fails on a few Windows D3D implementations,
* but without shaders it seems to work everywhere
*/
- end = 0.2;
- start = 0.8;
+ end = 0.2f;
+ start = 0.8f;
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, *((DWORD *) &start));
ok(hr == D3D_OK, "Setting fog start returned %08x\n", hr);
hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGEND, *((DWORD *) &end));
@@ -10359,25 +10359,25 @@ static void test_vshader_float16(void)
}
quad[] =
{
- { -1.0, -1.0, 0.1, 0x3c000000, 0x00000000 }, /* green */
- { -1.0, 0.0, 0.1, 0x3c000000, 0x00000000 },
- { 0.0, -1.0, 0.1, 0x3c000000, 0x00000000 },
- { 0.0, 0.0, 0.1, 0x3c000000, 0x00000000 },
+ { -1.0f, -1.0f, 0.1f, 0x3c000000, 0x00000000 }, /* green */
+ { -1.0f, 0.0f, 0.1f, 0x3c000000, 0x00000000 },
+ { 0.0f, -1.0f, 0.1f, 0x3c000000, 0x00000000 },
+ { 0.0f, 0.0f, 0.1f, 0x3c000000, 0x00000000 },
- { 0.0, -1.0, 0.1, 0x00003c00, 0x00000000 }, /* red */
- { 0.0, 0.0, 0.1, 0x00003c00, 0x00000000 },
- { 1.0, -1.0, 0.1, 0x00003c00, 0x00000000 },
- { 1.0, 0.0, 0.1, 0x00003c00, 0x00000000 },
+ { 0.0f, -1.0f, 0.1f, 0x00003c00, 0x00000000 }, /* red */
+ { 0.0f, 0.0f, 0.1f, 0x00003c00, 0x00000000 },
+ { 1.0f, -1.0f, 0.1f, 0x00003c00, 0x00000000 },
+ { 1.0f, 0.0f, 0.1f, 0x00003c00, 0x00000000 },
- { 0.0, 0.0, 0.1, 0x00000000, 0x00003c00 }, /* blue */
- { 0.0, 1.0, 0.1, 0x00000000, 0x00003c00 },
- { 1.0, 0.0, 0.1, 0x00000000, 0x00003c00 },
- { 1.0, 1.0, 0.1, 0x00000000, 0x00003c00 },
+ { 0.0f, 0.0f, 0.1f, 0x00000000, 0x00003c00 }, /* blue */
+ { 0.0f, 1.0f, 0.1f, 0x00000000, 0x00003c00 },
+ { 1.0f, 0.0f, 0.1f, 0x00000000, 0x00003c00 },
+ { 1.0f, 1.0f, 0.1f, 0x00000000, 0x00003c00 },
- { -1.0, 0.0, 0.1, 0x00000000, 0x3c000000 }, /* alpha */
- { -1.0, 1.0, 0.1, 0x00000000, 0x3c000000 },
- { 0.0, 0.0, 0.1, 0x00000000, 0x3c000000 },
- { 0.0, 1.0, 0.1, 0x00000000, 0x3c000000 },
+ { -1.0f, 0.0f, 0.1f, 0x00000000, 0x3c000000 }, /* alpha */
+ { -1.0f, 1.0f, 0.1f, 0x00000000, 0x3c000000 },
+ { 0.0f, 0.0f, 0.1f, 0x00000000, 0x3c000000 },
+ { 0.0f, 1.0f, 0.1f, 0x00000000, 0x3c000000 },
};
window = create_window();
@@ -10969,10 +10969,10 @@ static void fixed_function_bumpmap_test(void)
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_BUMPENVMAPLUMINANCE);
ok(SUCCEEDED(hr), "SetTextureStageState failed (%08x)\n", hr);
- scale = 2.0;
+ scale = 2.0f;
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_BUMPENVLSCALE, *((DWORD *)&scale));
ok(SUCCEEDED(hr), "SetTextureStageState failed (%08x)\n", hr);
- offset = 0.1;
+ offset = 0.1f;
hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_BUMPENVLOFFSET, *((DWORD *)&offset));
ok(SUCCEEDED(hr), "SetTextureStageState failed (%08x)\n", hr);
@@ -14208,9 +14208,9 @@ static void sincos_test(void)
/* Generate a point from -1 to 1 every 0.5 pixels */
for(i = 0; i < 1280; i++) {
- data[i].x = (-640.0 + i) / 640.0;
- data[i].y = 0.0;
- data[i].z = 0.1;
+ data[i].x = (-640.0f + i) / 640.0f;
+ data[i].y = 0.0f;
+ data[i].z = 0.1f;
}
hr = IDirect3DDevice9_BeginScene(device);
@@ -14475,7 +14475,7 @@ static void test_viewport(void)
{ 0.5f, 0.5f, 1.0f},
};
IDirect3DSurface9 *backbuffer;
- const float z_eps = 0.0001;
+ const float z_eps = 0.0001f;
struct surface_readback rb;
IDirect3DDevice9 *device;
BOOL draw_succeeded;
@@ -14655,8 +14655,8 @@ static void depth_clamp_test(void)
vp.Y = 0;
vp.Width = 640;
vp.Height = 480;
- vp.MinZ = 0.0;
- vp.MaxZ = 7.5;
+ vp.MinZ = 0.0f;
+ vp.MaxZ = 7.5f;
hr = IDirect3DDevice9_SetViewport(device, &vp);
if(FAILED(hr))
--
2.34.1
More information about the wine-devel
mailing list