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

Alexandre Julliard julliard at winehq.org
Mon Sep 8 07:41:28 CDT 2008


Module: wine
Branch: master
Commit: 7dd099416e380a44bf2382ac9b31d9213824fe37
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7dd099416e380a44bf2382ac9b31d9213824fe37

Author: Francois Gouget <fgouget at free.fr>
Date:   Sun Sep  7 21:13:19 2008 +0200

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

---

 dlls/ddraw/tests/overlay.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/dlls/ddraw/tests/overlay.c b/dlls/ddraw/tests/overlay.c
index 10f66b4..b99d228 100644
--- a/dlls/ddraw/tests/overlay.c
+++ b/dlls/ddraw/tests/overlay.c
@@ -40,9 +40,9 @@ static IDirectDrawSurface7 *create_overlay(DWORD width, DWORD height, DWORD form
     ddsd.dwWidth = width;
     ddsd.dwHeight = height;
     ddsd.ddsCaps.dwCaps = DDSCAPS_OVERLAY;
-    ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
-    ddsd.ddpfPixelFormat.dwFlags = DDPF_FOURCC;
-    ddsd.ddpfPixelFormat.dwFourCC = format;
+    U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
+    U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_FOURCC;
+    U4(ddsd).ddpfPixelFormat.dwFourCC = format;
     hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &ret, NULL);
     if(FAILED(hr)) return NULL;
     else return ret;
@@ -158,13 +158,13 @@ static void offscreen_test(void) {
     ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT;
     ddsd.dwWidth = 64;
     ddsd.dwHeight = 64;
-    ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat);
-    ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
-    ddsd.ddpfPixelFormat.dwFourCC = 0;
-    ddsd.ddpfPixelFormat.dwRGBBitCount = 16;
-    ddsd.ddpfPixelFormat.dwRBitMask = 0xF800;
-    ddsd.ddpfPixelFormat.dwGBitMask = 0x07e0;
-    ddsd.ddpfPixelFormat.dwBBitMask = 0x001F;
+    U4(ddsd).ddpfPixelFormat.dwSize = sizeof(U4(ddsd).ddpfPixelFormat);
+    U4(ddsd).ddpfPixelFormat.dwFlags = DDPF_RGB;
+    U4(ddsd).ddpfPixelFormat.dwFourCC = 0;
+    U1(U4(ddsd).ddpfPixelFormat).dwRGBBitCount = 16;
+    U2(U4(ddsd).ddpfPixelFormat).dwRBitMask = 0xF800;
+    U3(U4(ddsd).ddpfPixelFormat).dwGBitMask = 0x07e0;
+    U4(U4(ddsd).ddpfPixelFormat).dwBBitMask = 0x001F;
     ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
     hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &offscreen, NULL);
     ok(hr == DD_OK, "IDirectDraw7_CreateSurface failed with hr=0x%08x\n", hr);
@@ -204,7 +204,7 @@ static void yv12_test(void)
     ok(desc.dwWidth == 256 && desc.dwHeight == 256, "Expected size 64x64, got %ux%u\n",
        desc.dwWidth, desc.dwHeight);
     /* The overlay pitch seems to have 256 byte alignment */
-    ok(desc.lPitch == 256, "Unexpected pitch %u, expected 256\n", desc.lPitch);
+    ok(U1(desc).lPitch == 256, "Unexpected pitch %u, expected 256\n", U1(desc).lPitch);
 
     hr = IDirectDrawSurface7_Unlock(surface, NULL);
     ok(hr == DD_OK, "IDirectDrawSurface7_Unlock returned 0x%08x, expected DD_OK\n", hr);




More information about the wine-cvs mailing list