Module: wine Branch: master Commit: 420a7d06047f8abd001399f682f7e8bcd77f979c URL: https://gitlab.winehq.org/wine/wine/-/commit/420a7d06047f8abd001399f682f7e8b... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Jul 5 10:21:44 2023 +0200 combase: Use nameless union/structs. --- dlls/combase/apartment.c | 2 -- dlls/combase/combase.c | 2 -- dlls/combase/hglobalstream.c | 36 +++++++++++++++++------------------- dlls/combase/usrmarshal.c | 2 -- 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/dlls/combase/apartment.c b/dlls/combase/apartment.c index b951486ee82..d679ef3407a 100644 --- a/dlls/combase/apartment.c +++ b/dlls/combase/apartment.c @@ -27,8 +27,6 @@ #include <assert.h> #define COBJMACROS -#define NONAMELESSUNION - #include "windef.h" #include "winbase.h" #include "servprov.h" diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index d834121e2ef..f1b5828e0f8 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -18,8 +18,6 @@ */ #define COBJMACROS -#define NONAMELESSUNION - #include "ntstatus.h" #define WIN32_NO_STATUS #define USE_COM_CONTEXT_DEF diff --git a/dlls/combase/hglobalstream.c b/dlls/combase/hglobalstream.c index 2f135bcbd74..88491f24e87 100644 --- a/dlls/combase/hglobalstream.c +++ b/dlls/combase/hglobalstream.c @@ -20,8 +20,6 @@ */ #define COBJMACROS -#define NONAMELESSUNION - #include "objbase.h" #include "wine/debug.h" @@ -151,8 +149,8 @@ static HRESULT WINAPI stream_Read(IStream *iface, void *pv, ULONG cb, ULONG *rea if (!read_len) read_len = &dummy; - if (stream->handle->size >= stream->position.u.LowPart) - len = min(stream->handle->size - stream->position.u.LowPart, cb); + if (stream->handle->size >= stream->position.LowPart) + len = min(stream->handle->size - stream->position.LowPart, cb); else len = 0; @@ -164,8 +162,8 @@ static HRESULT WINAPI stream_Read(IStream *iface, void *pv, ULONG cb, ULONG *rea return S_OK; } - memcpy(pv, buffer + stream->position.u.LowPart, len); - stream->position.u.LowPart += len; + memcpy(pv, buffer + stream->position.LowPart, len); + stream->position.LowPart += len; *read_len = len; @@ -191,10 +189,10 @@ static HRESULT WINAPI stream_Write(IStream *iface, const void *pv, ULONG cb, ULO *written = 0; - size.u.HighPart = 0; - size.u.LowPart = stream->position.u.LowPart + cb; + size.HighPart = 0; + size.LowPart = stream->position.LowPart + cb; - if (size.u.LowPart > stream->handle->size) + if (size.LowPart > stream->handle->size) { /* grow stream */ HRESULT hr = IStream_SetSize(iface, size); @@ -212,8 +210,8 @@ static HRESULT WINAPI stream_Write(IStream *iface, const void *pv, ULONG cb, ULO return S_OK; } - memcpy(buffer + stream->position.u.LowPart, pv, cb); - stream->position.u.LowPart += cb; + memcpy(buffer + stream->position.LowPart, pv, cb); + stream->position.LowPart += cb; GlobalUnlock(stream->handle->hglobal); @@ -247,10 +245,10 @@ static HRESULT WINAPI stream_Seek(IStream *iface, LARGE_INTEGER move, DWORD orig goto end; } - position.u.HighPart = 0; - position.u.LowPart += move.QuadPart; + position.HighPart = 0; + position.LowPart += move.QuadPart; - if (move.u.LowPart >= 0x80000000 && position.u.LowPart >= move.u.LowPart) + if (move.LowPart >= 0x80000000 && position.LowPart >= move.LowPart) { /* We tried to seek backwards and went past the start. */ hr = STG_E_SEEKERROR; @@ -272,15 +270,15 @@ static HRESULT WINAPI stream_SetSize(IStream *iface, ULARGE_INTEGER size) TRACE("%p, %s\n", iface, wine_dbgstr_longlong(size.QuadPart)); - if (stream->handle->size == size.u.LowPart) + if (stream->handle->size == size.LowPart) return S_OK; - hglobal = GlobalReAlloc(stream->handle->hglobal, size.u.LowPart, GMEM_MOVEABLE); + hglobal = GlobalReAlloc(stream->handle->hglobal, size.LowPart, GMEM_MOVEABLE); if (!hglobal) return E_OUTOFMEMORY; stream->handle->hglobal = hglobal; - stream->handle->size = size.u.LowPart; + stream->handle->size = size.LowPart; return S_OK; } @@ -292,7 +290,7 @@ static HRESULT WINAPI stream_CopyTo(IStream *iface, IStream *dest, ULARGE_INTEGE HRESULT hr = S_OK; BYTE buffer[128]; - TRACE("%p, %p, %ld, %p, %p\n", iface, dest, cb.u.LowPart, read_len, written); + TRACE("%p, %p, %ld, %p, %p\n", iface, dest, cb.LowPart, read_len, written); if (!dest) return STG_E_INVALIDPOINTER; @@ -302,7 +300,7 @@ static HRESULT WINAPI stream_CopyTo(IStream *iface, IStream *dest, ULARGE_INTEGE while (cb.QuadPart > 0) { - ULONG chunk_size = cb.QuadPart >= sizeof(buffer) ? sizeof(buffer) : cb.u.LowPart; + ULONG chunk_size = cb.QuadPart >= sizeof(buffer) ? sizeof(buffer) : cb.LowPart; ULONG chunk_read, chunk_written; hr = IStream_Read(iface, buffer, chunk_size, &chunk_read); diff --git a/dlls/combase/usrmarshal.c b/dlls/combase/usrmarshal.c index 52891cbf563..87513d335bf 100644 --- a/dlls/combase/usrmarshal.c +++ b/dlls/combase/usrmarshal.c @@ -20,8 +20,6 @@ */ #define COBJMACROS -#define NONAMELESSUNION - #include "ole2.h" #include "wine/debug.h"