Author: tfaber Date: Sun Apr 13 12:20:31 2014 New Revision: 62737
URL: http://svn.reactos.org/svn/reactos?rev=62737&view=rev Log: [SHELL32] - Use C++-style casts. Patch by Ivan Rodionov. CORE-7698 #resolve
Modified: trunk/reactos/dll/win32/shell32/autocomplete.cpp trunk/reactos/dll/win32/shell32/desktop.cpp trunk/reactos/dll/win32/shell32/drvdefext.cpp trunk/reactos/dll/win32/shell32/enumidlist.cpp trunk/reactos/dll/win32/shell32/filedefext.cpp trunk/reactos/dll/win32/shell32/folders/recyclebin.cpp trunk/reactos/dll/win32/shell32/newmenu.cpp trunk/reactos/dll/win32/shell32/openwithmenu.cpp trunk/reactos/dll/win32/shell32/shelllink.cpp trunk/reactos/dll/win32/shell32/shlview.cpp
Modified: trunk/reactos/dll/win32/shell32/autocomplete.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/autocompl... ============================================================================== --- trunk/reactos/dll/win32/shell32/autocomplete.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/autocomplete.cpp [iso-8859-1] Sun Apr 13 12:20:31 2014 @@ -256,7 +256,7 @@ */ LRESULT APIENTRY CAutoComplete::ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - CAutoComplete *pThis = (CAutoComplete *)GetPropW(hwnd, autocomplete_propertyW);;//GetWindowLongPtrW(hwnd, GWLP_USERDATA); + CAutoComplete *pThis = static_cast<CAutoComplete *>(GetPropW(hwnd, autocomplete_propertyW));//GetWindowLongPtrW(hwnd, GWLP_USERDATA); LPOLESTR strs; HRESULT hr; WCHAR hwndText[255]; @@ -488,7 +488,7 @@
LRESULT APIENTRY CAutoComplete::ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - CAutoComplete *pThis = (CAutoComplete *)GetWindowLongPtrW(hwnd, GWLP_USERDATA); + CAutoComplete *pThis = reinterpret_cast<CAutoComplete *>(GetWindowLongPtrW(hwnd, GWLP_USERDATA)); WCHAR *msg; int sel, len;
Modified: trunk/reactos/dll/win32/shell32/desktop.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/desktop.c... ============================================================================== --- trunk/reactos/dll/win32/shell32/desktop.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/desktop.cpp [iso-8859-1] Sun Apr 13 12:20:31 2014 @@ -389,8 +389,7 @@
if (uMsg != WM_NCCREATE) { - pThis = (CDesktopBrowser*)GetWindowLongPtrW(hwnd, - 0); + pThis = reinterpret_cast<CDesktopBrowser *>(GetWindowLongPtrW(hwnd, 0)); if (pThis == NULL) goto DefMsgHandler; } @@ -554,7 +553,7 @@ */ BOOL WINAPI SHDesktopMessageLoop(HANDLE hDesktop) { - CDesktopBrowser *Desk = (CDesktopBrowser *)hDesktop; + CDesktopBrowser *Desk = static_cast<CDesktopBrowser *>(hDesktop);
if (Desk == NULL || Desk->Tag != SHDESK_TAG) {
Modified: trunk/reactos/dll/win32/shell32/drvdefext.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/drvdefext... ============================================================================== --- trunk/reactos/dll/win32/shell32/drvdefext.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/drvdefext.cpp [iso-8859-1] Sun Apr 13 12:20:31 2014 @@ -339,7 +339,7 @@ if (ppsp == NULL) break;
- CDrvDefExt *pDrvDefExt = (CDrvDefExt*)ppsp->lParam; + CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(ppsp->lParam); SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pDrvDefExt); pDrvDefExt->InitGeneralPage(hwndDlg); return TRUE; @@ -350,7 +350,7 @@
if (pDrawItem->CtlID >= 14013 && pDrawItem->CtlID <= 14015) { - CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER)); pDrvDefExt->PaintStaticControls(hwndDlg, pDrawItem); return TRUE; } @@ -361,7 +361,7 @@ case WM_COMMAND: if (LOWORD(wParam) == 14010) /* Disk Cleanup */ { - CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER)); WCHAR wszBuf[256]; DWORD cbBuf = sizeof(wszBuf);
@@ -395,7 +395,7 @@
if (lppsn->hdr.code == PSN_APPLY) { - CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER)); WCHAR wszBuf[256];
if (GetDlgItemTextW(hwndDlg, 14000, wszBuf, _countof(wszBuf))) @@ -432,7 +432,7 @@ { WCHAR wszBuf[MAX_PATH]; DWORD cbBuf = sizeof(wszBuf); - CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + CDrvDefExt *pDrvDefExt = reinterpret_cast<CDrvDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
switch(LOWORD(wParam)) {
Modified: trunk/reactos/dll/win32/shell32/enumidlist.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/enumidlis... ============================================================================== --- trunk/reactos/dll/win32/shell32/enumidlist.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/enumidlist.cpp [iso-8859-1] Sun Apr 13 12:20:31 2014 @@ -45,7 +45,7 @@ if (!pidl) return FALSE;
- pNew = (ENUMLIST *)SHAlloc(sizeof(ENUMLIST)); + pNew = static_cast<ENUMLIST *>(SHAlloc(sizeof(ENUMLIST))); if (pNew) { /*set the next pointer */
Modified: trunk/reactos/dll/win32/shell32/filedefext.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/filedefex... ============================================================================== --- trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/filedefext.cpp [iso-8859-1] Sun Apr 13 12:20:31 2014 @@ -626,7 +626,7 @@
TRACE("WM_INITDIALOG hwnd %p lParam %p ppsplParam %S\n", hwndDlg, lParam, ppsp->lParam);
- CFileDefExt *pFileDefExt = (CFileDefExt*)ppsp->lParam; + CFileDefExt *pFileDefExt = reinterpret_cast<CFileDefExt *>(ppsp->lParam); SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pFileDefExt); pFileDefExt->InitGeneralPage(hwndDlg); break; @@ -634,7 +634,7 @@ case WM_COMMAND: if (LOWORD(wParam) == 14024) /* Opens With - Change */ { - CFileDefExt *pFileDefExt = (CFileDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + CFileDefExt *pFileDefExt = reinterpret_cast<CFileDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER)); OPENASINFO oainfo; oainfo.pcszFile = pFileDefExt->m_wszPath; oainfo.pcszClass = NULL; @@ -654,7 +654,7 @@ LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam; if (lppsn->hdr.code == PSN_APPLY) { - CFileDefExt *pFileDefExt = (CFileDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + CFileDefExt *pFileDefExt = reinterpret_cast<CFileDefExt *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
/* Update attributes first */ DWORD dwAttr = GetFileAttributesW(pFileDefExt->m_wszPath); @@ -826,7 +826,7 @@
TRACE("WM_INITDIALOG hwnd %p lParam %p ppsplParam %x\n", hwndDlg, lParam, ppsp->lParam);
- CFileDefExt *pFileDefExt = (CFileDefExt*)ppsp->lParam; + CFileDefExt *pFileDefExt = reinterpret_cast<CFileDefExt *>(ppsp->lParam); return pFileDefExt->InitVersionPage(hwndDlg); } case WM_COMMAND:
Modified: trunk/reactos/dll/win32/shell32/folders/recyclebin.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/folders/r... ============================================================================== --- trunk/reactos/dll/win32/shell32/folders/recyclebin.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/folders/recyclebin.cpp [iso-8859-1] Sun Apr 13 12:20:31 2014 @@ -231,7 +231,7 @@
BOOL WINAPI CRecycleBinEnum::CBEnumRecycleBin(IN PVOID Context, IN HANDLE hDeletedFile) { - return ((CRecycleBinEnum *)Context)->CBEnumRecycleBin(hDeletedFile); + return static_cast<CRecycleBinEnum *>(Context)->CBEnumRecycleBin(hDeletedFile); }
BOOL WINAPI CRecycleBinEnum::CBEnumRecycleBin(IN HANDLE hDeletedFile)
Modified: trunk/reactos/dll/win32/shell32/newmenu.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/newmenu.c... ============================================================================== --- trunk/reactos/dll/win32/shell32/newmenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/newmenu.cpp [iso-8859-1] Sun Apr 13 12:20:31 2014 @@ -165,7 +165,7 @@ return NULL;
/* Create new item */ - SHELLNEW_ITEM *pNewItem = (SHELLNEW_ITEM *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SHELLNEW_ITEM)); + SHELLNEW_ITEM *pNewItem = static_cast<SHELLNEW_ITEM *>(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SHELLNEW_ITEM))); if (!pNewItem) { free(pData); @@ -225,7 +225,7 @@
if (!m_pLinkItem) { - m_pLinkItem = (SHELLNEW_ITEM *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SHELLNEW_ITEM)); + m_pLinkItem = static_cast<SHELLNEW_ITEM *>(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SHELLNEW_ITEM))); if (m_pLinkItem) { m_pLinkItem->Type = SHELLNEW_TYPE_NULLFILE;
Modified: trunk/reactos/dll/win32/shell32/openwithmenu.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/openwithm... ============================================================================== --- trunk/reactos/dll/win32/shell32/openwithmenu.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/openwithmenu.cpp [iso-8859-1] Sun Apr 13 12:20:31 2014 @@ -297,9 +297,9 @@
/* Create new item */ if (!m_pApp) - m_pApp = (SApp*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(m_pApp[0])); + m_pApp = static_cast<SApp *>(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(m_pApp[0]))); else - m_pApp = (SApp*)HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, m_pApp, (m_cApp + 1)*sizeof(m_pApp[0])); + m_pApp = static_cast<SApp *>(HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, m_pApp, (m_cApp + 1)*sizeof(m_pApp[0]))); if (!m_pApp) { ERR("Allocation failed\n"); @@ -989,13 +989,13 @@
INT_PTR CALLBACK COpenWithDialog::DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - COpenWithDialog *pThis = (COpenWithDialog*)GetWindowLongPtr(hwndDlg, DWLP_USER); + COpenWithDialog *pThis = reinterpret_cast<COpenWithDialog *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
switch(uMsg) { case WM_INITDIALOG: { - COpenWithDialog *pThis = (COpenWithDialog*)lParam; + COpenWithDialog *pThis = reinterpret_cast<COpenWithDialog *>(lParam);
pThis->Init(hwndDlg); return TRUE;
Modified: trunk/reactos/dll/win32/shell32/shelllink.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shelllink... ============================================================================== --- trunk/reactos/dll/win32/shell32/shelllink.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shelllink.cpp [iso-8859-1] Sun Apr 13 12:20:31 2014 @@ -359,7 +359,7 @@ if (FAILED(hr) || count != sizeof(size)) return E_FAIL;
- chunk = (sized_chunk *)HeapAlloc(GetProcessHeap(), 0, size); + chunk = static_cast<sized_chunk *>(HeapAlloc(GetProcessHeap(), 0, size)); if (!chunk) return E_OUTOFMEMORY;
@@ -421,7 +421,7 @@ if (FAILED(hr)) return hr;
- LOCATION_INFO *loc = (LOCATION_INFO*) p; + LOCATION_INFO *loc = reinterpret_cast<LOCATION_INFO *>(p); if (loc->dwTotalSize < sizeof(LOCATION_INFO)) { HeapFree(GetProcessHeap(), 0, p); @@ -721,7 +721,7 @@ DWORD total_size = sizeof(*loc) + volume_info_size + path_size + final_path_size;
/* create pointers to everything */ - loc = (LOCATION_INFO *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, total_size); + loc = static_cast<LOCATION_INFO *>(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, total_size)); vol = (LOCAL_VOLUME_INFO*) &loc[1]; LPSTR szLabel = (LPSTR) &vol[1]; LPSTR szPath = &szLabel[label_size]; @@ -1954,7 +1954,7 @@
INT_PTR CALLBACK CShellLink::SH_ShellLinkDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - CShellLink *pThis = (CShellLink *)GetWindowLongPtr(hwndDlg, DWLP_USER); + CShellLink *pThis = reinterpret_cast<CShellLink *>(GetWindowLongPtr(hwndDlg, DWLP_USER));
switch(uMsg) { @@ -1966,7 +1966,7 @@
TRACE("ShellLink_DlgProc (WM_INITDIALOG hwnd %p lParam %p ppsplParam %x)\n", hwndDlg, lParam, ppsp->lParam);
- pThis = (CShellLink *)ppsp->lParam; + pThis = reinterpret_cast<CShellLink *>(ppsp->lParam); SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pThis);
TRACE("sArgs: %S sComponent: %S sDescription: %S sIcoPath: %S sPath: %S sPathRel: %S sProduct: %S sWorkDir: %S\n", pThis->sArgs, pThis->sComponent, pThis->sDescription,
Modified: trunk/reactos/dll/win32/shell32/shlview.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlview.c... ============================================================================== --- trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shlview.cpp [iso-8859-1] Sun Apr 13 12:20:31 2014 @@ -816,7 +816,7 @@ INT CALLBACK CDefView::fill_list( LPVOID ptr, LPVOID arg ) { LPITEMIDLIST pidl = (LPITEMIDLIST)ptr; - CDefView *pThis = (CDefView *)arg; + CDefView *pThis = static_cast<CDefView *>(arg); /* in a commdlg This works as a filemask*/ if (pThis->IncludeObject(pidl) == S_OK) pThis->LV_AddItem(pidl);