From 3315918eaccfbcd8296e161f189e0ecb529dbe89 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Sun, 20 Nov 2011 22:53:21 +0100 Subject: [PATCH] ddraw/tests: Fix compilation on systems that don't support nameless unions. --- dlls/ddraw/tests/dsurface.c | 6 +++--- dlls/ddraw/tests/overlay.c | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/ddraw/tests/dsurface.c b/dlls/ddraw/tests/dsurface.c index ca9d3b75309..9bf5643d1f5 100644 --- a/dlls/ddraw/tests/dsurface.c +++ b/dlls/ddraw/tests/dsurface.c @@ -4547,7 +4547,7 @@ static void set_surface_desc_test(void) IDirectDrawSurface_Release(surface); hr = IDirectDrawSurface3_GetSurfaceDesc(surface3, &ddsd); ok(SUCCEEDED(hr), "IDirectDrawSurface3_GetSurfaceDesc failed, hr %#x.\n", hr); - old_pitch = ddsd.lPitch; + old_pitch = U1(ddsd).lPitch; /* Setting width and height is an error */ reset_ddsd(&ddsd); @@ -4570,14 +4570,14 @@ static void set_surface_desc_test(void) /* Setting the pitch is an error */ reset_ddsd(&ddsd); ddsd.dwFlags = DDSD_PITCH; - ddsd.lPitch = 1024; + U1(ddsd).lPitch = 1024; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc returned %#x, expected %#x\n", hr, DDERR_INVALIDPARAMS); ddsd.dwFlags = DDSD_PITCH | DDSD_LPSURFACE; ddsd.lpSurface = data; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc returned %#x, expected %#x\n", hr, DDERR_INVALIDPARAMS); - ddsd.lPitch = old_pitch; + U1(ddsd).lPitch = old_pitch; hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc returned %#x, expected %#x\n", hr, DDERR_INVALIDPARAMS); diff --git a/dlls/ddraw/tests/overlay.c b/dlls/ddraw/tests/overlay.c index 64d00638eaa..2cf48c7fd95 100644 --- a/dlls/ddraw/tests/overlay.c +++ b/dlls/ddraw/tests/overlay.c @@ -225,17 +225,17 @@ static void yv12_test(void) /* Luminance */ for (y = 0; y < desc.dwHeight; y++) { - memset(base + desc.lPitch * y, 0x10, desc.dwWidth); + memset(base + U1(desc).lPitch * y, 0x10, desc.dwWidth); } /* V */ for (; y < desc.dwHeight + desc.dwHeight / 4; y++) { - memset(base + desc.lPitch * y, 0x20, desc.dwWidth); + memset(base + U1(desc).lPitch * y, 0x20, desc.dwWidth); } /* U */ for (; y < desc.dwHeight + desc.dwHeight / 2; y++) { - memset(base + desc.lPitch * y, 0x30, desc.dwWidth); + memset(base + U1(desc).lPitch * y, 0x30, desc.dwWidth); } hr = IDirectDrawSurface7_Unlock(surface, NULL); @@ -276,9 +276,9 @@ static void yv12_test(void) base = desc.lpSurface; ok(base[0] == 0x10, "Y data is 0x%02x, expected 0x10\n", base[0]); - base += desc.dwHeight * desc.lPitch; + base += desc.dwHeight * U1(desc).lPitch; todo_wine ok(base[0] == 0x20, "V data is 0x%02x, expected 0x20\n", base[0]); - base += desc.dwHeight / 4 * desc.lPitch; + base += desc.dwHeight / 4 * U1(desc).lPitch; todo_wine ok(base[0] == 0x30, "U data is 0x%02x, expected 0x30\n", base[0]); hr = IDirectDrawSurface7_Unlock(dst, NULL);