ddraw/tests: Fix compilation on systems that don't support nameless unions.

This commit is contained in:
Francois Gouget 2011-11-20 22:53:21 +01:00 committed by Alexandre Julliard
parent 02bb70fc3b
commit 3315918eac
2 changed files with 8 additions and 8 deletions

View File

@ -4547,7 +4547,7 @@ static void set_surface_desc_test(void)
IDirectDrawSurface_Release(surface); IDirectDrawSurface_Release(surface);
hr = IDirectDrawSurface3_GetSurfaceDesc(surface3, &ddsd); hr = IDirectDrawSurface3_GetSurfaceDesc(surface3, &ddsd);
ok(SUCCEEDED(hr), "IDirectDrawSurface3_GetSurfaceDesc failed, hr %#x.\n", hr); 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 */ /* Setting width and height is an error */
reset_ddsd(&ddsd); reset_ddsd(&ddsd);
@ -4570,14 +4570,14 @@ static void set_surface_desc_test(void)
/* Setting the pitch is an error */ /* Setting the pitch is an error */
reset_ddsd(&ddsd); reset_ddsd(&ddsd);
ddsd.dwFlags = DDSD_PITCH; ddsd.dwFlags = DDSD_PITCH;
ddsd.lPitch = 1024; U1(ddsd).lPitch = 1024;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc returned %#x, expected %#x\n", hr, DDERR_INVALIDPARAMS); ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc returned %#x, expected %#x\n", hr, DDERR_INVALIDPARAMS);
ddsd.dwFlags = DDSD_PITCH | DDSD_LPSURFACE; ddsd.dwFlags = DDSD_PITCH | DDSD_LPSURFACE;
ddsd.lpSurface = data; ddsd.lpSurface = data;
hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc returned %#x, expected %#x\n", hr, DDERR_INVALIDPARAMS); 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); hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0);
ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc returned %#x, expected %#x\n", hr, DDERR_INVALIDPARAMS); ok(hr == DDERR_INVALIDPARAMS, "SetSurfaceDesc returned %#x, expected %#x\n", hr, DDERR_INVALIDPARAMS);

View File

@ -225,17 +225,17 @@ static void yv12_test(void)
/* Luminance */ /* Luminance */
for (y = 0; y < desc.dwHeight; y++) 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 */ /* V */
for (; y < desc.dwHeight + desc.dwHeight / 4; y++) 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 */ /* U */
for (; y < desc.dwHeight + desc.dwHeight / 2; y++) 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); hr = IDirectDrawSurface7_Unlock(surface, NULL);
@ -276,9 +276,9 @@ static void yv12_test(void)
base = desc.lpSurface; base = desc.lpSurface;
ok(base[0] == 0x10, "Y data is 0x%02x, expected 0x10\n", base[0]); 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]); 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]); todo_wine ok(base[0] == 0x30, "U data is 0x%02x, expected 0x30\n", base[0]);
hr = IDirectDrawSurface7_Unlock(dst, NULL); hr = IDirectDrawSurface7_Unlock(dst, NULL);