Nikolay Sivov : ole32: Get rid of casts in GUID serialization helper.

Alexandre Julliard julliard at winehq.org
Thu Dec 12 16:29:42 CST 2019


Module: wine
Branch: master
Commit: 31c41d985538bac61efc82f364012e6bbd98b35a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=31c41d985538bac61efc82f364012e6bbd98b35a

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Thu Dec 12 13:43:22 2019 +0300

ole32: Get rid of casts in GUID serialization helper.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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;
 




More information about the wine-cvs mailing list