From 863ffb719b7854b6330145d7d5f2c0bc986dfee6 Mon Sep 17 00:00:00 2001 From: Andrew Talbot Date: Mon, 31 Dec 2007 22:16:08 +0000 Subject: [PATCH] comctl32: Remove unneeded casts. --- dlls/comctl32/propsheet.c | 36 ++++++++++++++++++------------------ dlls/comctl32/status.c | 3 +-- dlls/comctl32/tab.c | 2 +- dlls/comctl32/toolbar.c | 9 ++++----- dlls/comctl32/tooltips.c | 25 +++++++++---------------- dlls/comctl32/trackbar.c | 3 +-- dlls/comctl32/treeview.c | 27 ++++++++------------------- 7 files changed, 42 insertions(+), 63 deletions(-) diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index 1f675cda6eb..f6837085a2d 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -522,7 +522,7 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp, p += 2; break; default: - p += lstrlenW( (LPCWSTR)p ) + 1; + p += lstrlenW( p ) + 1; break; } @@ -536,14 +536,14 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp, p += 2; break; default: - p += lstrlenW( (LPCWSTR)p ) + 1; + p += lstrlenW( p ) + 1; break; } /* Extract the caption */ - psInfo->proppage[index].pszText = (LPCWSTR)p; - TRACE("Tab %d %s\n",index,debugstr_w((LPCWSTR)p)); - p += lstrlenW((LPCWSTR)p) + 1; + psInfo->proppage[index].pszText = p; + TRACE("Tab %d %s\n",index,debugstr_w( p )); + p += lstrlenW( p ) + 1; if (dwFlags & PSP_USETITLE) { @@ -632,7 +632,7 @@ static INT_PTR PROPSHEET_CreateDialog(PropSheetInfo* psInfo) return -1; } - if(!(template = (LPVOID)LoadResource(COMCTL32_hModule, hRes))) + if(!(template = LoadResource(COMCTL32_hModule, hRes))) return -1; /* @@ -1288,8 +1288,8 @@ static UINT GetTemplateSize(const DLGTEMPLATE* pTemplate) p += 2; break; default: - TRACE("menu %s\n",debugstr_w((LPCWSTR)p)); - p += lstrlenW( (LPCWSTR)p ) + 1; + TRACE("menu %s\n",debugstr_w( p )); + p += lstrlenW( p ) + 1; break; } @@ -1303,22 +1303,22 @@ static UINT GetTemplateSize(const DLGTEMPLATE* pTemplate) p += 2; /* 0xffff plus predefined window class ordinal value */ break; default: - TRACE("class %s\n",debugstr_w((LPCWSTR)p)); - p += lstrlenW( (LPCWSTR)p ) + 1; + TRACE("class %s\n",debugstr_w( p )); + p += lstrlenW( p ) + 1; break; } /* title */ - TRACE("title %s\n",debugstr_w((LPCWSTR)p)); - p += lstrlenW((LPCWSTR)p) + 1; + TRACE("title %s\n",debugstr_w( p )); + p += lstrlenW( p ) + 1; /* font, if DS_SETFONT set */ if ((DS_SETFONT & ((istemplateex)? ((const MyDLGTEMPLATEEX*)pTemplate)->style : pTemplate->style))) { p+=(istemplateex)?3:1; - TRACE("font %s\n",debugstr_w((LPCWSTR)p)); - p += lstrlenW( (LPCWSTR)p ) + 1; /* the font name */ + TRACE("font %s\n",debugstr_w( p )); + p += lstrlenW( p ) + 1; /* the font name */ } /* now process the DLGITEMTEMPLATE(EX) structs (plus custom data) @@ -1342,8 +1342,8 @@ static UINT GetTemplateSize(const DLGTEMPLATE* pTemplate) p += 2; break; default: - TRACE("class %s\n",debugstr_w((LPCWSTR)p)); - p += lstrlenW( (LPCWSTR)p ) + 1; + TRACE("class %s\n",debugstr_w( p )); + p += lstrlenW( p ) + 1; break; } @@ -1358,8 +1358,8 @@ static UINT GetTemplateSize(const DLGTEMPLATE* pTemplate) p += 2; break; default: - TRACE("text %s\n",debugstr_w((LPCWSTR)p)); - p += lstrlenW( (LPCWSTR)p ) + 1; + TRACE("text %s\n",debugstr_w( p )); + p += lstrlenW( p ) + 1; break; } p += *p / sizeof(WORD) + 1; /* Skip extra data */ diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index dcfe80141e8..1b9e786ea1e 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -1019,8 +1019,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate) nmttc.hdr.code = NM_TOOLTIPSCREATED; nmttc.hwndToolTips = infoPtr->hwndToolTip; - SendMessageW (lpCreate->hwndParent, WM_NOTIFY, - (WPARAM)nmttc.hdr.idFrom, (LPARAM)&nmttc); + SendMessageW (lpCreate->hwndParent, WM_NOTIFY, nmttc.hdr.idFrom, (LPARAM)&nmttc); } } diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index 5f9e2957f8c..35973d01e39 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -178,7 +178,7 @@ TAB_SendSimpleNotify (const TAB_INFO *infoPtr, UINT code) nmhdr.code = code; return (BOOL) SendMessageW (infoPtr->hwndNotify, WM_NOTIFY, - (WPARAM) nmhdr.idFrom, (LPARAM) &nmhdr); + nmhdr.idFrom, (LPARAM) &nmhdr); } static void diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index b7a67257781..21817b2f6bb 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -341,8 +341,7 @@ TOOLBAR_SendNotify (NMHDR *nmhdr, const TOOLBAR_INFO *infoPtr, UINT code) TRACE("to window %p, code=%08x, %s\n", infoPtr->hwndNotify, code, (infoPtr->bUnicode) ? "via Unicode" : "via ANSI"); - return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, - (WPARAM)nmhdr->idFrom, (LPARAM)nmhdr); + return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmhdr->idFrom, (LPARAM)nmhdr); } /*********************************************************************** @@ -3918,7 +3917,7 @@ TOOLBAR_LoadImages (HWND hwnd, WPARAM wParam, LPARAM lParam) { TBADDBITMAP tbab; tbab.hInst = (HINSTANCE)lParam; - tbab.nID = (UINT_PTR)wParam; + tbab.nID = wParam; TRACE("hwnd = %p, hInst = %p, nID = %lu\n", hwnd, tbab.hInst, tbab.nID); @@ -4231,7 +4230,7 @@ TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, const TBSAVEPARAMSW *lpSave) if (!res) { nmtbr.pData = Alloc(dwSize); - nmtbr.cbData = (UINT)dwSize; + nmtbr.cbData = dwSize; if (!nmtbr.pData) res = ERROR_OUTOFMEMORY; } if (!res) @@ -6374,7 +6373,7 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm /* last resort: send notification on to app */ /* FIXME: find out what is really used here */ - return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, (WPARAM)lpnmtdi->hdr.idFrom, (LPARAM)lpnmtdi); + return SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, lpnmtdi->hdr.idFrom, (LPARAM)lpnmtdi); } diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c index 401c344abd8..f976ce900f0 100644 --- a/dlls/comctl32/tooltips.c +++ b/dlls/comctl32/tooltips.c @@ -320,8 +320,7 @@ static void TOOLTIPS_GetDispInfoA(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO ttnmdi.lParam = toolPtr->lParam; TRACE("hdr.idFrom = %lx\n", ttnmdi.hdr.idFrom); - SendMessageW(toolPtr->hwnd, WM_NOTIFY, - (WPARAM)toolPtr->uId, (LPARAM)&ttnmdi); + SendMessageW(toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&ttnmdi); if (IS_INTRESOURCE(ttnmdi.lpszText)) { LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText), @@ -351,8 +350,7 @@ static void TOOLTIPS_GetDispInfoA(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO /* FIXME: Unsure if SETITEM should save the value or not */ if (infoPtr->szTipText[0] == 0x00) { - SendMessageW(GetParent(toolPtr->hwnd), WM_NOTIFY, - (WPARAM)toolPtr->uId, (LPARAM)&ttnmdi); + SendMessageW(GetParent(toolPtr->hwnd), WM_NOTIFY, toolPtr->uId, (LPARAM)&ttnmdi); if (IS_INTRESOURCE(ttnmdi.lpszText)) { LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText), @@ -378,8 +376,7 @@ static void TOOLTIPS_GetDispInfoW(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO ttnmdi.lParam = toolPtr->lParam; TRACE("hdr.idFrom = %lx\n", ttnmdi.hdr.idFrom); - SendMessageW(toolPtr->hwnd, WM_NOTIFY, - (WPARAM)toolPtr->uId, (LPARAM)&ttnmdi); + SendMessageW(toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&ttnmdi); if (IS_INTRESOURCE(ttnmdi.lpszText)) { LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText), @@ -409,8 +406,7 @@ static void TOOLTIPS_GetDispInfoW(HWND hwnd, TOOLTIPS_INFO *infoPtr, TTTOOL_INFO /* FIXME: Unsure if SETITEM should save the value or not */ if (infoPtr->szTipText[0] == 0x00) { - SendMessageW(GetParent(toolPtr->hwnd), WM_NOTIFY, - (WPARAM)toolPtr->uId, (LPARAM)&ttnmdi); + SendMessageW(GetParent(toolPtr->hwnd), WM_NOTIFY, toolPtr->uId, (LPARAM)&ttnmdi); if (IS_INTRESOURCE(ttnmdi.lpszText)) { LoadStringW(ttnmdi.hinst, LOWORD(ttnmdi.lpszText), @@ -563,8 +559,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr, BOOL track_activate) hdr.hwndFrom = hwnd; hdr.idFrom = toolPtr->uId; hdr.code = TTN_SHOW; - SendMessageW (toolPtr->hwnd, WM_NOTIFY, - (WPARAM)toolPtr->uId, (LPARAM)&hdr); + SendMessageW (toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&hdr); TRACE("%s\n", debugstr_w(infoPtr->szTipText)); @@ -792,8 +787,7 @@ TOOLTIPS_Hide (HWND hwnd, TOOLTIPS_INFO *infoPtr) hdr.hwndFrom = hwnd; hdr.idFrom = toolPtr->uId; hdr.code = TTN_POP; - SendMessageW (toolPtr->hwnd, WM_NOTIFY, - (WPARAM)toolPtr->uId, (LPARAM)&hdr); + SendMessageW (toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&hdr); infoPtr->nCurrentTool = -1; @@ -825,8 +819,7 @@ TOOLTIPS_TrackHide (HWND hwnd, const TOOLTIPS_INFO *infoPtr) hdr.hwndFrom = hwnd; hdr.idFrom = toolPtr->uId; hdr.code = TTN_POP; - SendMessageW (toolPtr->hwnd, WM_NOTIFY, - (WPARAM)toolPtr->uId, (LPARAM)&hdr); + SendMessageW (toolPtr->hwnd, WM_NOTIFY, toolPtr->uId, (LPARAM)&hdr); SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOZORDER | SWP_HIDEWINDOW | SWP_NOACTIVATE); @@ -1922,7 +1915,7 @@ TOOLTIPS_SetTitleA (HWND hwnd, WPARAM wParam, LPARAM lParam) { TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd); LPCSTR pszTitle = (LPCSTR)lParam; - UINT_PTR uTitleIcon = (UINT_PTR)wParam; + UINT_PTR uTitleIcon = wParam; UINT size; TRACE("hwnd = %p, title = %s, icon = %p\n", hwnd, debugstr_a(pszTitle), @@ -1955,7 +1948,7 @@ TOOLTIPS_SetTitleW (HWND hwnd, WPARAM wParam, LPARAM lParam) { TOOLTIPS_INFO *infoPtr = TOOLTIPS_GetInfoPtr (hwnd); LPCWSTR pszTitle = (LPCWSTR)lParam; - UINT_PTR uTitleIcon = (UINT_PTR)wParam; + UINT_PTR uTitleIcon = wParam; UINT size; TRACE("hwnd = %p, title = %s, icon = %p\n", hwnd, debugstr_w(pszTitle), diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index 7b6c708a1b2..076313f67c4 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -119,8 +119,7 @@ static LRESULT notify_hdr (const TRACKBAR_INFO *infoPtr, INT code, LPNMHDR pnmh) pnmh->hwndFrom = infoPtr->hwndSelf; pnmh->idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID); pnmh->code = code; - result = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, - (WPARAM)pnmh->idFrom, (LPARAM)pnmh); + result = SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, pnmh->idFrom, (LPARAM)pnmh); TRACE(" <= %ld\n", result); diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index e77051c43da..25c2f22bd59 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -518,8 +518,7 @@ TREEVIEW_SendSimpleNotify(const TREEVIEW_INFO *infoPtr, UINT code) nmhdr.idFrom = GetWindowLongPtrW(hwnd, GWLP_ID); nmhdr.code = get_notifycode(infoPtr, code); - return (BOOL)TREEVIEW_SendRealNotify(infoPtr, - (WPARAM)nmhdr.idFrom, (LPARAM)&nmhdr); + return (BOOL)TREEVIEW_SendRealNotify(infoPtr, nmhdr.idFrom, (LPARAM)&nmhdr); } static VOID @@ -582,9 +581,7 @@ TREEVIEW_SendTreeviewNotify(const TREEVIEW_INFO *infoPtr, UINT code, UINT action nmhdr.ptDrag.x = 0; nmhdr.ptDrag.y = 0; - ret = (BOOL)TREEVIEW_SendRealNotify(infoPtr, - (WPARAM)nmhdr.hdr.idFrom, - (LPARAM)&nmhdr); + ret = (BOOL)TREEVIEW_SendRealNotify(infoPtr, nmhdr.hdr.idFrom, (LPARAM)&nmhdr); if (!infoPtr->bNtfUnicode) { Free(nmhdr.itemOld.pszText); @@ -614,9 +611,7 @@ TREEVIEW_SendTreeviewDnDNotify(const TREEVIEW_INFO *infoPtr, UINT code, nmhdr.ptDrag.x = pt.x; nmhdr.ptDrag.y = pt.y; - return (BOOL)TREEVIEW_SendRealNotify(infoPtr, - (WPARAM)nmhdr.hdr.idFrom, - (LPARAM)&nmhdr); + return (BOOL)TREEVIEW_SendRealNotify(infoPtr, nmhdr.hdr.idFrom, (LPARAM)&nmhdr); } @@ -644,9 +639,7 @@ TREEVIEW_SendCustomDrawNotify(const TREEVIEW_INFO *infoPtr, DWORD dwDrawStage, nmcdhdr.clrTextBk = infoPtr->clrBk; nmcdhdr.iLevel = 0; - return (BOOL)TREEVIEW_SendRealNotify(infoPtr, - (WPARAM)nmcd->hdr.idFrom, - (LPARAM)&nmcdhdr); + return (BOOL)TREEVIEW_SendRealNotify(infoPtr, nmcd->hdr.idFrom, (LPARAM)&nmcdhdr); } @@ -691,11 +684,9 @@ TREEVIEW_SendCustomDrawItemNotify(const TREEVIEW_INFO *infoPtr, HDC hdc, nmcd->dwDrawStage, nmcd->hdc, nmcd->dwItemSpec, nmcd->uItemState, nmcd->lItemlParam); - retval = TREEVIEW_SendRealNotify(infoPtr, - (WPARAM)nmcd->hdr.idFrom, - (LPARAM)nmcdhdr); + retval = TREEVIEW_SendRealNotify(infoPtr, nmcd->hdr.idFrom, (LPARAM)nmcdhdr); - return (BOOL)retval; + return retval; } static BOOL @@ -750,8 +741,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, if (mask & TVIF_TEXT) wineItem->textWidth = 0; - TREEVIEW_SendRealNotify(infoPtr, - (WPARAM)callback.hdr.idFrom, (LPARAM)&callback); + TREEVIEW_SendRealNotify(infoPtr, callback.hdr.idFrom, (LPARAM)&callback); /* It may have changed due to a call to SetItem. */ mask &= wineItem->callbackMask; @@ -3784,8 +3774,7 @@ TREEVIEW_EndEditLabelNow(TREEVIEW_INFO *infoPtr, BOOL bCancel) tvdi.item.cchTextMax = 0; } - bCommit = (BOOL)TREEVIEW_SendRealNotify(infoPtr, - (WPARAM)tvdi.hdr.idFrom, (LPARAM)&tvdi); + bCommit = (BOOL)TREEVIEW_SendRealNotify(infoPtr, tvdi.hdr.idFrom, (LPARAM)&tvdi); if (!bCancel && bCommit) /* Apply the changes */ { -- 2.11.4.GIT