comctl32: Assign to structs instead of using memcpy
Andrew Talbot
andrew.talbot at talbotville.com
Tue Feb 12 15:13:06 CST 2008
Changelog:
comctl32: Assign to structs instead of using memcpy.
diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c
index 379d964..a98243d 100644
--- a/dlls/comctl32/comboex.c
+++ b/dlls/comctl32/comboex.c
@@ -243,7 +243,7 @@ static INT COMBOEX_NotifyEndEdit (COMBOEX_INFO *infoPtr, NMCBEENDEDITW *neew, LP
} else {
NMCBEENDEDITA neea;
- memcpy (&neea.hdr, &neew->hdr, sizeof(NMHDR));
+ neea.hdr = neew->hdr;
neea.fChanged = neew->fChanged;
neea.iNewSelection = neew->iNewSelection;
WideCharToMultiByte (CP_ACP, 0, wstr, -1, neea.szText, CBEMAXSTRLEN, 0, 0);
diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c
index fa3033a..92c1922 100644
--- a/dlls/comctl32/rebar.c
+++ b/dlls/comctl32/rebar.c
@@ -2423,7 +2423,7 @@ REBAR_MoveBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
}
/* save one to be moved */
- memcpy (&holder, &oldBands[uFrom], sizeof(REBAR_BAND));
+ holder = oldBands[uFrom];
/* close up rest of bands (pseudo delete) */
if (uFrom < infoPtr->uNumBands - 1) {
@@ -2442,7 +2442,7 @@ REBAR_MoveBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
}
/* set moved band */
- memcpy (&infoPtr->bands[uTo], &holder, sizeof(REBAR_BAND));
+ infoPtr->bands[uTo] = holder;
/* post copy */
if (uTo < infoPtr->uNumBands - 1) {
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index 6d88461..b14b7a7 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -2087,7 +2087,7 @@ static void TOOLBAR_Cust_AddButton(const CUSTDLG_INFO *custInfo, HWND hwnd, INT
/* duplicate 'separator' button */
btnNew = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON));
- memcpy(btnNew, btnInfo, sizeof(CUSTOMBUTTON));
+ *btnNew = *btnInfo;
btnInfo = btnNew;
}
@@ -2370,7 +2370,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
IDC_TOOLBARBTN_LBOX, LB_GETITEMDATA, index, 0);
}
- memcpy (&btnInfo->btn, &nmtb.tbButton, sizeof(TBBUTTON));
+ btnInfo->btn = nmtb.tbButton;
if (!(nmtb.tbButton.fsStyle & BTNS_SEP))
{
if (lstrlenW(nmtb.pszText))
@@ -6455,7 +6455,7 @@ TOOLBAR_Paint (HWND hwnd, WPARAM wParam)
PAINTSTRUCT ps;
/* fill ps.rcPaint with a default rect */
- memcpy(&(ps.rcPaint), &(infoPtr->rcBound), sizeof(infoPtr->rcBound));
+ ps.rcPaint = infoPtr->rcBound;
hdc = wParam==0 ? BeginPaint(hwnd, &ps) : (HDC)wParam;
@@ -7179,7 +7179,7 @@ static BOOL TOOLBAR_GetButtonInfo(const TOOLBAR_INFO *infoPtr, NMTOOLBARW *nmtb)
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)nmtba.pszText, -1,
nmtb->pszText, nmtb->cchText);
- memcpy(&nmtb->tbButton, &nmtba.tbButton, sizeof(TBBUTTON));
+ nmtb->tbButton = nmtba.tbButton;
bRet = TRUE;
}
More information about the wine-patches
mailing list