From: Nikolay Sivov Subject: [PATCH 4/5] ole32: Get rid of casts in GUID serialization helper. Message-Id: <20191212104323.102298-4-nsivov@codeweavers.com> Date: Thu, 12 Dec 2019 13:43:22 +0300 In-Reply-To: <20191212104323.102298-1-nsivov@codeweavers.com> References: <20191212104323.102298-1-nsivov@codeweavers.com> Signed-off-by: Nikolay Sivov --- dlls/ole32/stg_prop.c | 6 +++--- dlls/ole32/storage32.c | 4 ++-- dlls/ole32/storage32.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index 79f1c20742..eeda2132dd 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -1711,7 +1711,7 @@ static void PropertyStorage_MakeHeader(PropertyStorage_impl *This, StorageUtl_WriteWord(&hdr->wByteOrder, 0, PROPSETHDR_BYTEORDER_MAGIC); StorageUtl_WriteWord(&hdr->wFormat, 0, This->format); StorageUtl_WriteDWord(&hdr->dwOSVer, 0, This->originatorOS); - StorageUtl_WriteGUID((BYTE *)&hdr->clsid, 0, &This->clsid); + StorageUtl_WriteGUID(&hdr->clsid, 0, &This->clsid); StorageUtl_WriteDWord(&hdr->reserved, 0, 1); } @@ -1719,7 +1719,7 @@ static void PropertyStorage_MakeFmtIdOffset(PropertyStorage_impl *This, FORMATIDOFFSET *fmtOffset) { assert(fmtOffset); - StorageUtl_WriteGUID((BYTE *)fmtOffset, 0, &This->fmtid); + StorageUtl_WriteGUID(fmtOffset, 0, &This->fmtid); StorageUtl_WriteDWord(fmtOffset, offsetof(FORMATIDOFFSET, dwOffset), sizeof(PROPERTYSETHEADER) + sizeof(FORMATIDOFFSET)); } @@ -2008,7 +2008,7 @@ static HRESULT PropertyStorage_WritePropertyToStream(PropertyStorage_impl *This, { CLSID temp; - StorageUtl_WriteGUID((BYTE *)&temp, 0, var->u.puuid); + StorageUtl_WriteGUID(&temp, 0, var->u.puuid); hr = IStream_Write(This->stm, &temp, sizeof(temp), &count); bytesWritten = count; break; diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 6e0a9bb449..5fc1f59b78 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -7005,13 +7005,13 @@ void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) memcpy(value->Data4, buffer+offset+8, sizeof(value->Data4)); } -void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value) +void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value) { StorageUtl_WriteDWord(buffer, offset, value->Data1); StorageUtl_WriteWord(buffer, offset+4, value->Data2); StorageUtl_WriteWord(buffer, offset+6, value->Data3); - memcpy(buffer+offset+8, value->Data4, sizeof(value->Data4)); + memcpy((BYTE *)buffer + offset + 8, value->Data4, sizeof(value->Data4)); } void StorageUtl_CopyDirEntryToSTATSTG( diff --git a/dlls/ole32/storage32.h b/dlls/ole32/storage32.h index 046334b98b..bfd3a3121f 100644 --- a/dlls/ole32/storage32.h +++ b/dlls/ole32/storage32.h @@ -564,7 +564,7 @@ void StorageUtl_ReadULargeInteger(const BYTE* buffer, ULONG offset, void StorageUtl_WriteULargeInteger(BYTE* buffer, ULONG offset, const ULARGE_INTEGER *value) DECLSPEC_HIDDEN; void StorageUtl_ReadGUID(const BYTE* buffer, ULONG offset, GUID* value) DECLSPEC_HIDDEN; -void StorageUtl_WriteGUID(BYTE* buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN; +void StorageUtl_WriteGUID(void *buffer, ULONG offset, const GUID* value) DECLSPEC_HIDDEN; void StorageUtl_CopyDirEntryToSTATSTG(StorageBaseImpl *storage,STATSTG* destination, const DirEntry* source, int statFlags) DECLSPEC_HIDDEN; -- 2.24.0