Andrew Talbot : itss: Assign to structs instead of using memcpy.

Alexandre Julliard julliard at winehq.org
Sat Mar 1 06:13:21 CST 2008


Module: wine
Branch: master
Commit: f6cbd9a0458fe3ed6d09053579ac104e61df455d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f6cbd9a0458fe3ed6d09053579ac104e61df455d

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Fri Feb 29 22:06:59 2008 +0000

itss: Assign to structs instead of using memcpy.

---

 dlls/itss/moniker.c  |    2 +-
 dlls/itss/protocol.c |    2 +-
 dlls/itss/storage.c  |    6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/itss/moniker.c b/dlls/itss/moniker.c
index d57f381..41e2bda 100644
--- a/dlls/itss/moniker.c
+++ b/dlls/itss/moniker.c
@@ -99,7 +99,7 @@ static HRESULT WINAPI ITS_IMonikerImpl_GetClassID(
     ITS_IMonikerImpl *This = (ITS_IMonikerImpl *)iface;
 
     TRACE("%p %p\n", This, pClassID);
-    memcpy( pClassID, &CLSID_ITStorage, sizeof (CLSID) );
+    *pClassID = CLSID_ITStorage;
     return S_OK;
 }
 
diff --git a/dlls/itss/protocol.c b/dlls/itss/protocol.c
index 8571174..c2277e2 100644
--- a/dlls/itss/protocol.c
+++ b/dlls/itss/protocol.c
@@ -234,7 +234,7 @@ static HRESULT WINAPI ITSProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
 
     release_chm(This); /* Native leaks handle here */
     This->chm_file = chm_file;
-    memcpy(&This->chm_object, &chm_object, sizeof(chm_object));
+    This->chm_object = chm_object;
 
     hres = IInternetProtocolSink_ReportData(pOIProtSink,
             BSCF_FIRSTDATANOTIFICATION|BSCF_DATAFULLYAVAILABLE,
diff --git a/dlls/itss/storage.c b/dlls/itss/storage.c
index 97d7755..de0acfa 100644
--- a/dlls/itss/storage.c
+++ b/dlls/itss/storage.c
@@ -445,7 +445,7 @@ static int ITSS_chm_enumerator(
     TRACE("adding %s to enumeration\n", debugstr_w(ui->path) );
 
     info = HeapAlloc( GetProcessHeap(), 0, sizeof (struct enum_info) );
-    memcpy( &info->ui, ui, sizeof info->ui );
+    info->ui = *ui;
 
     info->next = NULL;
     info->prev = stgenum->last;
@@ -788,7 +788,7 @@ static HRESULT WINAPI ITSS_IStream_Stat(
     pstatstg->type = STGTY_STREAM;
     pstatstg->cbSize.QuadPart = This->ui.length;
     pstatstg->grfMode = STGM_READ;
-    memcpy( &pstatstg->clsid, &CLSID_ITStorage, sizeof (CLSID) );
+    pstatstg->clsid = CLSID_ITStorage;
 
     return S_OK;
 }
@@ -828,7 +828,7 @@ static IStream_Impl *ITSS_create_stream(
     stm->vtbl_IStream = &ITSS_IStream_vtbl;
     stm->ref = 1;
     stm->addr = 0;
-    memcpy( &stm->ui, ui, sizeof stm->ui );
+    stm->ui = *ui;
     stm->stg = stg;
     IStorage_AddRef( (IStorage*) stg );
 




More information about the wine-cvs mailing list