OSDN Git Service

Cppcheck: C-style pointer casting
authorsdottaka <sdottaka@sourceforge.net>
Mon, 5 May 2014 15:45:53 +0000 (00:45 +0900)
committersdottaka <sdottaka@sourceforge.net>
Mon, 5 May 2014 15:45:53 +0000 (00:45 +0900)
--HG--
branch : stable

Src/Common/LanguageSelect.cpp
Src/EditorFilepathBar.cpp
Src/FilepathEdit.cpp
Src/HexMergeView.cpp

index 383c388..98f0ccc 100644 (file)
@@ -1103,11 +1103,11 @@ void CLanguageSelect::ReloadMenu()
                        while (pFrame)
                        {
                                if (pFrame->IsKindOf(RUNTIME_CLASS(CChildFrame)))
-                                       ((CChildFrame *)pFrame)->SetSharedMenu(hNewMergeMenu);
+                                       static_cast<CChildFrame *>(pFrame)->SetSharedMenu(hNewMergeMenu);
                                else if (pFrame->IsKindOf(RUNTIME_CLASS(COpenFrame)))
-                                       ((COpenFrame *)pFrame)->SetSharedMenu(hNewDefaultMenu);
+                                       static_cast<COpenFrame *>(pFrame)->SetSharedMenu(hNewDefaultMenu);
                                else if (pFrame->IsKindOf(RUNTIME_CLASS(CDirFrame)))
-                                       ((CDirFrame *)pFrame)->SetSharedMenu(hNewDirMenu);
+                                       static_cast<CDirFrame *>(pFrame)->SetSharedMenu(hNewDirMenu);
                                pFrame = pFrame->GetNextWindow();
                        }
 
index 75cbaf4..2255a81 100644 (file)
@@ -200,7 +200,7 @@ BOOL CEditorFilePathBar::OnToolTipNotify(UINT id, NMHDR * pTTTStruct, LRESULT *
                        HANDLE hOldFont = ::SelectObject(tempDC.GetSafeHdc(),hFont);
 
                        // fill in the returned structure
-                       CFilepathEdit * pItem = (CFilepathEdit*) GetDlgItem(nID);
+                       CFilepathEdit * pItem = static_cast<CFilepathEdit*>(GetDlgItem(nID));
                        pTTT->lpszText = (TCHAR*) pItem->GetUpdatedTipText(&tempDC, maxWidth);
 
                        // set old font back
index df516a3..01d8fac 100644 (file)
@@ -249,7 +249,7 @@ void CFilepathEdit::OnContextMenu(CWnd*, CPoint point)
                VERIFY(menu.LoadMenu(IDR_POPUP_EDITOR_HEADERBAR));
                theApp.TranslateMenu(menu.m_hMenu);
 
-               BCMenu* pPopup = (BCMenu *) menu.GetSubMenu(0);
+               BCMenu* pPopup = static_cast<BCMenu *>(menu.GetSubMenu(0));
                ASSERT(pPopup != NULL);
 
                if (m_sOriginalText.Right(1) == '\\')
index 1ee8742..7a33646 100644 (file)
@@ -180,7 +180,7 @@ void CHexMergeView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar * pScrollBar)
                {
                        pScrollBar->SetScrollInfo(&si);
                }
-               CSplitterWndEx *pSplitter = (CSplitterWndEx *)GetParentSplitter(this, TRUE);
+               CSplitterWndEx *pSplitter = static_cast<CSplitterWndEx *>(GetParentSplitter(this, TRUE));
                int nID = GetDlgCtrlID();
                nID ^= pSplitter->IdFromRowCol(0, 0) ^ pSplitter->IdFromRowCol(0, 1);
                CWnd *pWnd = pSplitter->GetDlgItem(nID);