Eliminate casts of the return value of HeapAlloc.
diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c
index f4f9b42..4e2a022 100644
--- a/dlls/shell32/autocomplete.c
+++ b/dlls/shell32/autocomplete.c
@@ -101,8 +101,7 @@
if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
return CLASS_E_NOAGGREGATION;
- lpac = (IAutoCompleteImpl*)HeapAlloc(GetProcessHeap(),
- HEAP_ZERO_MEMORY, sizeof(IAutoCompleteImpl));
+ lpac = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IAutoCompleteImpl));
if (!lpac)
return E_OUTOFMEMORY;
@@ -280,7 +279,7 @@
LONG len;
/* pwszRegKeyPath contains the key as well as the value, so we split */
- key = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR));
+ key = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwzsRegKeyPath)+1)*sizeof(WCHAR));
strcpyW(key, pwzsRegKeyPath);
value = strrchrW(key, '\\');
*value = 0;
@@ -294,7 +293,7 @@
if (res == ERROR_SUCCESS) {
res = RegQueryValueW(hKey, value, result, &len);
if (res == ERROR_SUCCESS) {
- This->quickComplete = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
+ This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(WCHAR));
strcpyW(This->quickComplete, result);
}
RegCloseKey(hKey);
@@ -303,7 +302,7 @@
}
if ((pwszQuickComplete) && (!This->quickComplete)) {
- This->quickComplete = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR));
+ This->quickComplete = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (lstrlenW(pwszQuickComplete)+1)*sizeof(WCHAR));
lstrcpyW(This->quickComplete, pwszQuickComplete);
}
@@ -482,7 +481,7 @@
/* If quickComplete is set and control is pressed, replace the string */
control = GetKeyState(VK_CONTROL) & 0x8000;
if (control && This->quickComplete) {
- hwndQCText = (WCHAR*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
+ hwndQCText = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
(lstrlenW(This->quickComplete)+lstrlenW(hwndText))*sizeof(WCHAR));
sel = sprintfW(hwndQCText, This->quickComplete, hwndText);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)hwndQCText);
@@ -525,7 +524,7 @@
int len;
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL);
- msg = (WCHAR*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
+ msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
SendMessageW(This->hwndListBox, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)msg);
SendMessageW(hwnd, EM_SETSEL, lstrlenW(msg), lstrlenW(msg));
@@ -562,7 +561,7 @@
SendMessageW(This->hwndListBox, LB_RESETCONTENT, 0, 0);
HeapFree(GetProcessHeap(), 0, This->txtbackup);
- This->txtbackup = (WCHAR*) HeapAlloc(GetProcessHeap(),
+ This->txtbackup = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, (lstrlenW(hwndText)+1)*sizeof(WCHAR));
lstrcpyW(This->txtbackup, hwndText);
@@ -631,7 +630,7 @@
break;
case WM_LBUTTONDOWN:
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL);
- msg = (WCHAR*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
+ msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
sel = (INT)SendMessageW(hwnd, LB_GETCURSEL, 0, 0);
SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(This->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg);
diff --git a/dlls/shell32/enumidlist.c b/dlls/shell32/enumidlist.c
index 072e328..7e1cb06 100644
--- a/dlls/shell32/enumidlist.c
+++ b/dlls/shell32/enumidlist.c
@@ -193,7 +193,7 @@
IEnumIDList * IEnumIDList_Constructor(void)
{
- IEnumIDListImpl *lpeidl = (IEnumIDListImpl*)HeapAlloc(GetProcessHeap(),
+ IEnumIDListImpl *lpeidl = HeapAlloc(GetProcessHeap(),
HEAP_ZERO_MEMORY, sizeof(IEnumIDListImpl));
if (lpeidl)
diff --git a/dlls/shell32/folders.c b/dlls/shell32/folders.c
index efa3b2b..3f1b469 100644
--- a/dlls/shell32/folders.c
+++ b/dlls/shell32/folders.c
@@ -74,7 +74,7 @@
TRACE("%p\n", pidl);
- ei = (IExtractIconWImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconWImpl));
+ ei = HeapAlloc(GetProcessHeap(),0,sizeof(IExtractIconWImpl));
ei->ref=1;
ei->lpVtbl = &eivt;
ei->lpvtblPersistFile = &pfvt;
diff --git a/dlls/shell32/shell.c b/dlls/shell32/shell.c
index b6307a7..dfa1937 100644
--- a/dlls/shell32/shell.c
+++ b/dlls/shell32/shell.c
@@ -287,11 +287,11 @@
int i;
if (phiconLarge)
- ilarge = (HICON*)HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
+ ilarge = HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
else
ilarge = NULL;
if (phiconSmall)
- ismall = (HICON*)HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
+ ismall = HeapAlloc(GetProcessHeap(),0,nIcons*sizeof(HICON));
else
ismall = NULL;
ret = HICON_16(ExtractIconExA(lpszFile,nIconIndex,ilarge,ismall,nIcons));
@@ -368,7 +368,7 @@
DWORD WINAPI DoEnvironmentSubst16(LPSTR str,WORD length)
{
LPSTR lpEnv = MapSL(GetDOSEnvironment16());
- LPSTR lpBuffer = (LPSTR)HeapAlloc( GetProcessHeap(), 0, length);
+ LPSTR lpBuffer = HeapAlloc( GetProcessHeap(), 0, length);
LPSTR lpstr = str;
LPSTR lpbstr = lpBuffer;
diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c
index b572fcd..b7bfaa2 100644
--- a/dlls/shell32/shellole.c
+++ b/dlls/shell32/shellole.c
@@ -518,7 +518,7 @@
{
IDefClFImpl* lpclf;
- lpclf = (IDefClFImpl*)HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl));
+ lpclf = HeapAlloc(GetProcessHeap(),0,sizeof(IDefClFImpl));
lpclf->ref = 1;
lpclf->lpVtbl = &dclfvt;
lpclf->lpfnCI = lpfnCI;
@@ -713,7 +713,7 @@
LPWSTR lpszFileW = NULL;
if(lpszFile) {
- lpszFileW = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR));
+ lpszFileW = HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR));
if(lpszFileW == NULL) {
goto end;
}
@@ -770,7 +770,7 @@
LPSTR lpszFileA = NULL;
if(lpszwFile) {
- lpszFileA = (LPSTR) HeapAlloc(GetProcessHeap(), 0, lLength);
+ lpszFileA = HeapAlloc(GetProcessHeap(), 0, lLength);
if(lpszFileA == NULL) {
goto end;
}
diff --git a/dlls/shell32/shlmenu.c b/dlls/shell32/shlmenu.c
index 6c2b149..cd958a3 100644
--- a/dlls/shell32/shlmenu.c
+++ b/dlls/shell32/shlmenu.c
@@ -198,7 +198,7 @@
MENUINFO MenuInfo;
HMENU hMenuPopup = CreatePopupMenu();
- lpFmMi = (LPFMINFO) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
+ lpFmMi = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
lpFmMi->pidl = ILCombine(pidl, pidlTemp);
lpFmMi->uEnumFlags = SHCONTF_FOLDERS | SHCONTF_NONFOLDERS;
@@ -269,7 +269,7 @@
TRACE("0x%08lx 0x%08x %p 0x%08x 0x%08x hMenu=%p\n",
crBorderColor, nBorderWidth, hBorderBmp, nSelHeight, uFlags, hMenu);
- menudata = (LPFMINFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
+ menudata = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(FMINFO));
menudata->crBorderColor = crBorderColor;
menudata->nBorderWidth = nBorderWidth;
menudata->hBorderBmp = hBorderBmp;
diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c
index 06f30c6..09b42d2 100644
--- a/dlls/shell32/shlview.c
+++ b/dlls/shell32/shlview.c
@@ -172,7 +172,7 @@
*/
IShellView * IShellView_Constructor( IShellFolder * pFolder)
{ IShellViewImpl * sv;
- sv=(IShellViewImpl*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellViewImpl));
+ sv=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IShellViewImpl));
sv->ref=1;
sv->lpVtbl=&svvt;
sv->lpvtblOleCommandTarget=&ctvt;
diff --git a/dlls/shell32/shv_bg_cmenu.c b/dlls/shell32/shv_bg_cmenu.c
index a22384d..f60564c 100644
--- a/dlls/shell32/shv_bg_cmenu.c
+++ b/dlls/shell32/shv_bg_cmenu.c
@@ -59,7 +59,7 @@
{
BgCmImpl* cm;
- cm = (BgCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl));
+ cm = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(BgCmImpl));
cm->lpVtbl = &cmvt;
cm->ref = 1;
cm->pSFParent = pSFParent;
diff --git a/dlls/shell32/shv_item_cmenu.c b/dlls/shell32/shv_item_cmenu.c
index 9aedddd..2e7c42e 100644
--- a/dlls/shell32/shv_item_cmenu.c
+++ b/dlls/shell32/shv_item_cmenu.c
@@ -82,7 +82,7 @@
{ ItemCmImpl* cm;
UINT u;
- cm = (ItemCmImpl*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ItemCmImpl));
+ cm = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ItemCmImpl));
cm->lpVtbl = &cmvt;
cm->ref = 1;
cm->pidl = ILClone(pidl);