comctl32: HANDLE/HGLOBAL are basically just void pointers. No casts to other pointers are needed.
Michael Stefaniuc
mstefani at redhat.de
Tue Oct 28 17:35:49 CDT 2008
---
dlls/comctl32/commctrl.c | 12 +++---
dlls/comctl32/propsheet.c | 99 ++++++++++++++++----------------------------
2 files changed, 42 insertions(+), 69 deletions(-)
diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
index f21aa11..a3a0fb1 100644
--- a/dlls/comctl32/commctrl.c
+++ b/dlls/comctl32/commctrl.c
@@ -889,7 +889,7 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags,
else
nColorTableSize = 0;
nSize = lpBitmap->biSize + nColorTableSize * sizeof(RGBQUAD);
- lpBitmapInfo = (LPBITMAPINFOHEADER)GlobalAlloc (GMEM_FIXED, nSize);
+ lpBitmapInfo = GlobalAlloc (GMEM_FIXED, nSize);
if (lpBitmapInfo == NULL)
return 0;
RtlMoveMemory (lpBitmapInfo, lpBitmap, nSize);
@@ -1117,7 +1117,7 @@ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
* from there. */
/* See if we have been called for this window */
- stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass);
+ stack = GetPropW (hWnd, COMCTL32_wSubclass);
if (!stack) {
/* allocate stack */
stack = Alloc (sizeof(SUBCLASS_INFO));
@@ -1196,7 +1196,7 @@ BOOL WINAPI GetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass,
TRACE ("(%p, %p, %lx, %p)\n", hWnd, pfnSubclass, uID, pdwRef);
/* See if we have been called for this window */
- stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass);
+ stack = GetPropW (hWnd, COMCTL32_wSubclass);
if (!stack)
return FALSE;
@@ -1239,7 +1239,7 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u
TRACE ("(%p, %p, %lx)\n", hWnd, pfnSubclass, uID);
/* Find the Subclass to remove */
- stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass);
+ stack = GetPropW (hWnd, COMCTL32_wSubclass);
if (!stack)
return FALSE;
@@ -1292,7 +1292,7 @@ LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam);
- stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass);
+ stack = GetPropW (hWnd, COMCTL32_wSubclass);
if (!stack) {
ERR ("Our sub classing stack got erased for %p!! Nothing we can do\n", hWnd);
return 0;
@@ -1343,7 +1343,7 @@ LRESULT WINAPI DefSubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
TRACE ("(%p, 0x%08x, 0x%08lx, 0x%08lx)\n", hWnd, uMsg, wParam, lParam);
/* retrieve our little stack from the Properties */
- stack = (LPSUBCLASS_INFO)GetPropW (hWnd, COMCTL32_wSubclass);
+ stack = GetPropW (hWnd, COMCTL32_wSubclass);
if (!stack) {
ERR ("Our sub classing stack got erased for %p!! Nothing we can do\n", hWnd);
return 0;
diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c
index b463dfd..8b60a3c 100644
--- a/dlls/comctl32/propsheet.c
+++ b/dlls/comctl32/propsheet.c
@@ -1604,8 +1604,7 @@ static BOOL PROPSHEET_Back(HWND hwndDlg)
{
PSHNOTIFY psn;
HWND hwndPage;
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
LRESULT result;
int idx;
@@ -1644,8 +1643,7 @@ static BOOL PROPSHEET_Next(HWND hwndDlg)
PSHNOTIFY psn;
HWND hwndPage;
LRESULT msgResult = 0;
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
int idx;
TRACE("active_page %d\n", psInfo->active_page);
@@ -1684,8 +1682,7 @@ static BOOL PROPSHEET_Finish(HWND hwndDlg)
PSHNOTIFY psn;
HWND hwndPage;
LRESULT msgResult = 0;
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
TRACE("active_page %d\n", psInfo->active_page);
if (psInfo->active_page < 0)
@@ -1723,8 +1720,7 @@ static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam)
int i;
HWND hwndPage;
PSHNOTIFY psn;
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
TRACE("active_page %d\n", psInfo->active_page);
if (psInfo->active_page < 0)
@@ -1787,8 +1783,7 @@ static BOOL PROPSHEET_Apply(HWND hwndDlg, LPARAM lParam)
*/
static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
HWND hwndPage;
PSHNOTIFY psn;
int i;
@@ -1831,8 +1826,7 @@ static void PROPSHEET_Cancel(HWND hwndDlg, LPARAM lParam)
*/
static void PROPSHEET_Help(HWND hwndDlg)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
HWND hwndPage;
PSHNOTIFY psn;
@@ -1855,8 +1849,7 @@ static void PROPSHEET_Help(HWND hwndDlg)
static void PROPSHEET_Changed(HWND hwndDlg, HWND hwndDirtyPage)
{
int i;
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
TRACE("\n");
if (!psInfo) return;
@@ -1888,8 +1881,7 @@ static void PROPSHEET_UnChanged(HWND hwndDlg, HWND hwndCleanPage)
int i;
BOOL noPageDirty = TRUE;
HWND hwndApplyBtn = GetDlgItem(hwndDlg, IDC_APPLY_BUTTON);
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
TRACE("\n");
if ( !psInfo ) return;
@@ -1961,8 +1953,7 @@ static void PROPSHEET_PressButton(HWND hwndDlg, int buttonID)
*/
static BOOL PROPSHEET_CanSetCurSel(HWND hwndDlg)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
HWND hwndPage;
PSHNOTIFY psn;
BOOL res = FALSE;
@@ -2005,7 +1996,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
HPROPSHEETPAGE hpage
)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
HWND hwndHelp = GetDlgItem(hwndDlg, IDHELP);
HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
@@ -2120,8 +2111,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
static void PROPSHEET_SetCurSelId(HWND hwndDlg, int id)
{
int idx;
- PropSheetInfo* psInfo =
- (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
idx = PROPSHEET_FindPageByResId(psInfo, id);
if (idx < psInfo->nPages )
@@ -2154,8 +2144,8 @@ static void PROPSHEET_SetTitleA(HWND hwndDlg, DWORD dwStyle, LPCSTR lpszText)
*/
static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr);
- WCHAR szTitle[256];
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
+ WCHAR szTitle[256];
TRACE("%s (style %08x)\n", debugstr_w(lpszText), dwStyle);
if (HIWORD(lpszText) == 0) {
@@ -2185,7 +2175,7 @@ static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
*/
static void PROPSHEET_SetFinishTextA(HWND hwndDlg, LPCSTR lpszText)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
HWND hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
TRACE("'%s'\n", lpszText);
@@ -2214,7 +2204,7 @@ static void PROPSHEET_SetFinishTextA(HWND hwndDlg, LPCSTR lpszText)
*/
static void PROPSHEET_SetFinishTextW(HWND hwndDlg, LPCWSTR lpszText)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
HWND hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
TRACE("%s\n", debugstr_w(lpszText));
@@ -2247,7 +2237,7 @@ static LRESULT PROPSHEET_QuerySiblings(HWND hwndDlg,
int i = 0;
HWND hwndPage;
LRESULT msgResult = 0;
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
while ((i < psInfo->nPages) && (msgResult == 0))
{
@@ -2267,8 +2257,7 @@ static BOOL PROPSHEET_AddPage(HWND hwndDlg,
HPROPSHEETPAGE hpage)
{
PropPageInfo * ppi;
- PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
TCITEMW item;
LPCPROPSHEETPAGEW ppsp = (LPCPROPSHEETPAGEW)hpage;
@@ -2329,8 +2318,7 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
int index,
HPROPSHEETPAGE hpage)
{
- PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
PropPageInfo* oldPages;
@@ -2439,8 +2427,7 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
*/
static void PROPSHEET_SetWizButtons(HWND hwndDlg, DWORD dwFlags)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
HWND hwndBack = GetDlgItem(hwndDlg, IDC_BACK_BUTTON);
HWND hwndNext = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON);
HWND hwndFinish = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
@@ -2543,8 +2530,7 @@ static void PROPSHEET_SetHeaderSubTitleA(HWND hwndDlg, int iPageIndex, LPCSTR ps
static LRESULT PROPSHEET_HwndToIndex(HWND hwndDlg, HWND hPageDlg)
{
int index;
- PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
TRACE("(%p, %p)\n", hwndDlg, hPageDlg);
@@ -2560,8 +2546,7 @@ static LRESULT PROPSHEET_HwndToIndex(HWND hwndDlg, HWND hPageDlg)
*/
static LRESULT PROPSHEET_IndexToHwnd(HWND hwndDlg, int iPageIndex)
{
- PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
TRACE("(%p, %d)\n", hwndDlg, iPageIndex);
if (iPageIndex<0 || iPageIndex>=psInfo->nPages) {
WARN("%d out of range.\n", iPageIndex);
@@ -2576,8 +2561,7 @@ static LRESULT PROPSHEET_IndexToHwnd(HWND hwndDlg, int iPageIndex)
static LRESULT PROPSHEET_PageToIndex(HWND hwndDlg, HPROPSHEETPAGE hPage)
{
int index;
- PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
TRACE("(%p, %p)\n", hwndDlg, hPage);
@@ -2593,8 +2577,7 @@ static LRESULT PROPSHEET_PageToIndex(HWND hwndDlg, HPROPSHEETPAGE hPage)
*/
static LRESULT PROPSHEET_IndexToPage(HWND hwndDlg, int iPageIndex)
{
- PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
TRACE("(%p, %d)\n", hwndDlg, iPageIndex);
if (iPageIndex<0 || iPageIndex>=psInfo->nPages) {
WARN("%d out of range.\n", iPageIndex);
@@ -2610,8 +2593,7 @@ static LRESULT PROPSHEET_IdToIndex(HWND hwndDlg, int iPageId)
{
int index;
LPCPROPSHEETPAGEW psp;
- PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
TRACE("(%p, %d)\n", hwndDlg, iPageId);
for (index = 0; index < psInfo->nPages; index++) {
psp = (LPCPROPSHEETPAGEW)psInfo->proppage[index].hpage;
@@ -2627,8 +2609,7 @@ static LRESULT PROPSHEET_IdToIndex(HWND hwndDlg, int iPageId)
*/
static LRESULT PROPSHEET_IndexToId(HWND hwndDlg, int iPageIndex)
{
- PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
LPCPROPSHEETPAGEW psp;
TRACE("(%p, %d)\n", hwndDlg, iPageIndex);
if (iPageIndex<0 || iPageIndex>=psInfo->nPages) {
@@ -2647,8 +2628,7 @@ static LRESULT PROPSHEET_IndexToId(HWND hwndDlg, int iPageIndex)
*/
static LRESULT PROPSHEET_GetResult(HWND hwndDlg)
{
- PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
return psInfo->result;
}
@@ -2693,8 +2673,7 @@ static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo* psI
static void PROPSHEET_CleanUp(HWND hwndDlg)
{
int i;
- PropSheetInfo* psInfo = (PropSheetInfo*) RemovePropW(hwndDlg,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = RemovePropW(hwndDlg, PropSheetInfoStr);
TRACE("\n");
if (!psInfo) return;
@@ -2818,8 +2797,7 @@ static INT_PTR PROPSHEET_PropertySheet(PropSheetInfo* psInfo, BOOL unicode)
*/
INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GlobalAlloc(GPTR,
- sizeof(PropSheetInfo));
+ PropSheetInfo* psInfo = GlobalAlloc(GPTR, sizeof(PropSheetInfo));
UINT i, n;
const BYTE* pByte;
@@ -2860,8 +2838,7 @@ INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
*/
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GlobalAlloc(GPTR,
- sizeof(PropSheetInfo));
+ PropSheetInfo* psInfo = GlobalAlloc(GPTR, sizeof(PropSheetInfo));
UINT i, n;
const BYTE* pByte;
@@ -3100,7 +3077,7 @@ BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
*/
static BOOL PROPSHEET_IsDialogMessage(HWND hwnd, LPMSG lpMsg)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
TRACE("\n");
if (!psInfo || (hwnd != lpMsg->hwnd && !IsChild(hwnd, lpMsg->hwnd)))
@@ -3166,8 +3143,7 @@ static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID)
if (wID == IDOK)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
/* don't overwrite ID_PSRESTARTWINDOWS or ID_PSREBOOTSYSTEM */
if (psInfo->result == 0)
@@ -3216,7 +3192,7 @@ static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID)
*/
static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
PAINTSTRUCT ps;
HDC hdc, hdcSrc;
BITMAP bm;
@@ -3537,7 +3513,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_COMMAND:
if (!PROPSHEET_DoCommand(hwnd, LOWORD(wParam)))
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
if (!psInfo)
return FALSE;
@@ -3577,8 +3553,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case PSM_GETCURRENTPAGEHWND:
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
HWND hwndPage = 0;
if (!psInfo)
@@ -3642,8 +3617,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case PSM_RESTARTWINDOWS:
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
if (!psInfo)
return FALSE;
@@ -3657,8 +3631,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case PSM_REBOOTSYSTEM:
{
- PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd,
- PropSheetInfoStr);
+ PropSheetInfo* psInfo = GetPropW(hwnd, PropSheetInfoStr);
if (!psInfo)
return FALSE;
--
1.6.0.3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20081028/9186da75/attachment.pgp
More information about the wine-patches
mailing list