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

Alexandre Julliard julliard at winehq.org
Fri Mar 7 05:30:10 CST 2008


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

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Thu Mar  6 22:33:47 2008 +0000

msi: Assign to structs instead of using memcpy.

---

 dlls/msi/suminfo.c |    8 ++++----
 dlls/msi/table.c   |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/dlls/msi/suminfo.c b/dlls/msi/suminfo.c
index 5dd3297..d78e8ad 100644
--- a/dlls/msi/suminfo.c
+++ b/dlls/msi/suminfo.c
@@ -232,7 +232,7 @@ static void read_properties_from_data( PROPVARIANT *prop, LPBYTE data, DWORD sz
         else
             ptr = &property;
 
-        memcpy(&prop[ idofs[i].propid ], ptr, sizeof(PROPVARIANT));
+        prop[ idofs[i].propid ] = *ptr;
     }
 }
 
@@ -387,7 +387,7 @@ static UINT save_summary_info( const MSISUMMARYINFO * si, IStream *stm )
 
     /* write the format header */
     sz = sizeof format_hdr;
-    memcpy( &format_hdr.fmtid, &FMTID_SummaryInformation, sizeof (FMTID) );
+    format_hdr.fmtid = FMTID_SummaryInformation;
     format_hdr.dwOffset = sizeof format_hdr + sizeof set_hdr;
     r = IStream_Write( stm, &format_hdr, sz, &count );
     if( FAILED(r) || count != sz )
@@ -624,7 +624,7 @@ static UINT get_prop( MSIHANDLE handle, UINT uiProperty, UINT *puiDataType,
         break;
     case VT_FILETIME:
         if( pftValue )
-            memcpy(pftValue, &prop->u.filetime, sizeof (FILETIME) );
+            *pftValue = prop->u.filetime;
         break;
     case VT_EMPTY:
         break;
@@ -745,7 +745,7 @@ static UINT set_prop( MSIHANDLE handle, UINT uiProperty, UINT uiDataType,
         prop->u.iVal = iValue;
         break;
     case VT_FILETIME:
-        memcpy( &prop->u.filetime, pftValue, sizeof prop->u.filetime );
+        prop->u.filetime = *pftValue;
         break;
     case VT_LPSTR:
         if( str->unicode )
diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index 69108ef..a8f0f40 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -923,7 +923,7 @@ static UINT get_defaulttablecolumns( LPCWSTR name, MSICOLUMNINFO *colinfo, UINT
     {
         if (colinfo && (i < *sz) )
         {
-            memcpy( &colinfo[i], &p[i], sizeof(MSICOLUMNINFO) );
+            colinfo[i] = p[i];
             colinfo[i].tablename = strdupW( p[i].tablename );
             colinfo[i].colname = strdupW( p[i].colname );
         }




More information about the wine-cvs mailing list