Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
Verified with a stand-alone Visual Studio project. There's also a lower-case _interlockedexchangeadd64 intrinsic for arm, arm64 and x86_64, but not x86. --- include/winnt.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/winnt.h b/include/winnt.h index 18d9fa656f8..66a591ddaf2 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -6292,7 +6292,6 @@ typedef enum _PROCESS_MITIGATION_POLICY #pragma intrinsic(_InterlockedCompareExchange64) #pragma intrinsic(_InterlockedExchange) #pragma intrinsic(_InterlockedExchangeAdd) -#pragma intrinsic(_InterlockedExchangeAdd64) #pragma intrinsic(_InterlockedIncrement) #pragma intrinsic(_InterlockedIncrement16) #pragma intrinsic(_InterlockedDecrement) @@ -6309,7 +6308,6 @@ long _InterlockedDecrement(long volatile*); short _InterlockedDecrement16(short volatile*); long _InterlockedExchange(long volatile*,long); long _InterlockedExchangeAdd(long volatile*,long); -long long _InterlockedExchangeAdd64(long long volatile*,long long); long _InterlockedIncrement(long volatile*); short _InterlockedIncrement16(short volatile*); long _InterlockedOr(long volatile *,long); @@ -6352,9 +6350,11 @@ static FORCEINLINE void MemoryBarrier(void)
#elif defined(__x86_64__)
+#pragma intrinsic(_InterlockedExchangeAdd64) #pragma intrinsic(__faststorefence)
void __faststorefence(void); +long long _InterlockedExchangeAdd64(long long volatile *, long long);
static FORCEINLINE void MemoryBarrier(void) {
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
A few lines earlier we #define InterlockedCompareExchange128 to _InterlockedCompareExchange128, so this inline implementation is just going to cause compile errors. --- include/winnt.h | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/include/winnt.h b/include/winnt.h index 66a591ddaf2..d38336be23b 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -6500,10 +6500,6 @@ static FORCEINLINE void MemoryBarrier(void)
#pragma intrinsic(_InterlockedCompareExchange128) unsigned char _InterlockedCompareExchange128(volatile __int64 *, __int64, __int64, __int64 *); -static FORCEINLINE unsigned char WINAPI InterlockedCompareExchange128( volatile __int64 *dest, __int64 xchg_high, __int64 xchg_low, __int64 *compare ) -{ - return _InterlockedCompareExchange128( dest, xchg_high, xchg_low, compare ); -}
#else
Signed-off-by: Stefan Dösinger stefan@codeweavers.com
---
Those seem just right to fix without making the code uglier. 3 Are left in main where the same iterator is compared to signed and unsigned values. I am leaving those 3 alone since I don't think fixing them improves anything. --- tools/makedep.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/makedep.c b/tools/makedep.c index 4172720fbf0..edb5d5a42d0 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -2036,7 +2036,7 @@ static const char *get_native_unix_lib( const struct makefile *make, const char static struct makefile *get_parent_makefile( struct makefile *make ) { char *dir, *p; - int i; + unsigned int i;
if (!make->obj_dir) return NULL; dir = xstrdup( make->obj_dir ); @@ -3924,7 +3924,7 @@ static void output_testlist( const struct makefile *make ) */ static void output_gitignore( const char *dest, struct strarray files ) { - int i; + unsigned int i;
output_file = create_temp_file( dest );
@@ -4026,7 +4026,8 @@ static void output_top_makefile( struct makefile *make ) { char buffer[1024]; FILE *src_file; - int i, found = 0; + unsigned int i; + int found = 0;
output_file_name = obj_dir_path( make, output_makefile_name ); output_file = create_temp_file( output_file_name );
Signed-off-by: Stefan Dösinger stefan@codeweavers.com --- dlls/d3d9/tests/visual.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 89f9e9cf2c6..f7eb52d1f41 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -88,7 +88,7 @@ static BOOL compare_float(float f, float g, unsigned int ulps) if (y < 0) y = INT_MIN - y;
- if (abs(x - y) > ulps) + if ((unsigned int)abs(x - y) > ulps) return FALSE;
return TRUE; @@ -21950,7 +21950,7 @@ static void test_updatetexture(void) DWORD *ptr = NULL; unsigned int width, height, depth, row_pitch = 0, slice_pitch = 0;
- for (f = 0; f < (texture_types[t].type == D3DRTYPE_CUBETEXTURE ? 6 : 1); ++f) + for (f = 0; f < (texture_types[t].type == D3DRTYPE_CUBETEXTURE ? 6U : 1U); ++f) { width = tests[i].src_width; height = texture_types[t].type != D3DRTYPE_CUBETEXTURE ? tests[i].src_height : tests[i].src_width;
Signed-off-by: Stefan Dösinger stefan@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))