From 8d555e825b3b3e52269c673fadcef77f71b5883c Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Tue, 12 Feb 2008 21:13:06 +0000 Subject: [PATCH] comctl32: Assign to structs instead of using memcpy. --- dlls/comctl32/comboex.c | 2 +- dlls/comctl32/rebar.c | 4 ++-- dlls/comctl32/toolbar.c | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 379d9649379..a98243d1472 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 fa3033ae108..92c19223d5a 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 6d88461456e..b14b7a7a176 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; } -- 2.11.4.GIT