wineoss.drv: Assign to structs instead of using memcpy
Andrew Talbot
andrew.talbot at talbotville.com
Wed Mar 26 16:56:41 CDT 2008
Changelog:
wineoss.drv: Assign to structs instead of using memcpy.
diff --git a/dlls/wineoss.drv/audio.c b/dlls/wineoss.drv/audio.c
index ebd785e..2e22d14 100644
--- a/dlls/wineoss.drv/audio.c
+++ b/dlls/wineoss.drv/audio.c
@@ -2056,7 +2056,7 @@ DWORD wodOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wwo->wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK);
- memcpy(&wwo->waveDesc, lpDesc, sizeof(WAVEOPENDESC));
+ wwo->waveDesc = *lpDesc;
copy_format(lpDesc->lpFormat, &wwo->waveFormat);
if (wwo->waveFormat.Format.wBitsPerSample == 0) {
@@ -2943,7 +2943,7 @@ DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wwi->dwTotalRead = 0;
wwi->wFlags = HIWORD(dwFlags & CALLBACK_TYPEMASK);
- memcpy(&wwi->waveDesc, lpDesc, sizeof(WAVEOPENDESC));
+ wwi->waveDesc = *lpDesc;
copy_format(lpDesc->lpFormat, &wwi->waveFormat);
if (wwi->waveFormat.Format.wBitsPerSample == 0) {
diff --git a/dlls/wineoss.drv/dscapture.c b/dlls/wineoss.drv/dscapture.c
index 0724ea8..a2157ec 100644
--- a/dlls/wineoss.drv/dscapture.c
+++ b/dlls/wineoss.drv/dscapture.c
@@ -769,7 +769,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_GetDriverDesc(
}
/* copy version from driver */
- memcpy(pDesc, &(WInDev[This->wDevID].ossdev.ds_desc), sizeof(DSDRIVERDESC));
+ *pDesc = WInDev[This->wDevID].ossdev.ds_desc;
pDesc->dnDevNode = WInDev[This->wDevID].waveDesc.dnDevNode;
pDesc->wVxdId = 0;
@@ -809,7 +809,7 @@ static HRESULT WINAPI IDsCaptureDriverImpl_GetCaps(
{
IDsCaptureDriverImpl *This = (IDsCaptureDriverImpl *)iface;
TRACE("(%p,%p)\n",This,pCaps);
- memcpy(pCaps, &(WInDev[This->wDevID].ossdev.dsc_caps), sizeof(DSCDRIVERCAPS));
+ *pCaps = WInDev[This->wDevID].ossdev.dsc_caps;
return DS_OK;
}
diff --git a/dlls/wineoss.drv/dsrender.c b/dlls/wineoss.drv/dsrender.c
index 55712c7..dfc636a 100644
--- a/dlls/wineoss.drv/dsrender.c
+++ b/dlls/wineoss.drv/dsrender.c
@@ -710,7 +710,7 @@ static HRESULT WINAPI IDsDriverImpl_GetDriverDesc(PIDSDRIVER iface,
TRACE("(%p,%p)\n",iface,pDesc);
/* copy version from driver */
- memcpy(pDesc, &(WOutDev[This->wDevID].ossdev.ds_desc), sizeof(DSDRIVERDESC));
+ *pDesc = WOutDev[This->wDevID].ossdev.ds_desc;
pDesc->dwFlags |= DSDDESC_DOMMSYSTEMOPEN | DSDDESC_DOMMSYSTEMSETFORMAT |
DSDDESC_USESYSTEMMEMORY | DSDDESC_DONTNEEDPRIMARYLOCK |
@@ -761,7 +761,7 @@ static HRESULT WINAPI IDsDriverImpl_GetCaps(PIDSDRIVER iface, PDSDRIVERCAPS pCap
{
IDsDriverImpl *This = (IDsDriverImpl *)iface;
TRACE("(%p,%p)\n",iface,pCaps);
- memcpy(pCaps, &(WOutDev[This->wDevID].ossdev.ds_caps), sizeof(DSDRIVERCAPS));
+ *pCaps = WOutDev[This->wDevID].ossdev.ds_caps;
return DS_OK;
}
@@ -960,7 +960,7 @@ DWORD wodDsCreate(UINT wDevID, PIDSDRIVER* drv)
DWORD wodDsDesc(UINT wDevID, PDSDRIVERDESC desc)
{
TRACE("(%d,%p)\n",wDevID,desc);
- memcpy(desc, &(WOutDev[wDevID].ossdev.ds_desc), sizeof(DSDRIVERDESC));
+ *desc = WOutDev[wDevID].ossdev.ds_desc;
return MMSYSERR_NOERROR;
}
More information about the wine-patches
mailing list