msi: Assign to structs instead of using memcpy
Andrew Talbot
andrew.talbot at talbotville.com
Thu Mar 6 16:33:47 CST 2008
Changelog:
msi: Assign to structs instead of using memcpy.
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-patches
mailing list