shlwapi: Remove superfluous pointer casts.

This commit is contained in:
Michael Stefaniuc 2009-01-22 09:52:44 +01:00 committed by Alexandre Julliard
parent c0a9281c1e
commit 08e3742f37
7 changed files with 20 additions and 22 deletions

View File

@ -455,7 +455,7 @@ static HRESULT WINAPI IQueryAssociations_fnQueryInterface(
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IQueryAssociations))
{
*ppvObj = (IQueryAssociations*)This;
*ppvObj = This;
IQueryAssociations_AddRef((IQueryAssociations*)*ppvObj);
TRACE("Returning IQueryAssociations (%p)\n", *ppvObj);

View File

@ -173,7 +173,7 @@ INT_PTR WINAPI SHMessageBoxCheckExW(HWND hWnd, HINSTANCE hInst, LPCWSTR lpszName
d.dlgProc = dlgProc;
d.lParam = lParam;
d.lpszId = lpszId;
return DialogBoxParamW(hInst, (LPCWSTR)lpszName, hWnd, SHDlgProcEx, (LPARAM)&d);
return DialogBoxParamW(hInst, lpszName, hWnd, SHDlgProcEx, (LPARAM)&d);
}
/* Data held by each shlwapi message box */

View File

@ -1250,12 +1250,10 @@ BOOL WINAPI SHIsSameObject(IUnknown* lpInt1, IUnknown* lpInt2)
if (lpInt1 == lpInt2)
return TRUE;
if (FAILED(IUnknown_QueryInterface(lpInt1, &IID_IUnknown,
(LPVOID *)&lpUnknown1)))
if (FAILED(IUnknown_QueryInterface(lpInt1, &IID_IUnknown, &lpUnknown1)))
return FALSE;
if (FAILED(IUnknown_QueryInterface(lpInt2, &IID_IUnknown,
(LPVOID *)&lpUnknown2)))
if (FAILED(IUnknown_QueryInterface(lpInt2, &IID_IUnknown, &lpUnknown2)))
return FALSE;
if (lpUnknown1 == lpUnknown2)
@ -2236,7 +2234,7 @@ HRESULT WINAPI QISearch(
if (IsEqualIID(riid, xmove->refid)) {
a_vtbl = (IUnknown*)(xmove->indx + (LPBYTE)w);
TRACE("matched, returning (%p)\n", a_vtbl);
*ppv = (LPVOID)a_vtbl;
*ppv = a_vtbl;
IUnknown_AddRef(a_vtbl);
return S_OK;
}
@ -2246,7 +2244,7 @@ HRESULT WINAPI QISearch(
if (IsEqualIID(riid, &IID_IUnknown)) {
a_vtbl = (IUnknown*)(x->indx + (LPBYTE)w);
TRACE("returning first for IUnknown (%p)\n", a_vtbl);
*ppv = (LPVOID)a_vtbl;
*ppv = a_vtbl;
IUnknown_AddRef(a_vtbl);
return S_OK;
}
@ -2539,7 +2537,7 @@ DWORD WINAPI SHGetRestriction(LPCWSTR lpSubKey, LPCWSTR lpSubName, LPCWSTR lpVal
if (retval != ERROR_SUCCESS)
return 0;
SHGetValueW(hKey, lpSubName, lpValue, NULL, (LPBYTE)&retval, &datsize);
SHGetValueW(hKey, lpSubName, lpValue, NULL, &retval, &datsize);
RegCloseKey(hKey);
return retval;
}
@ -2618,7 +2616,7 @@ HRESULT WINAPI SHWeakQueryInterface(
*ppv = NULL;
if(pUnk && pInner) {
hret = IUnknown_QueryInterface(pInner, riid, (LPVOID*)ppv);
hret = IUnknown_QueryInterface(pInner, riid, ppv);
if (SUCCEEDED(hret)) IUnknown_Release(pUnk);
}
TRACE("-- 0x%08x\n", hret);
@ -4167,7 +4165,7 @@ BOOL WINAPI SHSkipJunction(IBindCtx *pbc, const CLSID *pclsid)
{
IUnknown* lpUnk;
if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, (LPOLESTR)szSkipBinding, &lpUnk)))
if (SUCCEEDED(IBindCtx_GetObjectParam(pbc, szSkipBinding, &lpUnk)))
{
CLSID clsid;

View File

@ -190,7 +190,7 @@ LONG WINAPI SHRegOpenUSKeyW(LPCWSTR Path, REGSAM AccessType, HUSKEY hRelativeUSK
LONG WINAPI SHRegCloseUSKey(
HUSKEY hUSKey) /* [I] Key to close */
{
LPSHUSKEY hKey = (LPSHUSKEY)hUSKey;
LPSHUSKEY hKey = hUSKey;
LONG ret = ERROR_SUCCESS;
if (hKey->HKCUkey)
@ -393,8 +393,8 @@ LONG WINAPI SHRegQueryUSValueA(
if (ret != ERROR_SUCCESS) {
if (pvDefaultData && (dwDefaultDataSize != 0)) {
maxmove = (dwDefaultDataSize >= *pcbData) ? *pcbData : dwDefaultDataSize;
src = (CHAR*)pvDefaultData;
dst = (CHAR*)pvData;
src = pvDefaultData;
dst = pvData;
for(i=0; i<maxmove; i++) *dst++ = *src++;
*pcbData = maxmove;
TRACE("setting default data\n");
@ -444,8 +444,8 @@ LONG WINAPI SHRegQueryUSValueW(
if (ret != ERROR_SUCCESS) {
if (pvDefaultData && (dwDefaultDataSize != 0)) {
maxmove = (dwDefaultDataSize >= *pcbData) ? *pcbData : dwDefaultDataSize;
src = (CHAR*)pvDefaultData;
dst = (CHAR*)pvData;
src = pvDefaultData;
dst = pvData;
for(i=0; i<maxmove; i++) *dst++ = *src++;
*pcbData = maxmove;
TRACE("setting default data\n");
@ -934,7 +934,7 @@ LONG WINAPI SHRegWriteUSValueW(HUSKEY hUSKey, LPCWSTR pszValue, DWORD dwType,
LPVOID pvData, DWORD cbData, DWORD dwFlags)
{
DWORD dummy;
LPSHUSKEY hKey = (LPSHUSKEY)hUSKey;
LPSHUSKEY hKey = hUSKey;
LONG ret = ERROR_SUCCESS;
TRACE("(%p,%s,%d,%p,%d,%d)\n", hUSKey, debugstr_w(pszValue),
@ -2242,7 +2242,7 @@ DWORD WINAPI SHCopyKeyW(HKEY hKeySrc, LPCWSTR lpszSrcSubKey, HKEY hKeyDst, DWORD
DWORD dwKeyCount = 0, dwValueCount = 0, dwMaxKeyLen = 0;
DWORD dwMaxValueLen = 0, dwMaxDataLen = 0, i;
BYTE buff[1024];
LPVOID lpBuff = (LPVOID)buff;
LPVOID lpBuff = buff;
WCHAR szName[MAX_PATH], *lpszName = szName;
DWORD dwRet = S_OK;

View File

@ -1342,7 +1342,7 @@ HRESULT WINAPI StrRetToBufA (LPSTRRET src, const ITEMIDLIST *pidl, LPSTR dest, U
break;
case STRRET_CSTR:
lstrcpynA((LPSTR)dest, src->u.cStr, len);
lstrcpynA(dest, src->u.cStr, len);
break;
case STRRET_OFFSET:
@ -1381,7 +1381,7 @@ HRESULT WINAPI StrRetToBufW (LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest,
switch (src->uType)
{
case STRRET_WSTR:
lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
lstrcpynW(dest, src->u.pOleStr, len);
CoTaskMemFree(src->u.pOleStr);
break;

View File

@ -116,7 +116,7 @@ static HRESULT WINAPI Read(_IDummyStream* This, LPVOID lpMem, ULONG ulSize,
else
{
unsigned int i;
char* buff = (char*)lpMem;
char* buff = lpMem;
/* Read item data */
if (!This->item->ulSize)

View File

@ -229,7 +229,7 @@ static void test_alloc_shared(void)
hmem=pSHAllocShared(&val,4,procid);
ok(hmem!=NULL,"SHAllocShared(NULL...) failed: %u\n", GetLastError());
p=(int*)pSHLockShared(hmem,procid);
p=pSHLockShared(hmem,procid);
ok(p!=NULL,"SHLockShared failed: %u\n", GetLastError());
if (p!=NULL)
ok(*p==val,"Wrong value in shared memory: %d instead of %d\n",*p,val);