shell32: Remove superfluous casts; mostly of void pointers.

This commit is contained in:
Michael Stefaniuc 2008-11-05 23:00:50 +01:00 committed by Alexandre Julliard
parent d7c0cbdce5
commit b7de266082
19 changed files with 31 additions and 31 deletions

View File

@ -638,7 +638,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
switch (uMsg) {
case WM_MOUSEMOVE:
sel = SendMessageW(hwnd, LB_ITEMFROMPOINT, 0, lParam);
SendMessageW(hwnd, LB_SETCURSEL, (WPARAM)sel, (LPARAM)0);
SendMessageW(hwnd, LB_SETCURSEL, sel, 0);
break;
case WM_LBUTTONDOWN:
sel = SendMessageW(hwnd, LB_GETCURSEL, 0, 0);

View File

@ -813,7 +813,7 @@ static INT_PTR CALLBACK BrsFolderDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
if (msg == WM_INITDIALOG)
return BrsFolder_OnCreate( hWnd, (browse_info*) lParam );
info = (browse_info*) GetPropW( hWnd, szBrowseFolderInfo );
info = GetPropW( hWnd, szBrowseFolderInfo );
switch (msg)
{

View File

@ -88,7 +88,7 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
if(!hGlobal) return hGlobal;
pDropFiles = (DROPFILES *)GlobalLock(hGlobal);
pDropFiles = GlobalLock(hGlobal);
offset = (sizeof(DROPFILES) + sizeof(WCHAR) - 1) / sizeof(WCHAR);
pDropFiles->pFiles = offset * sizeof(WCHAR);
pDropFiles->fWide = TRUE;
@ -194,7 +194,7 @@ HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
/* fill the structure */
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
if(!hGlobal) return hGlobal;
szFileName = (char *)GlobalLock(hGlobal);
szFileName = GlobalLock(hGlobal);
memcpy(szFileName, szTemp, size);
GlobalUnlock(hGlobal);
@ -226,7 +226,7 @@ HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
/* fill the structure */
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
if(!hGlobal) return hGlobal;
szFileName = (WCHAR *)GlobalLock(hGlobal);
szFileName = GlobalLock(hGlobal);
memcpy(szFileName, szTemp, size);
GlobalUnlock(hGlobal);
@ -242,7 +242,7 @@ HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags)
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD));
if(!hGlobal) return hGlobal;
pdwFlag = (DWORD*)GlobalLock(hGlobal);
pdwFlag = GlobalLock(hGlobal);
*pdwFlag = dwFlags;
GlobalUnlock(hGlobal);
return hGlobal;

View File

@ -131,7 +131,7 @@ HRESULT WINAPI IControlPanel_Constructor(IUnknown* pUnkOuter, REFIID riid, LPVOI
if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
return CLASS_E_NOAGGREGATION;
sf = (ICPanelImpl *) LocalAlloc(LMEM_ZEROINIT, sizeof(ICPanelImpl));
sf = LocalAlloc(LMEM_ZEROINIT, sizeof(ICPanelImpl));
if (!sf)
return E_OUTOFMEMORY;

View File

@ -71,7 +71,7 @@ HRESULT WINAPI IDropTargetHelper_Constructor (IUnknown * pUnkOuter, REFIID riid,
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
dth = (IDropTargetHelperImpl *) LocalAlloc (LMEM_ZEROINIT, sizeof (IDropTargetHelperImpl));
dth = LocalAlloc (LMEM_ZEROINIT, sizeof (IDropTargetHelperImpl));
if (!dth) return E_OUTOFMEMORY;
dth->ref = 0;

View File

@ -71,7 +71,7 @@ BOOL AddToEnumList(
if (!iface || !pidl)
return FALSE;
pNew = (LPENUMLIST)SHAlloc(sizeof(ENUMLIST));
pNew = SHAlloc(sizeof(ENUMLIST));
if(pNew)
{
/*set the next pointer */

View File

@ -260,7 +260,7 @@ static INT SIC_IconAppend (LPCWSTR sSourceFile, INT dwSourceIndex, HICON hSmallI
WCHAR path[MAX_PATH];
TRACE("%s %i %p %p\n", debugstr_w(sSourceFile), dwSourceIndex, hSmallIcon ,hBigIcon);
lpsice = (LPSIC_ENTRY) SHAlloc (sizeof (SIC_ENTRY));
lpsice = SHAlloc(sizeof(SIC_ENTRY));
GetFullPathNameW(sSourceFile, MAX_PATH, path, NULL);
lpsice->sSourceFile = HeapAlloc( GetProcessHeap(), 0, (strlenW(path)+1)*sizeof(WCHAR) );
@ -413,9 +413,9 @@ BOOL SIC_Initialize(void)
ImageList_SetBkColor(ShellBigIconList, CLR_NONE);
/* Load the document icon, which is used as the default if an icon isn't found. */
hSm = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
hSm = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
IMAGE_ICON, cx_small, cy_small, LR_SHARED);
hLg = (HICON)LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
hLg = LoadImageA(shell32_hInstance, MAKEINTRESOURCEA(IDI_SHELL_DOCUMENT),
IMAGE_ICON, cx_large, cy_large, LR_SHARED);
if (!hSm || !hLg)

View File

@ -232,7 +232,7 @@ LPITEMIDLIST WINAPI ILClone (LPCITEMIDLIST pidl)
return NULL;
len = ILGetSize(pidl);
newpidl = (LPITEMIDLIST)SHAlloc(len);
newpidl = SHAlloc(len);
if (newpidl)
memcpy(newpidl,pidl,len);
@ -259,7 +259,7 @@ LPITEMIDLIST WINAPI ILCloneFirst(LPCITEMIDLIST pidl)
if (pidl)
{
len = pidl->mkid.cb;
pidlNew = (LPITEMIDLIST) SHAlloc (len+2);
pidlNew = SHAlloc(len+2);
if (pidlNew)
{
memcpy(pidlNew,pidl,len+2); /* 2 -> mind a desktop pidl */
@ -464,7 +464,7 @@ LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl)
return NULL;
len = ILGetSize(pidl);
newpidl = (LPITEMIDLIST)Alloc(len);
newpidl = Alloc(len);
if (newpidl)
memcpy(newpidl,pidl,len);
@ -725,7 +725,7 @@ HRESULT WINAPI SHGetRealIDL(LPSHELLFOLDER lpsf, LPCITEMIDLIST pidlSimple, LPITEM
if (SUCCEEDED(hr))
{
/*assert(pida->cidl==1);*/
LPIDA pida = (LPIDA)GlobalLock(medium.u.hGlobal);
LPIDA pida = GlobalLock(medium.u.hGlobal);
LPCITEMIDLIST pidl_folder = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[0]);
LPCITEMIDLIST pidl_child = (LPCITEMIDLIST) ((LPBYTE)pida+pida->aoffset[1]);

View File

@ -198,7 +198,7 @@ HGLOBAL16 WINAPI InternalExtractIcon16(HINSTANCE16 hInstance,
return 0;
hRet = GlobalAlloc16(GMEM_FIXED | GMEM_ZEROINIT, sizeof(*RetPtr) * n);
RetPtr = (HICON16*)GlobalLock16(hRet);
RetPtr = GlobalLock16(hRet);
if (nIconIndex == (UINT16)-1) /* get number of icons */
{

View File

@ -548,7 +548,7 @@ BOOL WINAPI DragQueryPoint(HDROP hDrop, POINT *p)
TRACE("\n");
lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
lpDropFileStruct = GlobalLock(hDrop);
*p = lpDropFileStruct->pt;
bRet = lpDropFileStruct->fNC;
@ -569,7 +569,7 @@ UINT WINAPI DragQueryFileA(
{
LPSTR lpDrop;
UINT i = 0;
DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
DROPFILES *lpDropFileStruct = GlobalLock(hDrop);
TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszFile,lLength);
@ -624,7 +624,7 @@ UINT WINAPI DragQueryFileW(
{
LPWSTR lpwDrop;
UINT i = 0;
DROPFILES *lpDropFileStruct = (DROPFILES *) GlobalLock(hDrop);
DROPFILES *lpDropFileStruct = GlobalLock(hDrop);
TRACE("(%p, %x, %p, %u)\n", hDrop,lFile,lpszwFile,lLength);

View File

@ -1641,7 +1641,7 @@ HPSXA WINAPI SHCreatePropSheetExtArrayEx(HKEY hKey, LPCWSTR pszSubKey, UINT max_
if (lRet == ERROR_SUCCESS)
{
/* Create and initialize the Property Sheet Extensions Array */
psxa = (PPSXA)LocalAlloc(LMEM_FIXED, FIELD_OFFSET(PSXA, pspsx[max_iface]));
psxa = LocalAlloc(LMEM_FIXED, FIELD_OFFSET(PSXA, pspsx[max_iface]));
if (psxa)
{
ZeroMemory(psxa, FIELD_OFFSET(PSXA, pspsx[max_iface]));

View File

@ -242,7 +242,7 @@ DWORD WINAPI CheckEscapesA(
DWORD ret = 0;
TRACE("(%s %d)\n", debugstr_a(string), len);
wString = (LPWSTR)LocalAlloc(LPTR, len * sizeof(WCHAR));
wString = LocalAlloc(LPTR, len * sizeof(WCHAR));
if (wString)
{
MultiByteToWideChar(CP_ACP, 0, string, len, wString, len);

View File

@ -235,7 +235,7 @@ IFSFolder_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv)
if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
return CLASS_E_NOAGGREGATION;
sf = (IGenericSFImpl *) LocalAlloc (LMEM_ZEROINIT, sizeof (IGenericSFImpl));
sf = LocalAlloc (LMEM_ZEROINIT, sizeof (IGenericSFImpl));
if (!sf)
return E_OUTOFMEMORY;

View File

@ -94,7 +94,7 @@ HRESULT WINAPI ISF_NetworkPlaces_Constructor (IUnknown * pUnkOuter, REFIID riid,
if (pUnkOuter)
return CLASS_E_NOAGGREGATION;
sf = (IGenericSFImpl *) HeapAlloc ( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (IGenericSFImpl));
sf = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof (IGenericSFImpl));
if (!sf)
return E_OUTOFMEMORY;

View File

@ -614,7 +614,7 @@ static HRESULT UNIXFS_path_to_pidl(UnixFolder *pUnixFolder, const WCHAR *path, L
/* Special case for the root folder. */
if (!strcmp(szCompletePath, "/")) {
*ppidl = pidl = (LPITEMIDLIST)SHAlloc(sizeof(USHORT));
*ppidl = pidl = SHAlloc(sizeof(USHORT));
if (!pidl) return E_FAIL;
pidl->mkid.cb = 0; /* Terminate the ITEMIDLIST */
return S_OK;
@ -657,7 +657,7 @@ static HRESULT UNIXFS_path_to_pidl(UnixFolder *pUnixFolder, const WCHAR *path, L
SHFree(pszAPath);
SHFree(pwszPath);
*ppidl = pidl = (LPITEMIDLIST)SHAlloc(cPidlLen);
*ppidl = pidl = SHAlloc(cPidlLen);
if (!pidl) return E_FAIL;
/* Concatenate the SHITEMIDs of the sub-directories. */
@ -2342,7 +2342,7 @@ static HRESULT WINAPI UnixSubFolderIterator_IEnumIDList_Skip(IEnumIDList* iface,
TRACE("(iface=%p, celt=%d)\n", iface, celt);
/* Call IEnumIDList::Next and delete the resulting pidls. */
apidl = (LPITEMIDLIST*)SHAlloc(celt * sizeof(LPITEMIDLIST));
apidl = SHAlloc(celt * sizeof(LPITEMIDLIST));
hr = IEnumIDList_Next(iface, celt, apidl, &cFetched);
if (SUCCEEDED(hr))
while (cFetched--)

View File

@ -330,7 +330,7 @@ static BOOL FileMenu_AppendItemW(
if (lpText != FM_SEPARATOR)
{
int len = strlenW (lpText);
myItem = (LPFMITEM) SHAlloc( sizeof(FMITEM) + len*sizeof(WCHAR));
myItem = SHAlloc(sizeof(FMITEM) + len*sizeof(WCHAR));
strcpyW (myItem->szItemText, lpText);
myItem->cchItemText = len;
myItem->iIconIndex = icon;

View File

@ -837,7 +837,7 @@ static UINT ShellView_GetSelections(IShellViewImpl * This)
SHFree(This->apidl);
This->cidl = ListView_GetSelectedCount(This->hWndList);
This->apidl = (LPITEMIDLIST*)SHAlloc(This->cidl * sizeof(LPITEMIDLIST));
This->apidl = SHAlloc(This->cidl * sizeof(LPITEMIDLIST));
TRACE("selected=%i\n", This->cidl);

View File

@ -292,7 +292,7 @@ static BOOL DoPaste(
if(hMem)
{
char * pDropFiles = (char *)GlobalLock(hMem);
char * pDropFiles = GlobalLock(hMem);
if(pDropFiles)
{
int len, offset = sizeof(DROPFILESTRUCT);

View File

@ -37,7 +37,7 @@ static HRESULT (WINAPI *pStrRetToStrNAW)(LPVOID,DWORD,LPSTRRET,const ITEMIDLIST
static WCHAR *CoDupStrW(const char* src)
{
INT len = MultiByteToWideChar(CP_ACP, 0, src, -1, NULL, 0);
WCHAR* szTemp = (WCHAR*)CoTaskMemAlloc(len * sizeof(WCHAR));
WCHAR* szTemp = CoTaskMemAlloc(len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, src, -1, szTemp, len);
return szTemp;
}