Commit b723e6f6 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

comctl32: Remove the superfluous casting of the LPVOID returned by Alloc().

parent 2d94915f
...@@ -817,7 +817,7 @@ static BOOL ANIMATE_Create(HWND hWnd, const CREATESTRUCTW *lpcs) ...@@ -817,7 +817,7 @@ static BOOL ANIMATE_Create(HWND hWnd, const CREATESTRUCTW *lpcs)
} }
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (ANIMATE_INFO *)Alloc(sizeof(ANIMATE_INFO)); infoPtr = Alloc(sizeof(ANIMATE_INFO));
if (!infoPtr) return FALSE; if (!infoPtr) return FALSE;
/* store crossref hWnd <-> info structure */ /* store crossref hWnd <-> info structure */
......
...@@ -211,7 +211,7 @@ COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, UINT code, NMCOMBOBOXEXW *hdr) ...@@ -211,7 +211,7 @@ COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, UINT code, NMCOMBOBOXEXW *hdr)
if ((hdr->ceItem.mask & CBEIF_TEXT) && is_textW(wstr)) { if ((hdr->ceItem.mask & CBEIF_TEXT) && is_textW(wstr)) {
len = WideCharToMultiByte (CP_ACP, 0, wstr, -1, 0, 0, NULL, NULL); len = WideCharToMultiByte (CP_ACP, 0, wstr, -1, 0, 0, NULL, NULL);
if (len > 0) { if (len > 0) {
astr = (LPSTR)Alloc ((len + 1)*sizeof(CHAR)); astr = Alloc ((len + 1)*sizeof(CHAR));
if (!astr) return 0; if (!astr) return 0;
WideCharToMultiByte (CP_ACP, 0, wstr, -1, astr, len, 0, 0); WideCharToMultiByte (CP_ACP, 0, wstr, -1, astr, len, 0, 0);
hdr->ceItem.pszText = (LPWSTR)astr; hdr->ceItem.pszText = (LPWSTR)astr;
...@@ -320,7 +320,7 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item) ...@@ -320,7 +320,7 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
if (is_textW(nmce.ceItem.pszText)) { if (is_textW(nmce.ceItem.pszText)) {
len = MultiByteToWideChar (CP_ACP, 0, (LPSTR)nmce.ceItem.pszText, -1, NULL, 0); len = MultiByteToWideChar (CP_ACP, 0, (LPSTR)nmce.ceItem.pszText, -1, NULL, 0);
buf = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); buf = Alloc ((len + 1)*sizeof(WCHAR));
if (buf) if (buf)
MultiByteToWideChar (CP_ACP, 0, (LPSTR)nmce.ceItem.pszText, -1, buf, len); MultiByteToWideChar (CP_ACP, 0, (LPSTR)nmce.ceItem.pszText, -1, buf, len);
if (nmce.ceItem.mask & CBEIF_DI_SETITEM) { if (nmce.ceItem.mask & CBEIF_DI_SETITEM) {
...@@ -622,7 +622,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *ci ...@@ -622,7 +622,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *ci
if (index > infoPtr->nb_items) return -1; if (index > infoPtr->nb_items) return -1;
/* get zero-filled space and chain it in */ /* get zero-filled space and chain it in */
if(!(item = (CBE_ITEMDATA *)Alloc (sizeof(*item)))) return -1; if(!(item = Alloc (sizeof(*item)))) return -1;
/* locate position to insert new item in */ /* locate position to insert new item in */
if (index == infoPtr->nb_items) { if (index == infoPtr->nb_items) {
...@@ -654,7 +654,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *ci ...@@ -654,7 +654,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *ci
if (is_textW(cit->pszText)) len = strlenW (cit->pszText); if (is_textW(cit->pszText)) len = strlenW (cit->pszText);
if (len > 0) { if (len > 0) {
item->pszText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); item->pszText = Alloc ((len + 1)*sizeof(WCHAR));
if (!item->pszText) { if (!item->pszText) {
Free(item); Free(item);
return -1; return -1;
...@@ -700,7 +700,7 @@ static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA const *ci ...@@ -700,7 +700,7 @@ static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA const *ci
memcpy(&citW,cit,sizeof(COMBOBOXEXITEMA)); memcpy(&citW,cit,sizeof(COMBOBOXEXITEMA));
if (cit->mask & CBEIF_TEXT && is_textA(cit->pszText)) { if (cit->mask & CBEIF_TEXT && is_textA(cit->pszText)) {
INT len = MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, NULL, 0); INT len = MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, NULL, 0);
wstr = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); wstr = Alloc ((len + 1)*sizeof(WCHAR));
if (!wstr) return -1; if (!wstr) return -1;
MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len); MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len);
citW.pszText = wstr; citW.pszText = wstr;
...@@ -787,7 +787,7 @@ static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) ...@@ -787,7 +787,7 @@ static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit)
COMBOEX_FreeText(item); COMBOEX_FreeText(item);
if (is_textW(cit->pszText)) len = strlenW(cit->pszText); if (is_textW(cit->pszText)) len = strlenW(cit->pszText);
if (len > 0) { if (len > 0) {
item->pszText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); item->pszText = Alloc ((len + 1)*sizeof(WCHAR));
if (!item->pszText) return FALSE; if (!item->pszText) return FALSE;
strcpyW(item->pszText, cit->pszText); strcpyW(item->pszText, cit->pszText);
} else if (cit->pszText == LPSTR_TEXTCALLBACKW) } else if (cit->pszText == LPSTR_TEXTCALLBACKW)
...@@ -824,7 +824,7 @@ static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA const *cit) ...@@ -824,7 +824,7 @@ static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA const *cit)
memcpy(&citW, cit, sizeof(COMBOBOXEXITEMA)); memcpy(&citW, cit, sizeof(COMBOBOXEXITEMA));
if ((cit->mask & CBEIF_TEXT) && is_textA(cit->pszText)) { if ((cit->mask & CBEIF_TEXT) && is_textA(cit->pszText)) {
INT len = MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, NULL, 0); INT len = MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, NULL, 0);
wstr = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); wstr = Alloc ((len + 1)*sizeof(WCHAR));
if (!wstr) return FALSE; if (!wstr) return FALSE;
MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len); MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len);
citW.pszText = wstr; citW.pszText = wstr;
...@@ -976,7 +976,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs) ...@@ -976,7 +976,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
INT i; INT i;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (COMBOEX_INFO *)Alloc (sizeof(COMBOEX_INFO)); infoPtr = Alloc (sizeof(COMBOEX_INFO));
if (!infoPtr) return -1; if (!infoPtr) return -1;
/* initialize info structure */ /* initialize info structure */
...@@ -1109,7 +1109,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs) ...@@ -1109,7 +1109,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs)
* Create an item structure to represent the data in the * Create an item structure to represent the data in the
* EDIT control. It is allocated zero-filled. * EDIT control. It is allocated zero-filled.
*/ */
infoPtr->edit = (CBE_ITEMDATA *)Alloc (sizeof (CBE_ITEMDATA)); infoPtr->edit = Alloc (sizeof (CBE_ITEMDATA));
if (!infoPtr->edit) { if (!infoPtr->edit) {
COMBOEX_Destroy(infoPtr); COMBOEX_Destroy(infoPtr);
return -1; return -1;
...@@ -1408,7 +1408,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT const *di ...@@ -1408,7 +1408,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT const *di
item->mask &= ~CBEIF_TEXT; item->mask &= ~CBEIF_TEXT;
if( (len = GetWindowTextLengthW(infoPtr->hwndEdit)) ) { if( (len = GetWindowTextLengthW(infoPtr->hwndEdit)) ) {
item->mask |= CBEIF_TEXT; item->mask |= CBEIF_TEXT;
item->pszText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); item->pszText = Alloc ((len + 1)*sizeof(WCHAR));
if (item->pszText) if (item->pszText)
GetWindowTextW(infoPtr->hwndEdit, item->pszText, len+1); GetWindowTextW(infoPtr->hwndEdit, item->pszText, len+1);
......
...@@ -1225,7 +1225,7 @@ static LRESULT ...@@ -1225,7 +1225,7 @@ static LRESULT
DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs) DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
{ {
static const WCHAR SysMonthCal32W[] = { 'S', 'y', 's', 'M', 'o', 'n', 't', 'h', 'C', 'a', 'l', '3', '2', 0 }; static const WCHAR SysMonthCal32W[] = { 'S', 'y', 's', 'M', 'o', 'n', 't', 'h', 'C', 'a', 'l', '3', '2', 0 };
DATETIME_INFO *infoPtr = (DATETIME_INFO *)Alloc (sizeof(DATETIME_INFO)); DATETIME_INFO *infoPtr = Alloc (sizeof(DATETIME_INFO));
STYLESTRUCT ss = { 0, lpcs->style }; STYLESTRUCT ss = { 0, lpcs->style };
if (!infoPtr) return -1; if (!infoPtr) return -1;
...@@ -1234,9 +1234,9 @@ DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs) ...@@ -1234,9 +1234,9 @@ DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
infoPtr->dwStyle = lpcs->style; infoPtr->dwStyle = lpcs->style;
infoPtr->nrFieldsAllocated = 32; infoPtr->nrFieldsAllocated = 32;
infoPtr->fieldspec = (int *) Alloc (infoPtr->nrFieldsAllocated * sizeof(int)); infoPtr->fieldspec = Alloc (infoPtr->nrFieldsAllocated * sizeof(int));
infoPtr->fieldRect = (RECT *) Alloc (infoPtr->nrFieldsAllocated * sizeof(RECT)); infoPtr->fieldRect = Alloc (infoPtr->nrFieldsAllocated * sizeof(RECT));
infoPtr->buflen = (int *) Alloc (infoPtr->nrFieldsAllocated * sizeof(int)); infoPtr->buflen = Alloc (infoPtr->nrFieldsAllocated * sizeof(int));
infoPtr->hwndNotify = lpcs->hwndParent; infoPtr->hwndNotify = lpcs->hwndParent;
infoPtr->select = -1; /* initially, nothing is selected */ infoPtr->select = -1; /* initially, nothing is selected */
infoPtr->bDropdownEnabled = TRUE; infoPtr->bDropdownEnabled = TRUE;
......
...@@ -1454,7 +1454,7 @@ HEADER_Create (HWND hwnd, LPARAM lParam) ...@@ -1454,7 +1454,7 @@ HEADER_Create (HWND hwnd, LPARAM lParam)
HFONT hOldFont; HFONT hOldFont;
HDC hdc; HDC hdc;
infoPtr = (HEADER_INFO *)Alloc (sizeof(HEADER_INFO)); infoPtr = Alloc (sizeof(HEADER_INFO));
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent; infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent;
......
...@@ -411,7 +411,7 @@ HOTKEY_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs) ...@@ -411,7 +411,7 @@ HOTKEY_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs)
dwExStyle | WS_EX_CLIENTEDGE); dwExStyle | WS_EX_CLIENTEDGE);
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (HOTKEY_INFO *)Alloc (sizeof(HOTKEY_INFO)); infoPtr = Alloc (sizeof(HOTKEY_INFO));
SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr);
/* initialize info structure */ /* initialize info structure */
......
...@@ -598,7 +598,7 @@ ImageList_Create (INT cx, INT cy, UINT flags, ...@@ -598,7 +598,7 @@ ImageList_Create (INT cx, INT cy, UINT flags,
TRACE("(%d %d 0x%x %d %d)\n", cx, cy, flags, cInitial, cGrow); TRACE("(%d %d 0x%x %d %d)\n", cx, cy, flags, cInitial, cGrow);
himl = (HIMAGELIST)Alloc (sizeof(struct _IMAGELIST)); himl = Alloc (sizeof(struct _IMAGELIST));
if (!himl) if (!himl)
return NULL; return NULL;
......
...@@ -178,7 +178,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate) ...@@ -178,7 +178,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate)
SetWindowLongW (hwnd, GWL_STYLE, SetWindowLongW (hwnd, GWL_STYLE,
GetWindowLongW(hwnd, GWL_STYLE) & ~WS_BORDER); GetWindowLongW(hwnd, GWL_STYLE) & ~WS_BORDER);
infoPtr = (IPADDRESS_INFO *)Alloc (sizeof(IPADDRESS_INFO)); infoPtr = Alloc (sizeof(IPADDRESS_INFO));
if (!infoPtr) return -1; if (!infoPtr) return -1;
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
......
...@@ -1896,7 +1896,7 @@ MONTHCAL_Create(HWND hwnd, LPARAM lParam) ...@@ -1896,7 +1896,7 @@ MONTHCAL_Create(HWND hwnd, LPARAM lParam)
MONTHCAL_INFO *infoPtr; MONTHCAL_INFO *infoPtr;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr =(MONTHCAL_INFO*)Alloc(sizeof(MONTHCAL_INFO)); infoPtr = Alloc(sizeof(MONTHCAL_INFO));
SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr);
if(infoPtr == NULL) { if(infoPtr == NULL) {
......
...@@ -52,7 +52,7 @@ NATIVEFONT_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -52,7 +52,7 @@ NATIVEFONT_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
NATIVEFONT_INFO *infoPtr; NATIVEFONT_INFO *infoPtr;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (NATIVEFONT_INFO *)Alloc (sizeof(NATIVEFONT_INFO)); infoPtr = Alloc (sizeof(NATIVEFONT_INFO));
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
/* initialize info structure */ /* initialize info structure */
......
...@@ -801,7 +801,7 @@ PAGER_Create (HWND hwnd, const CREATESTRUCTW *lpcs) ...@@ -801,7 +801,7 @@ PAGER_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
PAGER_INFO *infoPtr; PAGER_INFO *infoPtr;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (PAGER_INFO *)Alloc (sizeof(PAGER_INFO)); infoPtr = Alloc (sizeof(PAGER_INFO));
if (!infoPtr) return -1; if (!infoPtr) return -1;
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
......
...@@ -567,7 +567,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, ...@@ -567,7 +567,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message,
SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
/* allocate memory for info struct */ /* allocate memory for info struct */
infoPtr = (PROGRESS_INFO *)Alloc (sizeof(PROGRESS_INFO)); infoPtr = Alloc (sizeof(PROGRESS_INFO));
if (!infoPtr) return -1; if (!infoPtr) return -1;
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
......
...@@ -2277,9 +2277,7 @@ static BOOL PROPSHEET_AddPage(HWND hwndDlg, ...@@ -2277,9 +2277,7 @@ static BOOL PROPSHEET_AddPage(HWND hwndDlg,
/* /*
* Allocate and fill in a new PropPageInfo entry. * Allocate and fill in a new PropPageInfo entry.
*/ */
ppi = (PropPageInfo*) ReAlloc(psInfo->proppage, ppi = ReAlloc(psInfo->proppage, sizeof(PropPageInfo) * (psInfo->nPages + 1));
sizeof(PropPageInfo) *
(psInfo->nPages + 1));
if (!ppi) if (!ppi)
return FALSE; return FALSE;
...@@ -2829,8 +2827,7 @@ INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh) ...@@ -2829,8 +2827,7 @@ INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
PROPSHEET_CollectSheetInfoA(lppsh, psInfo); PROPSHEET_CollectSheetInfoA(lppsh, psInfo);
psInfo->proppage = (PropPageInfo*) Alloc(sizeof(PropPageInfo) * psInfo->proppage = Alloc(sizeof(PropPageInfo) * lppsh->nPages);
lppsh->nPages);
pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp; pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp;
for (n = i = 0; i < lppsh->nPages; i++, n++) for (n = i = 0; i < lppsh->nPages; i++, n++)
...@@ -2872,8 +2869,7 @@ INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh) ...@@ -2872,8 +2869,7 @@ INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
PROPSHEET_CollectSheetInfoW(lppsh, psInfo); PROPSHEET_CollectSheetInfoW(lppsh, psInfo);
psInfo->proppage = (PropPageInfo*) Alloc(sizeof(PropPageInfo) * psInfo->proppage = Alloc(sizeof(PropPageInfo) * lppsh->nPages);
lppsh->nPages);
pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp; pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp;
for (n = i = 0; i < lppsh->nPages; i++, n++) for (n = i = 0; i < lppsh->nPages; i++, n++)
...@@ -3414,7 +3410,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -3414,7 +3410,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_INITDIALOG: case WM_INITDIALOG:
{ {
PropSheetInfo* psInfo = (PropSheetInfo*) lParam; PropSheetInfo* psInfo = (PropSheetInfo*) lParam;
WCHAR* strCaption = (WCHAR*)Alloc(MAX_CAPTION_LENGTH*sizeof(WCHAR)); WCHAR* strCaption = Alloc(MAX_CAPTION_LENGTH*sizeof(WCHAR));
HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL); HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL);
int idx; int idx;
LOGFONTW logFont; LOGFONTW logFont;
......
...@@ -2595,8 +2595,7 @@ REBAR_MoveBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) ...@@ -2595,8 +2595,7 @@ REBAR_MoveBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
} }
/* allocate new space and copy rest of bands into it */ /* allocate new space and copy rest of bands into it */
infoPtr->bands = infoPtr->bands = Alloc ((infoPtr->uNumBands)*sizeof(REBAR_BAND));
(REBAR_BAND *)Alloc ((infoPtr->uNumBands)*sizeof(REBAR_BAND));
/* pre insert copy */ /* pre insert copy */
if (uTo > 0) { if (uTo > 0) {
...@@ -3185,7 +3184,7 @@ REBAR_NCCreate (HWND hwnd, LPARAM lParam) ...@@ -3185,7 +3184,7 @@ REBAR_NCCreate (HWND hwnd, LPARAM lParam)
} }
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (REBAR_INFO *)Alloc (sizeof(REBAR_INFO)); infoPtr = Alloc (sizeof(REBAR_INFO));
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
/* initialize info structure - initial values are 0 */ /* initialize info structure - initial values are 0 */
......
...@@ -907,7 +907,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate) ...@@ -907,7 +907,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
int len; int len;
TRACE("\n"); TRACE("\n");
infoPtr = (STATUS_INFO*)Alloc (sizeof(STATUS_INFO)); infoPtr = Alloc (sizeof(STATUS_INFO));
if (!infoPtr) goto create_fail; if (!infoPtr) goto create_fail;
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
......
...@@ -2939,7 +2939,7 @@ static LRESULT TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -2939,7 +2939,7 @@ static LRESULT TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
HFONT hOldFont; HFONT hOldFont;
DWORD dwStyle; DWORD dwStyle;
infoPtr = (TAB_INFO *)Alloc (sizeof(TAB_INFO)); infoPtr = Alloc (sizeof(TAB_INFO));
SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr);
......
...@@ -2085,7 +2085,7 @@ static void TOOLBAR_Cust_AddButton(const CUSTDLG_INFO *custInfo, HWND hwnd, INT ...@@ -2085,7 +2085,7 @@ static void TOOLBAR_Cust_AddButton(const CUSTDLG_INFO *custInfo, HWND hwnd, INT
PCUSTOMBUTTON btnNew; PCUSTOMBUTTON btnNew;
/* duplicate 'separator' button */ /* duplicate 'separator' button */
btnNew = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); btnNew = Alloc(sizeof(CUSTOMBUTTON));
*btnNew = *btnInfo; *btnNew = *btnInfo;
btnInfo = btnNew; btnInfo = btnNew;
} }
...@@ -2308,7 +2308,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -2308,7 +2308,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/* add items to 'toolbar buttons' list and check if removable */ /* add items to 'toolbar buttons' list and check if removable */
for (i = 0; i < custInfo->tbInfo->nNumButtons; i++) for (i = 0; i < custInfo->tbInfo->nNumButtons; i++)
{ {
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); btnInfo = Alloc(sizeof(CUSTOMBUTTON));
memset (&btnInfo->btn, 0, sizeof(TBBUTTON)); memset (&btnInfo->btn, 0, sizeof(TBBUTTON));
btnInfo->btn.fsStyle = BTNS_SEP; btnInfo->btn.fsStyle = BTNS_SEP;
btnInfo->bVirtual = FALSE; btnInfo->bVirtual = FALSE;
...@@ -2324,7 +2324,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -2324,7 +2324,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SendDlgItemMessageW (hwnd, IDC_TOOLBARBTN_LBOX, LB_SETITEMHEIGHT, 0, infoPtr->nBitmapHeight + 8); SendDlgItemMessageW (hwnd, IDC_TOOLBARBTN_LBOX, LB_SETITEMHEIGHT, 0, infoPtr->nBitmapHeight + 8);
/* insert separator button into 'available buttons' list */ /* insert separator button into 'available buttons' list */
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); btnInfo = Alloc(sizeof(CUSTOMBUTTON));
memset (&btnInfo->btn, 0, sizeof(TBBUTTON)); memset (&btnInfo->btn, 0, sizeof(TBBUTTON));
btnInfo->btn.fsStyle = BTNS_SEP; btnInfo->btn.fsStyle = BTNS_SEP;
btnInfo->bVirtual = FALSE; btnInfo->bVirtual = FALSE;
...@@ -2359,7 +2359,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -2359,7 +2359,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
index = TOOLBAR_GetButtonIndex (custInfo->tbInfo, nmtb.tbButton.idCommand, FALSE); index = TOOLBAR_GetButtonIndex (custInfo->tbInfo, nmtb.tbButton.idCommand, FALSE);
if (index == -1) if (index == -1)
{ {
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); btnInfo = Alloc(sizeof(CUSTOMBUTTON));
btnInfo->bVirtual = FALSE; btnInfo->bVirtual = FALSE;
btnInfo->bRemovable = TRUE; btnInfo->bRemovable = TRUE;
} }
...@@ -2392,7 +2392,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -2392,7 +2392,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
SendDlgItemMessageW (hwnd, IDC_AVAILBTN_LBOX, LB_SETCURSEL, 0, 0); SendDlgItemMessageW (hwnd, IDC_AVAILBTN_LBOX, LB_SETCURSEL, 0, 0);
/* append 'virtual' separator button to the 'toolbar buttons' list */ /* append 'virtual' separator button to the 'toolbar buttons' list */
btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); btnInfo = Alloc(sizeof(CUSTOMBUTTON));
memset (&btnInfo->btn, 0, sizeof(TBBUTTON)); memset (&btnInfo->btn, 0, sizeof(TBBUTTON));
btnInfo->btn.fsStyle = BTNS_SEP; btnInfo->btn.fsStyle = BTNS_SEP;
btnInfo->bVirtual = TRUE; btnInfo->bVirtual = TRUE;
...@@ -6157,7 +6157,7 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -6157,7 +6157,7 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
DWORD styleadd = 0; DWORD styleadd = 0;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (TOOLBAR_INFO *)Alloc (sizeof(TOOLBAR_INFO)); infoPtr = Alloc (sizeof(TOOLBAR_INFO));
SetWindowLongPtrW (hwnd, 0, (LONG_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (LONG_PTR)infoPtr);
/* paranoid!! */ /* paranoid!! */
...@@ -7103,7 +7103,7 @@ static HIMAGELIST TOOLBAR_InsertImageList(PIMLENTRY **pies, INT *cies, HIMAGELIS ...@@ -7103,7 +7103,7 @@ static HIMAGELIST TOOLBAR_InsertImageList(PIMLENTRY **pies, INT *cies, HIMAGELIS
{ {
PIMLENTRY *pnies; PIMLENTRY *pnies;
c = (PIMLENTRY) Alloc(sizeof(IMLENTRY)); c = Alloc(sizeof(IMLENTRY));
c->id = id; c->id = id;
pnies = Alloc((*cies + 1) * sizeof(PIMLENTRY)); pnies = Alloc((*cies + 1) * sizeof(PIMLENTRY));
......
...@@ -2351,7 +2351,7 @@ TOOLTIPS_Create (HWND hwnd, const CREATESTRUCTW *lpcs) ...@@ -2351,7 +2351,7 @@ TOOLTIPS_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
TOOLTIPS_INFO *infoPtr; TOOLTIPS_INFO *infoPtr;
/* allocate memory for info structure */ /* allocate memory for info structure */
infoPtr = (TOOLTIPS_INFO *)Alloc (sizeof(TOOLTIPS_INFO)); infoPtr = Alloc (sizeof(TOOLTIPS_INFO));
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
/* initialize info structure */ /* initialize info structure */
......
...@@ -1397,7 +1397,7 @@ TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs) ...@@ -1397,7 +1397,7 @@ TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs)
TRACKBAR_INFO *infoPtr; TRACKBAR_INFO *infoPtr;
DWORD dwStyle; DWORD dwStyle;
infoPtr = (TRACKBAR_INFO *)Alloc (sizeof(TRACKBAR_INFO)); infoPtr = Alloc (sizeof(TRACKBAR_INFO));
if (!infoPtr) return -1; if (!infoPtr) return -1;
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
......
...@@ -751,7 +751,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, ...@@ -751,7 +751,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
(LPSTR)callback.item.pszText, -1, (LPSTR)callback.item.pszText, -1,
NULL, 0); NULL, 0);
buflen = max((len)*sizeof(WCHAR), TEXT_CALLBACK_SIZE); buflen = max((len)*sizeof(WCHAR), TEXT_CALLBACK_SIZE);
newText = (LPWSTR)ReAlloc(wineItem->pszText, buflen); newText = ReAlloc(wineItem->pszText, buflen);
TRACE("returned str %s, len=%d, buflen=%d\n", TRACE("returned str %s, len=%d, buflen=%d\n",
debugstr_a((LPSTR)callback.item.pszText), len, buflen); debugstr_a((LPSTR)callback.item.pszText), len, buflen);
...@@ -793,7 +793,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, ...@@ -793,7 +793,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
(LPSTR)callback.item.pszText, -1, (LPSTR)callback.item.pszText, -1,
NULL, 0); NULL, 0);
buflen = max((len)*sizeof(WCHAR), TEXT_CALLBACK_SIZE); buflen = max((len)*sizeof(WCHAR), TEXT_CALLBACK_SIZE);
newText = (LPWSTR)Alloc(buflen); newText = Alloc(buflen);
TRACE("same buffer str %s, len=%d, buflen=%d\n", TRACE("same buffer str %s, len=%d, buflen=%d\n",
debugstr_a((LPSTR)callback.item.pszText), len, buflen); debugstr_a((LPSTR)callback.item.pszText), len, buflen);
...@@ -4896,7 +4896,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) ...@@ -4896,7 +4896,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
TRACE("wnd %p, style %x\n", hwnd, GetWindowLongW(hwnd, GWL_STYLE)); TRACE("wnd %p, style %x\n", hwnd, GetWindowLongW(hwnd, GWL_STYLE));
infoPtr = (TREEVIEW_INFO *)Alloc(sizeof(TREEVIEW_INFO)); infoPtr = Alloc(sizeof(TREEVIEW_INFO));
if (infoPtr == NULL) if (infoPtr == NULL)
{ {
......
...@@ -828,7 +828,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L ...@@ -828,7 +828,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
switch(message) switch(message)
{ {
case WM_CREATE: case WM_CREATE:
infoPtr = (UPDOWN_INFO*)Alloc (sizeof(UPDOWN_INFO)); infoPtr = Alloc (sizeof(UPDOWN_INFO));
SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
/* initialize the info struct */ /* initialize the info struct */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment