Module: wine Branch: master Commit: dd44930b440136dfedccda3785c98fd2b4badaa1 URL: https://gitlab.winehq.org/wine/wine/-/commit/dd44930b440136dfedccda3785c98fd...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Jul 10 17:17:35 2023 +0200
urlmon: Use nameless unions/structs.
---
dlls/urlmon/binding.c | 18 ++++++++---------- dlls/urlmon/http.c | 8 +++----- dlls/urlmon/urlmon_main.c | 32 +++++++++++++++----------------- dlls/urlmon/usrmarshal.c | 12 +++++------- 4 files changed, 31 insertions(+), 39 deletions(-)
diff --git a/dlls/urlmon/binding.c b/dlls/urlmon/binding.c index fd738f6cf0f..07a00558eec 100644 --- a/dlls/urlmon/binding.c +++ b/dlls/urlmon/binding.c @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define NONAMELESSUNION - #include "urlmon_main.h" #include "winreg.h" #include "shlwapi.h" @@ -143,7 +141,7 @@ static void dump_BINDINFO(BINDINFO *bi) "}\n",
bi->cbSize, debugstr_w(bi->szExtraInfo), - bi->stgmedData.tymed, bi->stgmedData.u.hGlobal, bi->stgmedData.pUnkForRelease, + bi->stgmedData.tymed, bi->stgmedData.hGlobal, bi->stgmedData.pUnkForRelease, bi->grfBindInfoF > BINDINFOF_URLENCODEDEXTRAINFO ? "unknown" : BINDINFOF_str[bi->grfBindInfoF], bi->dwBindVerb > BINDVERB_CUSTOM @@ -522,7 +520,7 @@ static HRESULT WINAPI ProtocolStream_Seek(IStream *iface, LARGE_INTEGER dlibMove LARGE_INTEGER new_pos; DWORD method;
- TRACE("(%p)->(%ld %08lx %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition); + TRACE("(%p)->(%ld %08lx %p)\n", This, dlibMove.LowPart, dwOrigin, plibNewPosition);
if(This->buf->file == INVALID_HANDLE_VALUE) { /* We should probably call protocol handler's Seek. */ @@ -558,7 +556,7 @@ static HRESULT WINAPI ProtocolStream_Seek(IStream *iface, LARGE_INTEGER dlibMove static HRESULT WINAPI ProtocolStream_SetSize(IStream *iface, ULARGE_INTEGER libNewSize) { ProtocolStream *This = impl_from_IStream(iface); - FIXME("(%p)->(%ld)\n", This, libNewSize.u.LowPart); + FIXME("(%p)->(%ld)\n", This, libNewSize.LowPart); return E_NOTIMPL; }
@@ -566,7 +564,7 @@ static HRESULT WINAPI ProtocolStream_CopyTo(IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten) { ProtocolStream *This = impl_from_IStream(iface); - FIXME("(%p)->(%p %ld %p %p)\n", This, pstm, cb.u.LowPart, pcbRead, pcbWritten); + FIXME("(%p)->(%p %ld %p %p)\n", This, pstm, cb.LowPart, pcbRead, pcbWritten); return E_NOTIMPL; }
@@ -592,7 +590,7 @@ static HRESULT WINAPI ProtocolStream_LockRegion(IStream *iface, ULARGE_INTEGER l ULARGE_INTEGER cb, DWORD dwLockType) { ProtocolStream *This = impl_from_IStream(iface); - FIXME("(%p)->(%ld %ld %ld)\n", This, libOffset.u.LowPart, cb.u.LowPart, dwLockType); + FIXME("(%p)->(%ld %ld %ld)\n", This, libOffset.LowPart, cb.LowPart, dwLockType); return E_NOTIMPL; }
@@ -600,7 +598,7 @@ static HRESULT WINAPI ProtocolStream_UnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { ProtocolStream *This = impl_from_IStream(iface); - FIXME("(%p)->(%ld %ld %ld)\n", This, libOffset.u.LowPart, cb.u.LowPart, dwLockType); + FIXME("(%p)->(%ld %ld %ld)\n", This, libOffset.LowPart, cb.LowPart, dwLockType); return E_NOTIMPL; }
@@ -669,7 +667,7 @@ static HRESULT stgmed_stream_fill_stgmed(stgmed_obj_t *obj, STGMEDIUM *stgmed) ProtocolStream *stream = (ProtocolStream*)obj;
stgmed->tymed = TYMED_ISTREAM; - stgmed->u.pstm = &stream->IStream_iface; + stgmed->pstm = &stream->IStream_iface; stgmed->pUnkForRelease = &stream->buf->IUnknown_iface;
return S_OK; @@ -735,7 +733,7 @@ static HRESULT stgmed_file_fill_stgmed(stgmed_obj_t *obj, STGMEDIUM *stgmed) read_protocol_data(file_obj->buf);
stgmed->tymed = TYMED_FILE; - stgmed->u.lpszFileName = file_obj->buf->cache_file; + stgmed->lpszFileName = file_obj->buf->cache_file; stgmed->pUnkForRelease = &file_obj->buf->IUnknown_iface;
return S_OK; diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index d1c104fc8e3..a24006ba08c 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -17,8 +17,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define NONAMELESSUNION - #include "urlmon_main.h" #include "wininet.h"
@@ -251,7 +249,7 @@ static ULONG send_http_request(HttpProtocol *This) switch(This->base.bind_info.stgmedData.tymed) { case TYMED_HGLOBAL: /* Native does not use GlobalLock/GlobalUnlock, so we won't either */ - send_buffer.lpvBuffer = This->base.bind_info.stgmedData.u.hGlobal; + send_buffer.lpvBuffer = This->base.bind_info.stgmedData.hGlobal; send_buffer.dwBufferLength = send_buffer.dwBufferTotal = This->base.bind_info.cbstgmedData; break; case TYMED_ISTREAM: { @@ -259,7 +257,7 @@ static ULONG send_http_request(HttpProtocol *This)
send_buffer.dwBufferTotal = This->base.bind_info.cbstgmedData; if(!This->base.post_stream) { - This->base.post_stream = This->base.bind_info.stgmedData.u.pstm; + This->base.post_stream = This->base.bind_info.stgmedData.pstm; IStream_AddRef(This->base.post_stream); }
@@ -791,7 +789,7 @@ static HRESULT WINAPI HttpProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGE DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition) { HttpProtocol *This = impl_from_IInternetProtocolEx(iface); - FIXME("(%p)->(%ld %ld %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition); + FIXME("(%p)->(%ld %ld %p)\n", This, dlibMove.LowPart, dwOrigin, plibNewPosition); return E_NOTIMPL; }
diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c index 00ccc449e15..491313b7cf8 100644 --- a/dlls/urlmon/urlmon_main.c +++ b/dlls/urlmon/urlmon_main.c @@ -20,8 +20,6 @@
#include <stdarg.h>
-#define NONAMELESSUNION - #include "urlmon_main.h"
#include "winreg.h" @@ -598,32 +596,32 @@ HRESULT WINAPI CopyStgMedium(const STGMEDIUM *src, STGMEDIUM *dst) case TYMED_NULL: break; case TYMED_FILE: - if(src->u.lpszFileName && !src->pUnkForRelease) { - DWORD size = (lstrlenW(src->u.lpszFileName)+1)*sizeof(WCHAR); - dst->u.lpszFileName = CoTaskMemAlloc(size); - if(!dst->u.lpszFileName) + if(src->lpszFileName && !src->pUnkForRelease) { + DWORD size = (lstrlenW(src->lpszFileName)+1)*sizeof(WCHAR); + dst->lpszFileName = CoTaskMemAlloc(size); + if(!dst->lpszFileName) return E_OUTOFMEMORY; - memcpy(dst->u.lpszFileName, src->u.lpszFileName, size); + memcpy(dst->lpszFileName, src->lpszFileName, size); } break; case TYMED_ISTREAM: - if(dst->u.pstm) - IStream_AddRef(dst->u.pstm); + if(dst->pstm) + IStream_AddRef(dst->pstm); break; case TYMED_ISTORAGE: - if(dst->u.pstg) - IStorage_AddRef(dst->u.pstg); + if(dst->pstg) + IStorage_AddRef(dst->pstg); break; case TYMED_HGLOBAL: - if(dst->u.hGlobal) { - SIZE_T size = GlobalSize(src->u.hGlobal); + if(dst->hGlobal) { + SIZE_T size = GlobalSize(src->hGlobal); char *src_ptr, *dst_ptr;
- dst->u.hGlobal = GlobalAlloc(GMEM_FIXED, size); - if(!dst->u.hGlobal) + dst->hGlobal = GlobalAlloc(GMEM_FIXED, size); + if(!dst->hGlobal) return E_OUTOFMEMORY; - dst_ptr = GlobalLock(dst->u.hGlobal); - src_ptr = GlobalLock(src->u.hGlobal); + dst_ptr = GlobalLock(dst->hGlobal); + src_ptr = GlobalLock(src->hGlobal); memcpy(dst_ptr, src_ptr, size); GlobalUnlock(src_ptr); GlobalUnlock(dst_ptr); diff --git a/dlls/urlmon/usrmarshal.c b/dlls/urlmon/usrmarshal.c index 950d1a3d67a..57cfaf64ec6 100644 --- a/dlls/urlmon/usrmarshal.c +++ b/dlls/urlmon/usrmarshal.c @@ -16,8 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#define NONAMELESSUNION - #include "urlmon_main.h"
#include "wine/debug.h" @@ -93,7 +91,7 @@ static HRESULT marshal_stgmed(STGMEDIUM *stgmed, RemSTGMEDIUM **ret) ULONG size = 0; HRESULT hres = S_OK;
- if((stgmed->tymed == TYMED_ISTREAM && stgmed->u.pstm) || stgmed->pUnkForRelease) { + if((stgmed->tymed == TYMED_ISTREAM && stgmed->pstm) || stgmed->pUnkForRelease) { hres = CreateStreamOnHGlobal(NULL, TRUE, &stream); if(FAILED(hres)) return hres; @@ -103,8 +101,8 @@ static HRESULT marshal_stgmed(STGMEDIUM *stgmed, RemSTGMEDIUM **ret) case TYMED_NULL: break; case TYMED_ISTREAM: - if(stgmed->u.pstm) - hres = CoMarshalInterface(stream, &IID_IStream, (IUnknown*)stgmed->u.pstm, + if(stgmed->pstm) + hres = CoMarshalInterface(stream, &IID_IStream, (IUnknown*)stgmed->pstm, MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL); break; default: @@ -140,7 +138,7 @@ static HRESULT marshal_stgmed(STGMEDIUM *stgmed, RemSTGMEDIUM **ret)
rem_stgmed->tymed = stgmed->tymed; rem_stgmed->dwHandleType = 0; - rem_stgmed->pData = stgmed->u.pstm != NULL; + rem_stgmed->pData = stgmed->pstm != NULL; rem_stgmed->pUnkForRelease = stgmed->pUnkForRelease != NULL; rem_stgmed->cbData = size; if(stream) { @@ -181,7 +179,7 @@ static HRESULT unmarshal_stgmed(RemSTGMEDIUM *rem_stgmed, STGMEDIUM *stgmed) break; case TYMED_ISTREAM: if(rem_stgmed->pData) - hres = CoUnmarshalInterface(stream, &IID_IStream, (void**)&stgmed->u.pstm); + hres = CoUnmarshalInterface(stream, &IID_IStream, (void**)&stgmed->pstm); break; default: FIXME("unsupported tymed %lu\n", stgmed->tymed);