Module: wine Branch: master Commit: dd1625476f11327df6891463501d12900ddbfb32 URL: https://gitlab.winehq.org/wine/wine/-/commit/dd1625476f11327df6891463501d129...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Jul 4 12:59:23 2023 +0200
shell32/tests: Use nameless unions/structs.
---
dlls/shell32/tests/shelldispatch.c | 3 --- dlls/shell32/tests/shellole.c | 3 +-- dlls/shell32/tests/shfldr_special.c | 9 +++------ dlls/shell32/tests/shlexec.c | 6 +++--- dlls/shell32/tests/shlfolder.c | 10 +++++----- dlls/shell32/tests/string.c | 8 ++++---- 6 files changed, 16 insertions(+), 23 deletions(-)
diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c index 67659f72345..7dfbd476372 100644 --- a/dlls/shell32/tests/shelldispatch.c +++ b/dlls/shell32/tests/shelldispatch.c @@ -19,9 +19,6 @@ */
#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - #include "shldisp.h" #include "shlobj.h" #include "shlwapi.h" diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 4864d35ea9a..5efdb035859 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -18,7 +18,6 @@
#define COBJMACROS #define CONST_VTABLE -#define NONAMELESSUNION
#include <stdio.h> #include <wine/test.h> @@ -117,7 +116,7 @@ static HRESULT WINAPI PropertyStorage_ReadMultiple(IPropertyStorage *This, ULONG ok(rgpropvar != NULL, "rgpropvar = NULL\n");
ok(rgpspec[0].ulKind == PRSPEC_PROPID, "rgpspec[0].ulKind = %ld\n", rgpspec[0].ulKind); - ok(rgpspec[0].u.propid == PID_CODEPAGE, "rgpspec[0].propid = %ld\n", rgpspec[0].u.propid); + ok(rgpspec[0].propid == PID_CODEPAGE, "rgpspec[0].propid = %ld\n", rgpspec[0].propid);
rgpropvar[0].vt = VT_I2; rgpropvar[0].iVal = 1234; diff --git a/dlls/shell32/tests/shfldr_special.c b/dlls/shell32/tests/shfldr_special.c index 22749c231f3..61b6a9309bc 100644 --- a/dlls/shell32/tests/shfldr_special.c +++ b/dlls/shell32/tests/shfldr_special.c @@ -23,9 +23,6 @@ #include <stdio.h>
#define COBJMACROS -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - #define WIN32_LEAN_AND_MEAN #include <windows.h> #include "shellapi.h" @@ -233,10 +230,10 @@ if (0) hr = IShellFolder2_GetDefaultColumnState(folder, 6, &state); ok(broken(hr == E_NOTIMPL) || hr == E_INVALIDARG /* Win7 */, "got 0x%08lx\n", hr);
- details.str.u.pOleStr = NULL; + details.str.pOleStr = NULL; hr = IShellFolder2_GetDetailsOf(folder, NULL, 0, &details); ok(hr == S_OK || broken(hr == E_NOTIMPL) /* W2K */, "got 0x%08lx\n", hr); - if (SHELL_OsIsUnicode()) SHFree(details.str.u.pOleStr); + if (SHELL_OsIsUnicode()) SHFree(details.str.pOleStr);
/* test every column if method is implemented */ if (hr == S_OK) @@ -252,7 +249,7 @@ if (0) ok(details.fmt == LVCFMT_LEFT, "got 0x%x\n", details.fmt); /* can't be on w9x at this point, IShellFolder2 unsupported there, check present for running Wine with w9x setup */ - if (SHELL_OsIsUnicode()) SHFree(details.str.u.pOleStr); + if (SHELL_OsIsUnicode()) SHFree(details.str.pOleStr);
hr = IShellFolder2_GetDefaultColumnState(folder, i, &state); ok(hr == S_OK, "got 0x%08lx\n", hr); diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index b84a96a2434..90e96b91586 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -611,7 +611,7 @@ static INT_PTR shell_execute_ex_(const char* file, int line, sei.lpClass=class; sei.hkeyClass=NULL; sei.dwHotKey=0; - U(sei).hIcon=NULL; + sei.hIcon=NULL; sei.hProcess=(HANDLE)0xdeadbeef; /* Out */
DeleteFileA(child_file); @@ -2400,7 +2400,7 @@ static void hook_WaitForInputIdle(DWORD (WINAPI *new_func)(HANDLE, DWORD))
/* Search for the correct imported module by walking the import descriptors */ import_descriptor = (PIMAGE_IMPORT_DESCRIPTOR)(base + import_directory_rva); - while (U(*import_descriptor).OriginalFirstThunk != 0) + while (import_descriptor->OriginalFirstThunk != 0) { char *import_module_name;
@@ -2415,7 +2415,7 @@ static void hook_WaitForInputIdle(DWORD (WINAPI *new_func)(HANDLE, DWORD)) * arrays. We need the import name table to find the imported * routine and the import address table to patch the address, so * walk them side by side */ - int_entry = (PIMAGE_THUNK_DATA)(base + U(*import_descriptor).OriginalFirstThunk); + int_entry = (PIMAGE_THUNK_DATA)(base + import_descriptor->OriginalFirstThunk); iat_entry = (PIMAGE_THUNK_DATA)(base + import_descriptor->FirstThunk); while (int_entry->u1.Ordinal != 0) { diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index be22e577c8b..29785793355 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -4709,16 +4709,16 @@ static void r_verify_pidl(unsigned l, LPCITEMIDLIST pidl, const WCHAR *path) ok_(__FILE__,l)(filename.uType == STRRET_WSTR || filename.uType == STRRET_CSTR, "Got unexpected string type: %d\n", filename.uType); if(filename.uType == STRRET_WSTR){ - ok_(__FILE__,l)(lstrcmpW(path, U(filename).pOleStr) == 0, + ok_(__FILE__,l)(lstrcmpW(path, filename.pOleStr) == 0, "didn't get expected path (%s), instead: %s\n", - wine_dbgstr_w(path), wine_dbgstr_w(U(filename).pOleStr)); - SHFree(U(filename).pOleStr); + wine_dbgstr_w(path), wine_dbgstr_w(filename.pOleStr)); + SHFree(filename.pOleStr); } else if(filename.uType == STRRET_CSTR) { - WCHAR *strW = make_wstr(U(filename).cStr); + WCHAR *strW = make_wstr(filename.cStr); ok_(__FILE__,l)(!lstrcmpW(path, strW), "didn't get expected path (%s), instead: %s\n", - wine_dbgstr_w(path), U(filename).cStr); + wine_dbgstr_w(path), filename.cStr); free(strW); }
diff --git a/dlls/shell32/tests/string.c b/dlls/shell32/tests/string.c index d1d621d9577..d40f6c7fc4f 100644 --- a/dlls/shell32/tests/string.c +++ b/dlls/shell32/tests/string.c @@ -58,21 +58,21 @@ static void test_StrRetToStringNW(void) trace("StrRetToStringNAW is Unicode\n");
strret.uType = STRRET_WSTR; - U(strret).pOleStr = CoDupStrW("Test"); + strret.pOleStr = CoDupStrW("Test"); memset(buff, 0xff, sizeof(buff)); ret = pStrRetToStrNAW(buff, ARRAY_SIZE(buff), &strret, NULL); ok(ret == TRUE && !wcscmp(buff, szTestW), "STRRET_WSTR: dup failed, ret=%d\n", ret);
strret.uType = STRRET_CSTR; - lstrcpyA(U(strret).cStr, "Test"); + lstrcpyA(strret.cStr, "Test"); memset(buff, 0xff, sizeof(buff)); ret = pStrRetToStrNAW(buff, ARRAY_SIZE(buff), &strret, NULL); ok(ret == TRUE && !wcscmp(buff, szTestW), "STRRET_CSTR: dup failed, ret=%d\n", ret);
strret.uType = STRRET_OFFSET; - U(strret).uOffset = 1; + strret.uOffset = 1; strcpy((char*)&iidl, " Test"); memset(buff, 0xff, sizeof(buff)); ret = pStrRetToStrNAW(buff, ARRAY_SIZE(buff), &strret, iidl); @@ -84,7 +84,7 @@ if (0) { /* Invalid dest - should return FALSE, except NT4 does not, so we don't check. */ strret.uType = STRRET_WSTR; - U(strret).pOleStr = CoDupStrW("Test"); + strret.pOleStr = CoDupStrW("Test"); pStrRetToStrNAW(NULL, ARRAY_SIZE(buff), &strret, NULL); trace("NULL dest: ret=%d\n", ret); }