From 08e3742f379c1dd380ce8a3758ca8d9ac8118178 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Thu, 22 Jan 2009 09:52:44 +0100 Subject: [PATCH] shlwapi: Remove superfluous pointer casts. --- dlls/shlwapi/assoc.c | 2 +- dlls/shlwapi/msgbox.c | 2 +- dlls/shlwapi/ordinal.c | 16 +++++++--------- dlls/shlwapi/reg.c | 14 +++++++------- dlls/shlwapi/string.c | 4 ++-- dlls/shlwapi/tests/clist.c | 2 +- dlls/shlwapi/tests/ordinal.c | 2 +- 7 files changed, 20 insertions(+), 22 deletions(-) diff --git a/dlls/shlwapi/assoc.c b/dlls/shlwapi/assoc.c index 5ef5ba64ef1..d13f0aa765f 100644 --- a/dlls/shlwapi/assoc.c +++ b/dlls/shlwapi/assoc.c @@ -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); diff --git a/dlls/shlwapi/msgbox.c b/dlls/shlwapi/msgbox.c index 3e14860b9de..0936e0becf1 100644 --- a/dlls/shlwapi/msgbox.c +++ b/dlls/shlwapi/msgbox.c @@ -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 */ diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index 932f54f93d6..882058e60db 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -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; diff --git a/dlls/shlwapi/reg.c b/dlls/shlwapi/reg.c index 70a5e142578..c6fa2c7e84d 100644 --- a/dlls/shlwapi/reg.c +++ b/dlls/shlwapi/reg.c @@ -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= *pcbData) ? *pcbData : dwDefaultDataSize; - src = (CHAR*)pvDefaultData; - dst = (CHAR*)pvData; + src = pvDefaultData; + dst = pvData; for(i=0; iu.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; diff --git a/dlls/shlwapi/tests/clist.c b/dlls/shlwapi/tests/clist.c index 5f94b4ff6cc..84a05e6f26f 100644 --- a/dlls/shlwapi/tests/clist.c +++ b/dlls/shlwapi/tests/clist.c @@ -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) diff --git a/dlls/shlwapi/tests/ordinal.c b/dlls/shlwapi/tests/ordinal.c index 484db0aebdd..7865acbbdd8 100644 --- a/dlls/shlwapi/tests/ordinal.c +++ b/dlls/shlwapi/tests/ordinal.c @@ -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);