From: Vadim Zeitlin Date: Sun, 2 Nov 2008 02:43:11 +0000 (+0000) Subject: replace wx_{const,static,reinterpret}_cast with their standard C++ equivalents X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/81d3348a9b8c0600424e159b67544b26bea77d4f replace wx_{const,static,reinterpret}_cast with their standard C++ equivalents git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56645 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 1902bdf531..ab41f78dc8 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -1315,7 +1315,7 @@ void MyPanel::OnListBoxButtons( wxCommandEvent &event ) static wxString GetDataString(wxClientData *data) { - return data ? wx_static_cast(wxStringClientData *, data)->GetData() + return data ? static_cast(data)->GetData() : wxString("none"); } diff --git a/samples/internat/internat.cpp b/samples/internat/internat.cpp index a9d2233b4d..96f289c2c6 100644 --- a/samples/internat/internat.cpp +++ b/samples/internat/internat.cpp @@ -194,7 +194,7 @@ bool MyApp::OnCmdLineParsed(wxCmdLineParser& parser) return false; } - m_lang = wx_static_cast(wxLanguage, lang->Language); + m_lang = static_cast(lang->Language); } return true; diff --git a/samples/ipc/connection.h b/samples/ipc/connection.h index 42d1816a07..bf01ab5d3e 100644 --- a/samples/ipc/connection.h +++ b/samples/ipc/connection.h @@ -36,23 +36,23 @@ protected: switch (format) { case wxIPC_TEXT: - s += wxString(wx_static_cast(const char *, data), size); + s += wxString(static_cast(data), size); break; #if wxUSE_UNICODE case wxIPC_UNICODETEXT: - s += wxString(wx_static_cast(const wchar_t *, data), size); + s += wxString(static_cast(data), size); break; #endif // wxUSE_UNICODE case wxIPC_UTF8TEXT: - s += wxString::FromUTF8(wx_static_cast(const char *, data), size); + s += wxString::FromUTF8(static_cast(data), size); break; case wxIPC_PRIVATE: if ( size == 3 ) { - const char *bytes = wx_static_cast(const char *, data); + const char *bytes = static_cast(data); s << '"' << bytes[0] << bytes[1] << bytes[2] << '"'; } else diff --git a/samples/mfc/mfctest.cpp b/samples/mfc/mfctest.cpp index 245feb580c..a4102648a9 100644 --- a/samples/mfc/mfctest.cpp +++ b/samples/mfc/mfctest.cpp @@ -228,7 +228,7 @@ int CTheApp::ExitInstance() BOOL CTheApp::PreTranslateMessage(MSG *msg) { wxEventLoop * const - evtLoop = wx_static_cast(wxEventLoop *, wxEventLoop::GetActive()); + evtLoop = static_cast(wxEventLoop::GetActive()); if ( evtLoop && evtLoop->PreProcessMessage(msg) ) return TRUE; diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index 14f3fd951c..b38e860528 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -604,7 +604,7 @@ void MyFrame::OnHitTest(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnType(wxCommandEvent& event) { - m_type = wx_static_cast(BookType, event.GetId() - ID_BOOK_NOTEBOOK); + m_type = static_cast(event.GetId() - ID_BOOK_NOTEBOOK); if ( m_bookCtrl ) m_sizerFrame->Hide(m_bookCtrl); @@ -919,7 +919,7 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event) // NB: can't use wxStaticCast here as wxBookCtrlBase is not in // wxRTTI const wxBookCtrlBase * const - book = wx_static_cast(wxBookCtrlBase *, event.GetEventObject()); + book = static_cast(event.GetEventObject()); if ( idx != wxNOT_FOUND && book && book->GetPageText(idx) == VETO_PAGE_NAME ) { diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index 7987424ac1..463d40c227 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -499,7 +499,7 @@ void StaticWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void StaticWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event) { - if (event.GetEventObject() == wx_static_cast(wxObject*, m_chkEllipsize)) + if (event.GetEventObject() == static_cast(m_chkEllipsize)) { m_radioEllipsize->Enable(event.IsChecked()); } diff --git a/utils/wxrc/wxrc.cpp b/utils/wxrc/wxrc.cpp index fef806dec4..940913e555 100644 --- a/utils/wxrc/wxrc.cpp +++ b/utils/wxrc/wxrc.cpp @@ -581,7 +581,7 @@ static wxString FileToCppArray(wxString filename, int num) wxASSERT_MSG( offset >= 0 , wxT("Invalid file length") ); const size_t lng = wx_truncate_cast(size_t, offset); - wxASSERT_MSG( wx_static_cast(wxFileOffset, lng) == offset, + wxASSERT_MSG( static_cast(lng) == offset, wxT("Huge file not supported") ); snum.Printf(_T("%i"), num); @@ -735,7 +735,7 @@ static wxString FileToPythonArray(wxString filename, int num) wxASSERT_MSG( offset >= 0 , wxT("Invalid file length") ); const size_t lng = wx_truncate_cast(size_t, offset); - wxASSERT_MSG( wx_static_cast(wxFileOffset, lng) == offset, + wxASSERT_MSG( static_cast(lng) == offset, wxT("Huge file not supported") ); snum.Printf(_T("%i"), num);