From 598a12a9ab4f34385a0b70a76893967430de17c8 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 24 Mar 2021 18:38:20 +0100 Subject: [PATCH] quartz: Use nameless unions. Signed-off-by: Jacek Caban Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- dlls/quartz/Makefile.in | 1 - dlls/quartz/filtermapper.c | 58 +++++++++++++++++++------------------- dlls/quartz/regsvr.c | 4 +-- 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/dlls/quartz/Makefile.in b/dlls/quartz/Makefile.in index a03d84a7d13..110377bec79 100644 --- a/dlls/quartz/Makefile.in +++ b/dlls/quartz/Makefile.in @@ -1,7 +1,6 @@ MODULE = quartz.dll IMPORTLIB = quartz IMPORTS = strmiids dxguid strmbase uuid dsound msacm32 msvfw32 ole32 oleaut32 rpcrt4 user32 gdi32 advapi32 -EXTRADEFS = -DWINE_NO_NAMELESS_EXTENSION EXTRADLLFLAGS = -mno-cygwin diff --git a/dlls/quartz/filtermapper.c b/dlls/quartz/filtermapper.c index 78353c00534..b3210fdcd59 100644 --- a/dlls/quartz/filtermapper.c +++ b/dlls/quartz/filtermapper.c @@ -597,24 +597,24 @@ static HRESULT FM2_WriteFilterData(const REGFILTER2 * prf2, BYTE **ppData, ULONG rrf.dwVersion = prf2->dwVersion; rrf.dwMerit = prf2->dwMerit; - rrf.dwPins = prf2->u.s2.cPins2; + rrf.dwPins = prf2->cPins2; rrf.dwUnused = 0; add_data(&mainStore, &rrf, sizeof(rrf)); - for (i = 0; i < prf2->u.s2.cPins2; i++) + for (i = 0; i < prf2->cPins2; i++) { size += sizeof(struct REG_RFP); - if (prf2->u.s2.rgPins2[i].clsPinCategory) + if (prf2->rgPins2[i].clsPinCategory) size += sizeof(DWORD); - size += prf2->u.s2.rgPins2[i].nMediaTypes * sizeof(struct REG_TYPE); - size += prf2->u.s2.rgPins2[i].nMediums * sizeof(DWORD); + size += prf2->rgPins2[i].nMediaTypes * sizeof(struct REG_TYPE); + size += prf2->rgPins2[i].nMediums * sizeof(DWORD); } - for (i = 0; i < prf2->u.s2.cPins2; i++) + for (i = 0; i < prf2->cPins2; i++) { struct REG_RFP rrfp; - REGFILTERPINS2 rgPin2 = prf2->u.s2.rgPins2[i]; + REGFILTERPINS2 rgPin2 = prf2->rgPins2[i]; unsigned int j; rrfp.signature[0] = '0'; @@ -716,9 +716,9 @@ static HRESULT FM2_ReadFilterData(BYTE *pData, REGFILTER2 * prf2) prf2->dwVersion = prrf->dwVersion; prf2->dwMerit = prrf->dwMerit; - prf2->u.s2.cPins2 = prrf->dwPins; + prf2->cPins2 = prrf->dwPins; rgPins2 = CoTaskMemAlloc(prrf->dwPins * sizeof(*rgPins2)); - prf2->u.s2.rgPins2 = rgPins2; + prf2->rgPins2 = rgPins2; pCurrent += sizeof(struct REG_RF); for (i = 0; i < prrf->dwPins; i++) @@ -800,20 +800,20 @@ static HRESULT FM2_ReadFilterData(BYTE *pData, REGFILTER2 * prf2) static void FM2_DeleteRegFilter(REGFILTER2 * prf2) { UINT i; - for (i = 0; i < prf2->u.s2.cPins2; i++) + for (i = 0; i < prf2->cPins2; i++) { UINT j; - CoTaskMemFree((void*)prf2->u.s2.rgPins2[i].clsPinCategory); + CoTaskMemFree((void*)prf2->rgPins2[i].clsPinCategory); - for (j = 0; j < prf2->u.s2.rgPins2[i].nMediaTypes; j++) + for (j = 0; j < prf2->rgPins2[i].nMediaTypes; j++) { - CoTaskMemFree((LPVOID)prf2->u.s2.rgPins2[i].lpMediaType[j].clsMajorType); - CoTaskMemFree((LPVOID)prf2->u.s2.rgPins2[i].lpMediaType[j].clsMinorType); + CoTaskMemFree((LPVOID)prf2->rgPins2[i].lpMediaType[j].clsMajorType); + CoTaskMemFree((LPVOID)prf2->rgPins2[i].lpMediaType[j].clsMinorType); } - CoTaskMemFree((LPVOID)prf2->u.s2.rgPins2[i].lpMediaType); - CoTaskMemFree((LPVOID)prf2->u.s2.rgPins2[i].lpMedium); + CoTaskMemFree((LPVOID)prf2->rgPins2[i].lpMediaType); + CoTaskMemFree((LPVOID)prf2->rgPins2[i].lpMedium); } - CoTaskMemFree((LPVOID)prf2->u.s2.rgPins2); + CoTaskMemFree((LPVOID)prf2->rgPins2); } static HRESULT WINAPI FilterMapper3_RegisterFilter(IFilterMapper3 *iface, @@ -848,24 +848,24 @@ static HRESULT WINAPI FilterMapper3_RegisterFilter(IFilterMapper3 *iface, /* REGFILTER2 structure is converted from version 1 to 2. Tested on Win2k. */ regfilter2.dwVersion = 2; regfilter2.dwMerit = prf2->dwMerit; - regfilter2.u.s2.cPins2 = prf2->u.s1.cPins; - pregfp2 = CoTaskMemAlloc(prf2->u.s1.cPins * sizeof(REGFILTERPINS2)); - regfilter2.u.s2.rgPins2 = pregfp2; - for (i = 0; i < prf2->u.s1.cPins; i++) + regfilter2.cPins2 = prf2->cPins; + pregfp2 = CoTaskMemAlloc(prf2->cPins * sizeof(REGFILTERPINS2)); + regfilter2.rgPins2 = pregfp2; + for (i = 0; i < prf2->cPins; i++) { flags = 0; - if (prf2->u.s1.rgPins[i].bRendered) + if (prf2->rgPins[i].bRendered) flags |= REG_PINFLAG_B_RENDERER; - if (prf2->u.s1.rgPins[i].bOutput) + if (prf2->rgPins[i].bOutput) flags |= REG_PINFLAG_B_OUTPUT; - if (prf2->u.s1.rgPins[i].bZero) + if (prf2->rgPins[i].bZero) flags |= REG_PINFLAG_B_ZERO; - if (prf2->u.s1.rgPins[i].bMany) + if (prf2->rgPins[i].bMany) flags |= REG_PINFLAG_B_MANY; pregfp2[i].dwFlags = flags; pregfp2[i].cInstances = 1; - pregfp2[i].nMediaTypes = prf2->u.s1.rgPins[i].nMediaTypes; - pregfp2[i].lpMediaType = prf2->u.s1.rgPins[i].lpMediaType; + pregfp2[i].nMediaTypes = prf2->rgPins[i].nMediaTypes; + pregfp2[i].lpMediaType = prf2->rgPins[i].lpMediaType; pregfp2[i].nMediums = 0; pregfp2[i].lpMedium = NULL; pregfp2[i].clsPinCategory = NULL; @@ -1152,9 +1152,9 @@ static HRESULT WINAPI FilterMapper3_EnumMatchingFilters( /* determine whether filter meets requirements */ if (SUCCEEDED(hrSub) && (rf2.dwMerit >= dwMerit)) { - for (i = 0; (i < rf2.u.s2.cPins2) && (!bInputMatch || !bOutputMatch); i++) + for (i = 0; (i < rf2.cPins2) && (!bInputMatch || !bOutputMatch); i++) { - const REGFILTERPINS2 * rfp2 = rf2.u.s2.rgPins2 + i; + const REGFILTERPINS2 * rfp2 = rf2.rgPins2 + i; bInputMatch = bInputMatch || (!(rfp2->dwFlags & REG_PINFLAG_B_OUTPUT) && (!bRender || (rfp2->dwFlags & REG_PINFLAG_B_RENDERER)) && diff --git a/dlls/quartz/regsvr.c b/dlls/quartz/regsvr.c index 92555630e9e..649e25e7327 100644 --- a/dlls/quartz/regsvr.c +++ b/dlls/quartz/regsvr.c @@ -86,8 +86,8 @@ static HRESULT register_filters(struct regsvr_filter const *list) for (i = 0; list->pins[i].flags != 0xFFFFFFFF; i++) ; rf2.dwVersion = 2; rf2.dwMerit = list->merit; - rf2.u.s2.cPins2 = i; - rf2.u.s2.rgPins2 = prfp2 = CoTaskMemAlloc(i*sizeof(REGFILTERPINS2)); + rf2.cPins2 = i; + rf2.rgPins2 = prfp2 = CoTaskMemAlloc(i*sizeof(REGFILTERPINS2)); if (!prfp2) { hr = E_OUTOFMEMORY; break;