From 5c33522fca7cddc441a316f5b9fb50d7685435ba Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 2 Nov 2008 02:39:52 +0000 Subject: [PATCH] replace wx_{const,static,reinterpret}_cast with their standard C++ equivalents git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/app.h | 4 ++-- include/wx/arrimpl.cpp | 4 ++-- include/wx/brush.h | 2 +- include/wx/buffer.h | 4 ++-- include/wx/ctrlsub.h | 4 ++-- include/wx/event.h | 2 +- include/wx/gdiobj.h | 4 ++-- include/wx/generic/grid.h | 4 ++-- include/wx/gtk/bitmap.h | 2 +- include/wx/gtk/textctrl.h | 4 ++-- include/wx/gtk1/bitmap.h | 2 +- include/wx/hashmap.h | 26 +++++++++++++------------- include/wx/image.h | 4 ++-- include/wx/list.h | 2 +- include/wx/listbase.h | 2 +- include/wx/motif/private.h | 2 +- include/wx/msw/bitmap.h | 2 +- include/wx/msw/helpchm.h | 4 ++-- include/wx/msw/icon.h | 2 +- include/wx/msw/private.h | 2 +- include/wx/msw/stackwalk.h | 4 ++-- include/wx/msw/subwin.h | 2 +- include/wx/object.h | 10 +++++----- include/wx/os2/bitmap.h | 2 +- include/wx/os2/icon.h | 2 +- include/wx/pen.h | 2 +- include/wx/stackwalk.h | 2 +- include/wx/string.h | 8 ++++---- include/wx/strvararg.h | 4 ++-- include/wx/univ/statusbr.h | 2 +- include/wx/univ/toplevel.h | 2 +- include/wx/unix/gsockunx.h | 4 ++-- include/wx/x11/bitmap.h | 2 +- include/wx/xlocale.h | 26 +++++++++++++------------- include/wx/xpmdecod.h | 2 +- src/cocoa/bitmap.mm | 4 ++-- src/cocoa/font.mm | 2 +- src/cocoa/icon.mm | 2 +- src/common/appbase.cpp | 2 +- src/common/base64.cpp | 6 +++--- src/common/colourcmn.cpp | 2 +- src/common/containr.cpp | 2 +- src/common/convauto.cpp | 4 ++-- src/common/ctrlsub.cpp | 6 +++--- src/common/datavcmn.cpp | 2 +- src/common/datetime.cpp | 2 +- src/common/dobjcmn.cpp | 2 +- src/common/event.cpp | 2 +- src/common/fileconf.cpp | 10 +++++----- src/common/gdicmn.cpp | 12 ++++++------ src/common/glcmn.cpp | 2 +- src/common/iconbndl.cpp | 2 +- src/common/image.cpp | 8 ++++---- src/common/intl.cpp | 2 +- src/common/ipcbase.cpp | 6 +++--- src/common/memory.cpp | 4 ++-- src/common/radiocmn.cpp | 2 +- src/common/regex.cpp | 2 +- src/common/rgncmn.cpp | 2 +- src/common/sstream.cpp | 8 ++++---- src/common/stattextcmn.cpp | 2 +- src/common/strconv.cpp | 34 +++++++++++++++++----------------- src/common/strvararg.cpp | 6 +++--- src/common/toplvcmn.cpp | 6 +++--- src/common/uri.cpp | 2 +- src/common/variant.cpp | 2 +- src/common/wincmn.cpp | 6 +++--- src/common/wrapsizer.cpp | 2 +- src/common/wxcrt.cpp | 8 ++++---- src/common/xlocale.cpp | 2 +- src/common/zipstrm.cpp | 6 +++--- src/dfb/app.cpp | 2 +- src/generic/animateg.cpp | 2 +- src/generic/calctrlg.cpp | 2 +- src/generic/datavgen.cpp | 2 +- src/generic/filectrlg.cpp | 2 +- src/generic/notebook.cpp | 2 +- src/generic/paletteg.cpp | 2 +- src/generic/vlbox.cpp | 4 ++-- src/gtk/aboutdlg.cpp | 2 +- src/gtk/bitmap.cpp | 6 +++--- src/gtk/colordlg.cpp | 2 +- src/gtk/colour.cpp | 4 ++-- src/gtk/cursor.cpp | 4 ++-- src/gtk/dataview.cpp | 2 +- src/gtk/font.cpp | 2 +- src/gtk/glcanvas.cpp | 4 ++-- src/gtk/mdi.cpp | 4 ++-- src/gtk/spinctrl.cpp | 2 +- src/gtk/tbargtk.cpp | 14 +++++++------- src/gtk/utilsgtk.cpp | 2 +- src/gtk/window.cpp | 6 +++--- src/gtk1/bitmap.cpp | 2 +- src/gtk1/choice.cpp | 2 +- src/gtk1/cursor.cpp | 2 +- src/gtk1/dcclient.cpp | 2 +- src/gtk1/font.cpp | 2 +- src/gtk1/glcanvas.cpp | 4 ++-- src/gtk1/minifram.cpp | 4 ++-- src/gtk1/settings.cpp | 2 +- src/gtk1/utilsgtk.cpp | 2 +- src/mgl/bitmap.cpp | 2 +- src/motif/cursor.cpp | 2 +- src/motif/font.cpp | 4 ++-- src/msdos/utilsdos.cpp | 2 +- src/msw/app.cpp | 2 +- src/msw/bitmap.cpp | 6 +++--- src/msw/button.cpp | 2 +- src/msw/calctrl.cpp | 2 +- src/msw/checkbox.cpp | 2 +- src/msw/colordlg.cpp | 2 +- src/msw/datectrl.cpp | 2 +- src/msw/dcprint.cpp | 2 +- src/msw/display.cpp | 6 +++--- src/msw/dlmsw.cpp | 2 +- src/msw/enhmeta.cpp | 2 +- src/msw/filedlg.cpp | 4 ++-- src/msw/font.cpp | 4 ++-- src/msw/gdiobj.cpp | 2 +- src/msw/icon.cpp | 2 +- src/msw/listctrl.cpp | 2 +- src/msw/mediactrl_am.cpp | 2 +- src/msw/menu.cpp | 10 +++++----- src/msw/menuitem.cpp | 2 +- src/msw/metafile.cpp | 2 +- src/msw/notebook.cpp | 2 +- src/msw/ole/dataobj.cpp | 2 +- src/msw/palette.cpp | 2 +- src/msw/pen.cpp | 12 ++++++------ src/msw/printdlg.cpp | 24 ++++++++++++------------ src/msw/printwin.cpp | 2 +- src/msw/registry.cpp | 4 ++-- src/msw/stackwalk.cpp | 2 +- src/msw/stattext.cpp | 2 +- src/msw/textctrl.cpp | 2 +- src/msw/textentry.cpp | 6 +++--- src/msw/tglbtn.cpp | 2 +- src/msw/toolbar.cpp | 4 ++-- src/msw/utils.cpp | 2 +- src/os2/bitmap.cpp | 2 +- src/os2/font.cpp | 2 +- src/os2/metafile.cpp | 2 +- src/os2/palette.cpp | 2 +- src/os2/pen.cpp | 4 ++-- src/os2/stdpaths.cpp | 2 +- src/osx/carbon/app.cpp | 2 +- src/osx/carbon/cursor.cpp | 4 ++-- src/osx/carbon/dialog.cpp | 2 +- src/osx/carbon/font.cpp | 2 +- src/osx/carbon/glcanvas.cpp | 2 +- src/osx/carbon/icon.cpp | 2 +- src/osx/carbon/listctrl_mac.cpp | 4 ++-- src/osx/carbon/metafile.cpp | 10 +++++----- src/osx/carbon/region.cpp | 10 +++++----- src/osx/carbon/textctrl.cpp | 2 +- src/osx/carbon/toolbar.cpp | 8 ++++---- src/osx/carbon/utils.cpp | 3 +-- src/osx/carbon/window.cpp | 12 ++++++------ src/osx/cocoa/toolbar.mm | 8 ++++---- src/osx/core/bitmap.cpp | 2 +- src/osx/core/gsockosx.cpp | 6 +++--- src/osx/imaglist.cpp | 14 +++++++------- src/osx/palette.cpp | 2 +- src/osx/pen.cpp | 2 +- src/palmos/font.cpp | 2 +- src/palmos/main.cpp | 2 +- src/palmos/pen.cpp | 2 +- src/unix/displayx11.cpp | 2 +- src/unix/stdpaths.cpp | 4 ++-- src/x11/bitmap.cpp | 2 +- src/x11/cursor.cpp | 2 +- src/x11/font.cpp | 2 +- src/x11/glcanvas.cpp | 2 +- src/x11/palette.cpp | 2 +- 174 files changed, 347 insertions(+), 348 deletions(-) diff --git a/include/wx/app.h b/include/wx/app.h index ccba276..2efde73 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -633,7 +633,7 @@ protected: // // the cast is safe as in GUI build we only use wxApp, not wxAppConsole, and in // console mode it does nothing at all -#define wxTheApp wx_static_cast(wxApp*, wxApp::GetInstance()) +#define wxTheApp static_cast(wxApp::GetInstance()) // ---------------------------------------------------------------------------- // global functions @@ -710,7 +710,7 @@ public: wxAppInitializer \ wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \ DECLARE_APP(appname) \ - appname& wxGetApp() { return *wx_static_cast(appname*, wxApp::GetInstance()); } + appname& wxGetApp() { return *static_cast(wxApp::GetInstance()); } // Same as IMPLEMENT_APP() normally but doesn't include themes support in // wxUniversal builds diff --git a/include/wx/arrimpl.cpp b/include/wx/arrimpl.cpp index bde7736..d9a53a4 100644 --- a/include/wx/arrimpl.cpp +++ b/include/wx/arrimpl.cpp @@ -98,7 +98,7 @@ int name::Index(const T& Item, bool bFromEnd) const \ size_t ui = size() - 1; \ do { \ if ( (T*)base_array::operator[](ui) == &Item ) \ - return wx_static_cast(int, ui); \ + return static_cast(ui); \ ui--; \ } \ while ( ui != 0 ); \ @@ -107,7 +107,7 @@ int name::Index(const T& Item, bool bFromEnd) const \ else { \ for( size_t ui = 0; ui < size(); ui++ ) { \ if( (T*)base_array::operator[](ui) == &Item ) \ - return wx_static_cast(int, ui); \ + return static_cast(ui); \ } \ } \ \ diff --git a/include/wx/brush.h b/include/wx/brush.h index 7ad4519..9eb0a4c 100644 --- a/include/wx/brush.h +++ b/include/wx/brush.h @@ -108,7 +108,7 @@ extern WXDLLIMPEXP_DATA_CORE(wxBrushList*) wxTheBrushList; inline bool operator==(wxBrushStyle s, wxDeprecatedGUIConstants t) { - return wx_static_cast(int, s) == wx_static_cast(int, t); + return static_cast(s) == static_cast(t); } inline bool operator!=(wxBrushStyle s, wxDeprecatedGUIConstants t) diff --git a/include/wx/buffer.h b/include/wx/buffer.h index 136f6ee..231c8d1 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -88,7 +88,7 @@ public: { wxCharTypeBuffer buf; if ( str ) - buf.m_data = new Data(wx_const_cast(CharType*, str), Data::NonOwned); + buf.m_data = new Data(const_cast(str), Data::NonOwned); return buf; } @@ -110,7 +110,7 @@ public: CharType * const p = m_data->Get(); - wxCharTypeBuffer *self = wx_const_cast(wxCharTypeBuffer*, this); + wxCharTypeBuffer *self = const_cast(this); self->m_data->Set(NULL); self->DecRef(); diff --git a/include/wx/ctrlsub.h b/include/wx/ctrlsub.h index 6cdbee1..109369b 100644 --- a/include/wx/ctrlsub.h +++ b/include/wx/ctrlsub.h @@ -133,7 +133,7 @@ private: wxASSERT_MSG( GetClientDataType() != wxClientData_Void, _T("can't mix different types of client data") ); - return AppendItems(items, wx_reinterpret_cast(void **, clientData), + return AppendItems(items, reinterpret_cast(clientData), wxClientData_Object); } @@ -180,7 +180,7 @@ private: _T("can't mix different types of client data") ); return InsertItems(items, pos, - wx_reinterpret_cast(void **, clientData), + reinterpret_cast(clientData), wxClientData_Object); } diff --git a/include/wx/event.h b/include/wx/event.h index 0d31e32..476ac5b 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -69,7 +69,7 @@ typedef int wxEventType; // this is used to make the event table entry type safe, so that for an event // handler only a function with proper parameter list can be given. -#define wxStaticCastEvent(type, val) wx_static_cast(type, val) +#define wxStaticCastEvent(type, val) static_cast(val) #define DECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) \ wxEventTableEntry(type, winid, idLast, fn, obj) diff --git a/include/wx/gdiobj.h b/include/wx/gdiobj.h index da977d3..a7f946d 100644 --- a/include/wx/gdiobj.h +++ b/include/wx/gdiobj.h @@ -40,7 +40,7 @@ public: { // the cast here is safe because the derived classes always create // wxGDIRefData objects - return m_refData && wx_static_cast(wxGDIRefData *, m_refData)->IsOk(); + return m_refData && static_cast(m_refData)->IsOk(); } // don't use in the new code, use IsOk() instead @@ -74,7 +74,7 @@ protected: virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const { - return CloneGDIRefData(wx_static_cast(const wxGDIRefData *, data)); + return CloneGDIRefData(static_cast(data)); } virtual wxGDIRefData *CreateGDIRefData() const = 0; diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 1cd87af..6bee40b 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -913,9 +913,9 @@ public: // would break the existing code overriding them, so instead we provide // these const synonyms which can be used from const-correct code int GetRowsCount() const - { return wx_const_cast(wxGridTableBase *, this)->GetNumberRows(); } + { return const_cast(this)->GetNumberRows(); } int GetColsCount() const - { return wx_const_cast(wxGridTableBase *, this)->GetNumberCols(); } + { return const_cast(this)->GetNumberCols(); } virtual bool IsEmptyCell( int row, int col ) = 0; diff --git a/include/wx/gtk/bitmap.h b/include/wx/gtk/bitmap.h index ac0581b..c1eee5c 100644 --- a/include/wx/gtk/bitmap.h +++ b/include/wx/gtk/bitmap.h @@ -57,7 +57,7 @@ public: #ifdef wxNEEDS_CHARPP // needed for old GCC wxBitmap(char** data) - { *this = wxBitmap(wx_const_cast(const char* const*, data)); } + { *this = wxBitmap(const_cast(data)); } #endif wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE ); #if wxUSE_IMAGE diff --git a/include/wx/gtk/textctrl.h b/include/wx/gtk/textctrl.h index 19d716f..a06a8a6 100644 --- a/include/wx/gtk/textctrl.h +++ b/include/wx/gtk/textctrl.h @@ -195,8 +195,8 @@ private: // both void *GetTextObject() const { - return IsMultiLine() ? wx_static_cast(void *, m_buffer) - : wx_static_cast(void *, m_text); + return IsMultiLine() ? static_cast(m_buffer) + : static_cast(m_text); } diff --git a/include/wx/gtk1/bitmap.h b/include/wx/gtk1/bitmap.h index 30bc29e..5ae629f 100644 --- a/include/wx/gtk1/bitmap.h +++ b/include/wx/gtk1/bitmap.h @@ -72,7 +72,7 @@ public: // needed for old GCC wxBitmap(char** data) { - *this = wxBitmap(wx_const_cast(const char* const*, data)); + *this = wxBitmap(const_cast(data)); } #endif wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE ); diff --git a/include/wx/hashmap.h b/include/wx/hashmap.h index e2e5619..8618a21 100644 --- a/include/wx/hashmap.h +++ b/include/wx/hashmap.h @@ -161,7 +161,7 @@ public: \ public: \ Node( const value_type& value ) \ : m_value( value ) {} \ - Node* next() { return wx_static_cast(Node*, m_next); } \ + Node* next() { return static_cast(m_next); } \ \ value_type m_value; \ }; \ @@ -169,7 +169,7 @@ public: \ protected: \ static void DeleteNode( _wxHashTable_NodeBase* node ) \ { \ - delete wx_static_cast(Node*, node); \ + delete static_cast(node); \ } \ public: \ /* */ \ @@ -183,7 +183,7 @@ public: \ \ Iterator() : m_node(NULL), m_ht(NULL) {} \ Iterator( Node* node, const Self* ht ) \ - : m_node(node), m_ht(wx_const_cast(Self*, ht)) {} \ + : m_node(node), m_ht(const_cast(ht)) {} \ bool operator ==( const Iterator& it ) const \ { return m_node == it.m_node; } \ bool operator !=( const Iterator& it ) const \ @@ -195,7 +195,7 @@ public: \ for( size_type i = bucket + 1; i < m_ht->m_tableBuckets; ++i ) \ { \ if( m_ht->m_table[i] ) \ - return wx_static_cast(Node*, m_ht->m_table[i]); \ + return static_cast(m_ht->m_table[i]); \ } \ return NULL; \ } \ @@ -226,7 +226,7 @@ public: \ const_iterator() : Iterator() {} \ const_iterator(iterator i) : Iterator(i) {} \ const_iterator( Node* node, const Self* ht ) \ - : Iterator(node, wx_const_cast(Self*, ht)) {} \ + : Iterator(node, const_cast(ht)) {} \ const_iterator& operator++() { PlusPlus();return *this; } \ const_iterator operator++(int) { const_iterator it=*this;PlusPlus();return it; } \ const_reference operator *() const { return m_node->m_value; } \ @@ -295,9 +295,9 @@ public: \ const_iterator end() const { return const_iterator(NULL, this); } \ iterator end() { return iterator(NULL, this); } \ const_iterator begin() const \ - { return const_iterator(wx_static_cast(Node*, GetFirstNode(m_tableBuckets, m_table)), this); } \ + { return const_iterator(static_cast(GetFirstNode(m_tableBuckets, m_table)), this); } \ iterator begin() \ - { return iterator(wx_static_cast(Node*, GetFirstNode(m_tableBuckets, m_table)), this); } \ + { return iterator(static_cast(GetFirstNode(m_tableBuckets, m_table)), this); } \ \ size_type erase( const const_key_type& key ) \ { \ @@ -308,7 +308,7 @@ public: \ \ --m_items; \ _wxHashTable_NodeBase* temp = (*node)->m_next; \ - delete wx_static_cast(Node*, *node); \ + delete static_cast(*node); \ (*node) = temp; \ if( SHOULD_SHRINK( m_tableBuckets, m_items ) ) \ ResizeTable( GetPreviousPrime( (unsigned long) m_tableBuckets ) - 1 ); \ @@ -327,7 +327,7 @@ protected: \ { \ const const_key_type& key = m_getKey( value ); \ size_t bucket = m_hasher( key ) % m_tableBuckets; \ - Node* node = wx_static_cast(Node*, m_table[bucket]); \ + Node* node = static_cast(m_table[bucket]); \ \ while( node ) \ { \ @@ -367,7 +367,7 @@ protected: \ \ while( *node ) \ { \ - if (m_equals(m_getKey(wx_static_cast(Node*, *node)->m_value), key)) \ + if (m_equals(m_getKey(static_cast(*node)->m_value), key)) \ return node; \ node = &(*node)->m_next; \ } \ @@ -380,7 +380,7 @@ protected: \ Node* GetNode( const const_key_type& key ) const \ { \ size_t bucket = m_hasher( key ) % m_tableBuckets; \ - Node* node = wx_static_cast(Node*, m_table[bucket]); \ + Node* node = static_cast(m_table[bucket]); \ \ while( node ) \ { \ @@ -433,7 +433,7 @@ public: \ typedef const VALUE_T const_t2; \ \ CLASSNAME(const const_t1& f, const const_t2& s) \ - : first(wx_const_cast(t1&, f)), second(wx_const_cast(t2&, s)) {} \ + : first(const_cast(f)), second(const_cast(s)) {} \ \ t1 first; \ t2 second; \ @@ -536,7 +536,7 @@ public: unsigned long operator()( short x ) const { return (unsigned long)x; } unsigned long operator()( unsigned short x ) const { return x; } #if defined wxLongLong_t && !defined wxLongLongIsLong - wxULongLong_t operator()( wxLongLong_t x ) const { return wx_static_cast(wxULongLong_t, x); } + wxULongLong_t operator()( wxLongLong_t x ) const { return static_cast(x); } wxULongLong_t operator()( wxULongLong_t x ) const { return x; } #endif diff --git a/include/wx/image.h b/include/wx/image.h index b40f7d3..b09aaf2 100644 --- a/include/wx/image.h +++ b/include/wx/image.h @@ -233,8 +233,8 @@ public: bool Create( const char* const* xpmData ); #ifdef __BORLANDC__ // needed for Borland 5.5 - wxImage( char** xpmData ) { Create(wx_const_cast(const char* const*, xpmData)); } - bool Create( char** xpmData ) { return Create(wx_const_cast(const char* const*, xpmData)); } + wxImage( char** xpmData ) { Create(const_cast(xpmData)); } + bool Create( char** xpmData ) { return Create(const_cast(xpmData)); } #endif void Destroy(); diff --git a/include/wx/list.h b/include/wx/list.h index a93d2ec..5f9b4d1 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -457,7 +457,7 @@ protected: virtual void DeleteData() { } public: // for wxList::iterator - void** GetDataPtr() const { return &(wx_const_cast(wxNodeBase*, this)->m_data); } + void** GetDataPtr() const { return &(const_cast(this)->m_data); } private: // optional key stuff wxListKeyValue m_key; diff --git a/include/wx/listbase.h b/include/wx/listbase.h index f0f2ffc..4fad38b 100644 --- a/include/wx/listbase.h +++ b/include/wx/listbase.h @@ -403,7 +403,7 @@ public: const wxString& GetLabel() const { return m_item.m_text; } const wxString& GetText() const { return m_item.m_text; } int GetImage() const { return m_item.m_image; } - long GetData() const { return wx_static_cast(long, m_item.m_data); } + long GetData() const { return static_cast(m_item.m_data); } long GetMask() const { return m_item.m_mask; } const wxListItem& GetItem() const { return m_item; } diff --git a/include/wx/motif/private.h b/include/wx/motif/private.h index 871497d..89b3e70 100644 --- a/include/wx/motif/private.h +++ b/include/wx/motif/private.h @@ -44,7 +44,7 @@ class WXDLLIMPEXP_FWD_CORE wxColour; // (non const) "char *" but many Motif functions take "char *" parameters which // are really "const char *" so use this macro to suppress the warnings when we // know it's ok -#define wxMOTIF_STR(x) wx_const_cast(char *, x) +#define wxMOTIF_STR(x) const_cast(x) // ---------------------------------------------------------------------------- // Miscellaneous functions diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index e8e27ab..b93ee6a 100644 --- a/include/wx/msw/bitmap.h +++ b/include/wx/msw/bitmap.h @@ -58,7 +58,7 @@ public: #ifdef wxNEEDS_CHARPP wxBitmap(char** data) { - *this = wxBitmap(wx_const_cast(const char* const*, data)); + *this = wxBitmap(const_cast(data)); } #endif diff --git a/include/wx/msw/helpchm.h b/include/wx/msw/helpchm.h index 341a07f..a1fbe91 100644 --- a/include/wx/msw/helpchm.h +++ b/include/wx/msw/helpchm.h @@ -56,7 +56,7 @@ protected: static bool CallHtmlHelp(wxWindow *win, const wxChar *str, unsigned cmd, const void *param = NULL) { - return CallHtmlHelp(win, str, cmd, wx_reinterpret_cast(WXWPARAM, param)); + return CallHtmlHelp(win, str, cmd, reinterpret_cast(param)); } // even simpler wrappers using GetParentWindow() and GetValidFilename() as @@ -69,7 +69,7 @@ protected: bool CallHtmlHelp(unsigned cmd, const void *param = NULL) { - return CallHtmlHelp(cmd, wx_reinterpret_cast(WXWPARAM, param)); + return CallHtmlHelp(cmd, reinterpret_cast(param)); } // wrapper around CallHtmlHelp(HH_DISPLAY_TEXT_POPUP): only one of text and diff --git a/include/wx/msw/icon.h b/include/wx/msw/icon.h index 36ec847..21f8abd 100644 --- a/include/wx/msw/icon.h +++ b/include/wx/msw/icon.h @@ -50,7 +50,7 @@ public: // from XPM data wxIcon(const char* const* data) { CreateIconFromXpm(data); } #ifdef wxNEEDS_CHARPP - wxIcon(char **data) { CreateIconFromXpm(wx_const_cast(const char* const*, data)); } + wxIcon(char **data) { CreateIconFromXpm(const_cast(data)); } #endif // from resource/file wxIcon(const wxString& name, diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index ce73889..146d2d3 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -930,7 +930,7 @@ extern WXDLLIMPEXP_CORE wxWindow* wxFindWinFromHandle(HWND hwnd); // without STRICT WXHWND is the same as HWND anyhow inline wxWindow* wxFindWinFromHandle(WXHWND hWnd) { - return wxFindWinFromHandle(wx_static_cast(HWND, hWnd)); + return wxFindWinFromHandle(static_cast(hWnd)); } // find the window for HWND which is part of some wxWindow, i.e. unlike diff --git a/include/wx/msw/stackwalk.h b/include/wx/msw/stackwalk.h index ad981d7..a867d8f 100644 --- a/include/wx/msw/stackwalk.h +++ b/include/wx/msw/stackwalk.h @@ -29,7 +29,7 @@ class WXDLLIMPEXP_BASE wxStackFrame : public wxStackFrameBase { private: wxStackFrame *ConstCast() const - { return wx_const_cast(wxStackFrame *, this); } + { return const_cast(this); } size_t DoGetParamCount() const { return m_paramTypes.GetCount(); } @@ -65,7 +65,7 @@ protected: // helper for debug API: it wants to have addresses as DWORDs size_t GetSymAddr() const { - return wx_reinterpret_cast(size_t, m_address); + return reinterpret_cast(m_address); } private: diff --git a/include/wx/msw/subwin.h b/include/wx/msw/subwin.h index 79d4866..27f5f71 100644 --- a/include/wx/msw/subwin.h +++ b/include/wx/msw/subwin.h @@ -61,7 +61,7 @@ public: HWND operator[](size_t n) const { - return wx_const_cast(wxSubwindows *, this)->Get(n); + return const_cast(this)->Get(n); } // initialize the given window: id will be stored in wxWindowIDRef ensuring diff --git a/include/wx/object.h b/include/wx/object.h index da5f418..0f2f72b 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -319,8 +319,8 @@ name##PluginSentinel m_pluginsentinel; // be replaced by it as long as there are any compilers not supporting it #define wxDynamicCast(obj, className) \ ((className *) wxCheckDynamicCast( \ - wx_const_cast(wxObject *, wx_static_cast(const wxObject *, \ - wx_const_cast(className *, wx_static_cast(const className *, obj)))), \ + const_cast(static_cast(\ + const_cast(static_cast(obj)))), \ &className::ms_classInfo)) // The 'this' pointer is always true, so use this version @@ -339,7 +339,7 @@ inline void* wxCheckCast(void *ptr) #else // !__WXDEBUG__ #define wxStaticCast(obj, className) \ - wx_const_cast(className *, wx_static_cast(const className *, obj)) + const_cast(static_cast(obj)) #endif // __WXDEBUG__ @@ -626,8 +626,8 @@ public: #ifdef _MSC_VER return (wxClassInfo*) m_classInfo; #else - wxDynamicClassInfo *nonconst = wx_const_cast(wxDynamicClassInfo *, m_classInfo); - return wx_static_cast(wxClassInfo *, nonconst); + wxDynamicClassInfo *nonconst = const_cast(m_classInfo); + return static_cast(nonconst); #endif } diff --git a/include/wx/os2/bitmap.h b/include/wx/os2/bitmap.h index fcba00d..9915a6a 100644 --- a/include/wx/os2/bitmap.h +++ b/include/wx/os2/bitmap.h @@ -91,7 +91,7 @@ public: // needed for old GCC wxBitmap(char** data) { - *this = wxBitmap(wx_const_cast(const char* const*, data)); + *this = wxBitmap(const_cast(data)); } #endif diff --git a/include/wx/os2/icon.h b/include/wx/os2/icon.h index a67359a..d289bc0 100644 --- a/include/wx/os2/icon.h +++ b/include/wx/os2/icon.h @@ -46,7 +46,7 @@ public: ); wxIcon(const char* const* ppData) { CreateIconFromXpm(ppData); } #ifdef wxNEEDS_CHARPP - wxIcon(char** ppData) { CreateIconFromXpm(wx_const_cast(const char* const*, ppData)); } + wxIcon(char** ppData) { CreateIconFromXpm(const_cast(ppData)); } #endif wxIcon( const wxString& rName ,wxBitmapType lFlags = wxICON_DEFAULT_TYPE diff --git a/include/wx/pen.h b/include/wx/pen.h index ec705d9..479a966 100644 --- a/include/wx/pen.h +++ b/include/wx/pen.h @@ -137,7 +137,7 @@ extern WXDLLIMPEXP_DATA_CORE(wxPenList*) wxThePenList; inline bool operator==(wxPenStyle s, wxDeprecatedGUIConstants t) { - return wx_static_cast(int, s) == wx_static_cast(int, t); + return static_cast(s) == static_cast(t); } inline bool operator!=(wxPenStyle s, wxDeprecatedGUIConstants t) diff --git a/include/wx/stackwalk.h b/include/wx/stackwalk.h index 2a652b0..47805cd 100644 --- a/include/wx/stackwalk.h +++ b/include/wx/stackwalk.h @@ -27,7 +27,7 @@ class WXDLLIMPEXP_BASE wxStackFrameBase private: // put this inline function here so that it is defined before use wxStackFrameBase *ConstCast() const - { return wx_const_cast(wxStackFrameBase *, this); } + { return const_cast(this); } public: wxStackFrameBase(size_t level, void *address = NULL) diff --git a/include/wx/string.h b/include/wx/string.h index 10729ed..d1c3b6d 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -987,7 +987,7 @@ public: iterator(wxString *str, underlying_iterator ptr) : m_cur(ptr), m_node(str, &m_cur) {} - wxString* str() const { return wx_const_cast(wxString*, m_node.m_str); } + wxString* str() const { return const_cast(m_node.m_str); } wxStringIteratorNode m_node; @@ -3955,7 +3955,7 @@ inline wxCStrData::wxCStrData(const wxCStrData& data) inline wxCStrData::~wxCStrData() { if ( m_owned ) - delete wx_const_cast(wxString*, m_str); // cast to silence warnings + delete const_cast(m_str); // cast to silence warnings } // simple cases for AsChar() and AsWChar(), the complicated ones are @@ -4078,7 +4078,7 @@ void wxStringIteratorNode::DoSet(const wxString *str, if ( str ) { m_next = str->m_iterators.ptr; - wx_const_cast(wxString*, m_str)->m_iterators.ptr = this; + const_cast(m_str)->m_iterators.ptr = this; if ( m_next ) m_next->m_prev = this; } @@ -4095,7 +4095,7 @@ void wxStringIteratorNode::clear() if ( m_prev ) m_prev->m_next = m_next; else if ( m_str ) // first in the list - wx_const_cast(wxString*, m_str)->m_iterators.ptr = m_next; + const_cast(m_str)->m_iterators.ptr = m_next; m_next = m_prev = NULL; m_citer = NULL; diff --git a/include/wx/strvararg.h b/include/wx/strvararg.h index b7a1a19..7364cd6 100644 --- a/include/wx/strvararg.h +++ b/include/wx/strvararg.h @@ -156,7 +156,7 @@ public: #if !wxUSE_UNICODE_WCHAR operator const char*() const - { return wx_const_cast(wxFormatString*, this)->AsChar(); } + { return const_cast(this)->AsChar(); } private: // InputAsChar() returns the value converted passed to ctor, only converted // to char, while AsChar() takes the the string returned by InputAsChar() @@ -170,7 +170,7 @@ private: #if wxUSE_UNICODE && !wxUSE_UTF8_LOCALE_ONLY public: operator const wchar_t*() const - { return wx_const_cast(wxFormatString*, this)->AsWChar(); } + { return const_cast(this)->AsWChar(); } private: const wchar_t* InputAsWChar(); const wchar_t* AsWChar(); diff --git a/include/wx/univ/statusbr.h b/include/wx/univ/statusbr.h index 8852856..992b0ec 100644 --- a/include/wx/univ/statusbr.h +++ b/include/wx/univ/statusbr.h @@ -60,7 +60,7 @@ public: // wxInputConsumer pure virtual virtual wxWindow *GetInputWindow() const - { return wx_const_cast(wxStatusBar*, this); } + { return const_cast(this); } protected: // recalculate the field widths diff --git a/include/wx/univ/toplevel.h b/include/wx/univ/toplevel.h index a13d5c9..d72d9ac 100644 --- a/include/wx/univ/toplevel.h +++ b/include/wx/univ/toplevel.h @@ -153,7 +153,7 @@ public: virtual wxSize GetMinSize() const; - virtual wxWindow *GetInputWindow() const { return wx_const_cast(wxTopLevelWindow*, this); } + virtual wxWindow *GetInputWindow() const { return const_cast(this); } protected: virtual void DoGetClientSize(int *width, int *height) const; diff --git a/include/wx/unix/gsockunx.h b/include/wx/unix/gsockunx.h index 1c59a3f..dfbf94e 100644 --- a/include/wx/unix/gsockunx.h +++ b/include/wx/unix/gsockunx.h @@ -114,7 +114,7 @@ public: virtual bool Init_Socket(GSocket *socket) { socket->m_gui_dependent = malloc(sizeof(int)*2); - int * const fds = wx_static_cast(int *, socket->m_gui_dependent); + int * const fds = static_cast(socket->m_gui_dependent); fds[0] = -1; fds[1] = -1; @@ -174,7 +174,7 @@ protected: // access the FDs we store int& FD(GSocket *socket, SocketDir d) { - return wx_static_cast(int *, socket->m_gui_dependent)[d]; + return static_cast(socket->m_gui_dependent)[d]; } }; diff --git a/include/wx/x11/bitmap.h b/include/wx/x11/bitmap.h index b023702..fed6dd5 100644 --- a/include/wx/x11/bitmap.h +++ b/include/wx/x11/bitmap.h @@ -73,7 +73,7 @@ public: // needed for old GCC wxBitmap(char** data) { - *this = wxBitmap(wx_const_cast(const char* const*, data)); + *this = wxBitmap(const_cast(data)); } #endif wxBitmap( const wxString &filename, wxBitmapType type = wxBITMAP_DEFAULT_TYPE ); diff --git a/include/wx/xlocale.h b/include/wx/xlocale.h index 39b49e7..c0d5d4f 100644 --- a/include/wx/xlocale.h +++ b/include/wx/xlocale.h @@ -198,31 +198,31 @@ private: #define wxCRT_Toupper_lA wxXLOCALE_IDENT(toupper_l) inline int wxIsalnum_l(char c, const wxXLocale& loc) - { return wxCRT_Isalnum_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Isalnum_lA(static_cast(c), loc.Get()); } inline int wxIsalpha_l(char c, const wxXLocale& loc) - { return wxCRT_Isalpha_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Isalpha_lA(static_cast(c), loc.Get()); } inline int wxIscntrl_l(char c, const wxXLocale& loc) - { return wxCRT_Iscntrl_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Iscntrl_lA(static_cast(c), loc.Get()); } inline int wxIsdigit_l(char c, const wxXLocale& loc) - { return wxCRT_Isdigit_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Isdigit_lA(static_cast(c), loc.Get()); } inline int wxIsgraph_l(char c, const wxXLocale& loc) - { return wxCRT_Isgraph_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Isgraph_lA(static_cast(c), loc.Get()); } inline int wxIslower_l(char c, const wxXLocale& loc) - { return wxCRT_Islower_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Islower_lA(static_cast(c), loc.Get()); } inline int wxIsprint_l(char c, const wxXLocale& loc) - { return wxCRT_Isprint_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Isprint_lA(static_cast(c), loc.Get()); } inline int wxIspunct_l(char c, const wxXLocale& loc) - { return wxCRT_Ispunct_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Ispunct_lA(static_cast(c), loc.Get()); } inline int wxIsspace_l(char c, const wxXLocale& loc) - { return wxCRT_Isspace_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Isspace_lA(static_cast(c), loc.Get()); } inline int wxIsupper_l(char c, const wxXLocale& loc) - { return wxCRT_Isupper_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Isupper_lA(static_cast(c), loc.Get()); } inline int wxIsxdigit_l(char c, const wxXLocale& loc) - { return wxCRT_Isxdigit_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Isxdigit_lA(static_cast(c), loc.Get()); } inline int wxTolower_l(char c, const wxXLocale& loc) - { return wxCRT_Tolower_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Tolower_lA(static_cast(c), loc.Get()); } inline int wxToupper_l(char c, const wxXLocale& loc) - { return wxCRT_Toupper_lA(wx_static_cast(unsigned char, c), loc.Get()); } + { return wxCRT_Toupper_lA(static_cast(c), loc.Get()); } #if wxUSE_UNICODE #define wxCRT_Isalnum_lW wxXLOCALE_IDENT(iswalnum_l) diff --git a/include/wx/xpmdecod.h b/include/wx/xpmdecod.h index 82b80fa..00e33a7 100644 --- a/include/wx/xpmdecod.h +++ b/include/wx/xpmdecod.h @@ -38,7 +38,7 @@ public: wxImage ReadData(const char* const* xpm_data); #ifdef __BORLANDC__ // needed for Borland 5.5 - wxImage ReadData(char** xpm_data) { return ReadData(wx_const_cast(const char* const*, xpm_data)); } + wxImage ReadData(char** xpm_data) { return ReadData(const_cast(xpm_data)); } #endif }; diff --git a/src/cocoa/bitmap.mm b/src/cocoa/bitmap.mm index 58f1c72..daffce3 100644 --- a/src/cocoa/bitmap.mm +++ b/src/cocoa/bitmap.mm @@ -439,8 +439,8 @@ wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const NSRect imageRect = {{0,0}, [nsimage size]}; imageRect.origin.x = imageRect.size.width * rect.x / GetWidth(); imageRect.origin.y = imageRect.size.height * rect.y / GetHeight(); - imageRect.size.width *= wx_static_cast(CGFloat, rect.width) / GetWidth(); - imageRect.size.height *= wx_static_cast(CGFloat, rect.height) / GetHeight(); + imageRect.size.width *= static_cast(rect.width) / GetWidth(); + imageRect.size.height *= static_cast(rect.height) / GetHeight(); NSBitmapImageRep *newBitmapRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:imageRect]; [nsimage unlockFocus]; diff --git a/src/cocoa/font.mm b/src/cocoa/font.mm index bac3a57..c816fb3 100644 --- a/src/cocoa/font.mm +++ b/src/cocoa/font.mm @@ -338,7 +338,7 @@ wxGDIRefData *wxFont::CreateGDIRefData() const wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data)); + return new wxFontRefData(*static_cast(data)); } void wxFont::SetEncoding(wxFontEncoding) diff --git a/src/cocoa/icon.mm b/src/cocoa/icon.mm index 44983b7..2f56004 100644 --- a/src/cocoa/icon.mm +++ b/src/cocoa/icon.mm @@ -107,7 +107,7 @@ wxGDIRefData *wxIcon::CreateGDIRefData() const wxGDIRefData *wxIcon::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxIconRefData(*wx_static_cast(const wxIconRefData *, data)); + return new wxIconRefData(*static_cast(data)); } bool wxIcon::CreateFromXpm(const char* const* xpm) diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 076cabb..7b2636e 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -131,7 +131,7 @@ wxAppConsoleBase::wxAppConsoleBase() m_traits = NULL; m_mainLoop = NULL; - ms_appInstance = wx_static_cast(wxAppConsole *, this); + ms_appInstance = static_cast(this); #ifdef __WXDEBUG__ SetTraceMasks(); diff --git a/src/common/base64.cpp b/src/common/base64.cpp index 2832bff..54b0cc7 100644 --- a/src/common/base64.cpp +++ b/src/common/base64.cpp @@ -18,7 +18,7 @@ wxBase64Encode(char *dst, size_t dstLen, const void *src_, size_t srcLen) { wxCHECK_MSG( src_, wxCONV_FAILED, _T("NULL input buffer") ); - const unsigned char *src = wx_static_cast(const unsigned char *, src_); + const unsigned char *src = static_cast(src_); static const char b64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -71,7 +71,7 @@ wxBase64Decode(void *dst_, size_t dstLen, { wxCHECK_MSG( src, wxCONV_FAILED, _T("NULL input buffer") ); - unsigned char *dst = wx_static_cast(unsigned char *, dst_); + unsigned char *dst = static_cast(dst_); size_t decLen = 0; @@ -118,7 +118,7 @@ wxBase64Decode(void *dst_, size_t dstLen, const char *p; for ( p = src; srcLen; p++, srcLen-- ) { - const unsigned char c = decode[wx_static_cast(unsigned char, *p)]; + const unsigned char c = decode[static_cast(*p)]; switch ( c ) { case WSP: diff --git a/src/common/colourcmn.cpp b/src/common/colourcmn.cpp index 99243dd..a03efa7 100644 --- a/src/common/colourcmn.cpp +++ b/src/common/colourcmn.cpp @@ -110,7 +110,7 @@ wxString wxColourBase::GetAsString(long flags) const if ( (flags & wxC2S_NAME) && isOpaque ) { colName = wxTheColourDatabase->FindName( - wx_static_cast(const wxColour &, *this)).MakeLower(); + static_cast(*this)).MakeLower(); } if ( colName.empty() ) diff --git a/src/common/containr.cpp b/src/common/containr.cpp index 43de025..06ada8e 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -533,7 +533,7 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event ) !m_winLastFocused->HasFlag(wxRB_SINGLE) ) { wxRadioButton * const - lastBtn = wx_static_cast(wxRadioButton *, m_winLastFocused); + lastBtn = static_cast(m_winLastFocused); // cursor keys don't navigate out of a radio button group so // find the correct radio button to focus diff --git a/src/common/convauto.cpp b/src/common/convauto.cpp index d23fad6..9d58183 100644 --- a/src/common/convauto.cpp +++ b/src/common/convauto.cpp @@ -194,7 +194,7 @@ wxConvAuto::ToWChar(wchar_t *dst, size_t dstLen, // during this initial call but also during the first call with non-NULL // dst as typically we're first called with NULL dst to calculate the // needed buffer size - wxConvAuto *self = wx_const_cast(wxConvAuto *, this); + wxConvAuto *self = const_cast(this); if ( !m_conv ) { self->InitFromInput(&src, &srcLen); @@ -238,7 +238,7 @@ wxConvAuto::FromWChar(char *dst, size_t dstLen, if ( !m_conv ) { // default to UTF-8 for the multibyte output - wx_const_cast(wxConvAuto *, this)->InitWithUTF8(); + const_cast(this)->InitWithUTF8(); } return m_conv->FromWChar(dst, dstLen, src, srcLen); diff --git a/src/common/ctrlsub.cpp b/src/common/ctrlsub.cpp index 05440cd..e9d0dfa 100644 --- a/src/common/ctrlsub.cpp +++ b/src/common/ctrlsub.cpp @@ -168,7 +168,7 @@ void wxItemContainer::SetClientObject(unsigned int n, wxClientData *data) if ( HasClientObjectData() ) { wxClientData * clientDataOld - = wx_static_cast(wxClientData *, DoGetItemClientData(n)); + = static_cast(DoGetItemClientData(n)); if ( clientDataOld ) delete clientDataOld; } @@ -188,7 +188,7 @@ wxClientData *wxItemContainer::GetClientObject(unsigned int n) const wxCHECK_MSG( HasClientObjectData(), NULL, wxT("this window doesn't have object client data") ); - return wx_static_cast(wxClientData *, DoGetItemClientData(n)); + return static_cast(DoGetItemClientData(n)); } void wxItemContainer::SetClientData(unsigned int n, void *data) @@ -224,7 +224,7 @@ void wxItemContainer::AssignNewItemClientData(unsigned int pos, SetClientObject ( pos, - (wx_reinterpret_cast(wxClientData **, clientData))[n] + (reinterpret_cast(clientData))[n] ); break; diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index cbc0840..1a7dcf4 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -671,7 +671,7 @@ wxDataViewRendererBase::~wxDataViewRendererBase() const wxDataViewCtrl* wxDataViewRendererBase::GetView() const { - return wx_const_cast(wxDataViewRendererBase*, this)->GetOwner()->GetOwner(); + return const_cast(this)->GetOwner()->GetOwner(); } class wxKillRef: public wxWindowRef diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 0a58ed3..8346806 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -4602,7 +4602,7 @@ WXDLLIMPEXP_BASE void wxPrevWDay(wxDateTime::WeekDay& wd) wxDateTime& wxDateTime::SetFromMSWSysTime(const SYSTEMTIME& st) { return Set(st.wDay, - wx_static_cast(wxDateTime::Month, wxDateTime::Jan + st.wMonth - 1), + static_cast(wxDateTime::Jan + st.wMonth - 1), st.wYear, 0, 0, 0); } diff --git a/src/common/dobjcmn.cpp b/src/common/dobjcmn.cpp index 02786e9..d932770 100644 --- a/src/common/dobjcmn.cpp +++ b/src/common/dobjcmn.cpp @@ -320,7 +320,7 @@ bool wxTextDataObject::GetDataHere(const wxDataFormat& format, void *buf) const bool wxTextDataObject::SetData(const wxDataFormat& format, size_t len, const void *buf_) { - const char * const buf = wx_static_cast(const char *, buf_); + const char * const buf = static_cast(buf_); if ( buf == NULL ) return false; diff --git a/src/common/event.cpp b/src/common/event.cpp index fbb9cc8..630a4f2 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -1172,7 +1172,7 @@ void wxEvtHandler::ProcessPendingEvents() "should have pending events if called" ); wxList::compatibility_iterator node = m_pendingEvents->GetFirst(); - wxEventPtr event(wx_static_cast(wxEvent *, node->GetData())); + wxEventPtr event(static_cast(node->GetData())); // it's important we remove event from list before processing it, else a // nested event loop, for example from a modal dialog, might process the diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index ad4e20a..27e51b8 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -827,7 +827,7 @@ bool wxFileConfig::HasGroup(const wxString& strName) const const wxString pathOld = GetPath(); - wxFileConfig *self = wx_const_cast(wxFileConfig *, this); + wxFileConfig *self = const_cast(this); const bool rc = self->DoSetPath(strName, false /* don't create missing components */); @@ -850,7 +850,7 @@ bool wxFileConfig::HasEntry(const wxString& entry) const // change to the path of the entry if necessary and remember the old path // to restore it later wxString pathOld; - wxFileConfig * const self = wx_const_cast(wxFileConfig *, this); + wxFileConfig * const self = const_cast(this); if ( !path.empty() ) { pathOld = GetPath(); @@ -1678,9 +1678,9 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup) wxLogTrace( FILECONF_TRACE_MASK, _T(" (m_pLine) = prev: %p, this %p, next %p"), - m_pLine ? wx_static_cast(void*, m_pLine->Prev()) : 0, - wx_static_cast(void*, m_pLine), - m_pLine ? wx_static_cast(void*, m_pLine->Next()) : 0 ); + m_pLine ? static_cast(m_pLine->Prev()) : 0, + static_cast(m_pLine), + m_pLine ? static_cast(m_pLine->Next()) : 0 ); wxLogTrace( FILECONF_TRACE_MASK, _T(" text: '%s'"), m_pLine ? (const wxChar*)m_pLine->Text().c_str() diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 4129b48..e23c9a2 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -528,7 +528,7 @@ void wxStockGDI::DeleteAll() const wxBrush* wxStockGDI::GetBrush(Item item) { - wxBrush* brush = wx_static_cast(wxBrush*, ms_stockObject[item]); + wxBrush* brush = static_cast(ms_stockObject[item]); if (brush == NULL) { switch (item) @@ -573,7 +573,7 @@ const wxBrush* wxStockGDI::GetBrush(Item item) const wxColour* wxStockGDI::GetColour(Item item) { - wxColour* colour = wx_static_cast(wxColour*, ms_stockObject[item]); + wxColour* colour = static_cast(ms_stockObject[item]); if (colour == NULL) { switch (item) @@ -609,7 +609,7 @@ const wxColour* wxStockGDI::GetColour(Item item) const wxCursor* wxStockGDI::GetCursor(Item item) { - wxCursor* cursor = wx_static_cast(wxCursor*, ms_stockObject[item]); + wxCursor* cursor = static_cast(ms_stockObject[item]); if (cursor == NULL) { switch (item) @@ -633,7 +633,7 @@ const wxCursor* wxStockGDI::GetCursor(Item item) const wxFont* wxStockGDI::GetFont(Item item) { - wxFont* font = wx_static_cast(wxFont*, ms_stockObject[item]); + wxFont* font = static_cast(ms_stockObject[item]); if (font == NULL) { switch (item) @@ -660,7 +660,7 @@ const wxFont* wxStockGDI::GetFont(Item item) const wxPen* wxStockGDI::GetPen(Item item) { - wxPen* pen = wx_static_cast(wxPen*, ms_stockObject[item]); + wxPen* pen = static_cast(ms_stockObject[item]); if (pen == NULL) { switch (item) @@ -731,7 +731,7 @@ wxGDIObjListBase::~wxGDIObjListBase() { for (wxList::compatibility_iterator node = list.GetFirst(); node; node = node->GetNext()) { - delete wx_static_cast(wxObject*, node->GetData()); + delete static_cast(node->GetData()); } } diff --git a/src/common/glcmn.cpp b/src/common/glcmn.cpp index 6b68538..b3e1f57 100644 --- a/src/common/glcmn.cpp +++ b/src/common/glcmn.cpp @@ -59,7 +59,7 @@ bool wxGLCanvasBase::SetCurrent(const wxGLContext& context) const // that SetCurrent() can only be called for a shown window, so check for it wxASSERT_MSG( IsShownOnScreen(), _T("can't make hidden GL canvas current") ); - return context.SetCurrent(*wx_static_cast(const wxGLCanvas *, this)); + return context.SetCurrent(*static_cast(this)); } bool wxGLCanvasBase::SetColour(const wxString& colour) diff --git a/src/common/iconbndl.cpp b/src/common/iconbndl.cpp index 8b30e0a..ff0f827 100644 --- a/src/common/iconbndl.cpp +++ b/src/common/iconbndl.cpp @@ -73,7 +73,7 @@ wxGDIRefData *wxIconBundle::CreateGDIRefData() const wxGDIRefData *wxIconBundle::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxIconBundleRefData(*wx_static_cast(const wxIconBundleRefData *, data)); + return new wxIconBundleRefData(*static_cast(data)); } void wxIconBundle::DeleteIcons() diff --git a/src/common/image.cpp b/src/common/image.cpp index be9b0d5..6857a0d 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -123,7 +123,7 @@ wxImage wxNullImage; //----------------------------------------------------------------------------- -#define M_IMGDATA wx_static_cast(wxImageRefData*, m_refData) +#define M_IMGDATA static_cast(m_refData) IMPLEMENT_DYNAMIC_CLASS(wxImage, wxObject) @@ -252,7 +252,7 @@ wxObjectRefData* wxImage::CreateRefData() const wxObjectRefData* wxImage::CloneRefData(const wxObjectRefData* that) const { - const wxImageRefData* refData = wx_static_cast(const wxImageRefData*, that); + const wxImageRefData* refData = static_cast(that); wxCHECK_MSG(refData->m_ok, NULL, wxT("invalid image") ); wxImageRefData* refData_new = new wxImageRefData; @@ -1390,7 +1390,7 @@ wxImage wxImage::ConvertToGreyscale( double lr, double lg, double lb ) const { // calculate the luma double luma = (src[0] * lr + src[1] * lg + src[2] * lb) + 0.5; - dest[0] = dest[1] = dest[2] = wx_static_cast(unsigned char, luma); + dest[0] = dest[1] = dest[2] = static_cast(luma); } } @@ -2288,7 +2288,7 @@ bool wxImage::LoadFile( wxInputStream& stream, const wxString& mimetype, int ind bool wxImage::DoSave(wxImageHandler& handler, wxOutputStream& stream) const { - wxImage * const self = wx_const_cast(wxImage *, this); + wxImage * const self = const_cast(this); if ( !handler.SaveFile(self, stream) ) return false; diff --git a/src/common/intl.cpp b/src/common/intl.cpp index f91de78..205eb96 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -933,7 +933,7 @@ private: // facilitate doing pointer arithmetic with it char *StringData() const { - return wx_static_cast(char *, m_data.GetData()); + return static_cast(m_data.GetData()); } const char *StringAtOfs(wxMsgTableEntry *pTable, size_t32 n) const diff --git a/src/common/ipcbase.cpp b/src/common/ipcbase.cpp index d96b937..64c6c1f 100644 --- a/src/common/ipcbase.cpp +++ b/src/common/ipcbase.cpp @@ -80,7 +80,7 @@ wxString wxConnectionBase::GetTextFromData(const void* data, if ( size ) size--; - s = wxString(wx_static_cast(const char *, data), size); + s = wxString(static_cast(data), size); break; #if wxUSE_UNICODE @@ -94,14 +94,14 @@ wxString wxConnectionBase::GetTextFromData(const void* data, size--; } - s = wxString(wx_static_cast(const wchar_t *, data), size); + s = wxString(static_cast(data), size); break; case wxIPC_UTF8TEXT: if ( size ) size--; - s = wxString::FromUTF8(wx_static_cast(const char *, data), size); + s = wxString::FromUTF8(static_cast(data), size); break; #endif // wxUSE_UNICODE diff --git a/src/common/memory.cpp b/src/common/memory.cpp index f4491a6..a1728fc 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -594,7 +594,7 @@ bool wxDebugContext::Dump(void) { appNameStr = wxTheApp->GetAppName(); appName = appNameStr.c_str(); - OutputDumpLine(wxT("----- Memory dump of %s at %s -----"), appName, wx_static_cast(const wxChar *, wxNow().c_str())); + OutputDumpLine(wxT("----- Memory dump of %s at %s -----"), appName, static_cast(wxNow().c_str())); } else { @@ -650,7 +650,7 @@ bool wxDebugContext::PrintStatistics(bool detailed) { appNameStr = wxTheApp->GetAppName(); appName = appNameStr.c_str(); - OutputDumpLine(wxT("----- Memory statistics of %s at %s -----"), appName, wx_static_cast(const wxChar *, wxNow().c_str())); + OutputDumpLine(wxT("----- Memory statistics of %s at %s -----"), appName, static_cast(wxNow().c_str())); } else { diff --git a/src/common/radiocmn.cpp b/src/common/radiocmn.cpp index 8d954df..c8234e2 100644 --- a/src/common/radiocmn.cpp +++ b/src/common/radiocmn.cpp @@ -277,7 +277,7 @@ wxString wxRadioBoxBase::DoGetHelpTextAtPoint(const wxWindow *derived, if ( item != wxNOT_FOUND ) { - wxString text = GetItemHelpText(wx_static_cast(unsigned int, item)); + wxString text = GetItemHelpText(static_cast(item)); if( !text.empty() ) return text; } diff --git a/src/common/regex.cpp b/src/common/regex.cpp index 7a7029c..40dff4d 100644 --- a/src/common/regex.cpp +++ b/src/common/regex.cpp @@ -378,7 +378,7 @@ static int ReSearch(const regex_t *preg, re_registers *matches, int eflags) { - regex_t *pattern = wx_const_cast(regex_t*, preg); + regex_t *pattern = const_cast(preg); pattern->not_bol = (eflags & REG_NOTBOL) != 0; pattern->not_eol = (eflags & REG_NOTEOL) != 0; diff --git a/src/common/rgncmn.cpp b/src/common/rgncmn.cpp index e19bf54..f16024c 100644 --- a/src/common/rgncmn.cpp +++ b/src/common/rgncmn.cpp @@ -65,7 +65,7 @@ wxBitmap wxRegionBase::ConvertToBitmap() const dc.SelectObject(bmp); dc.SetBackground(*wxBLACK_BRUSH); dc.Clear(); - dc.SetDeviceClippingRegion(*wx_static_cast(const wxRegion *, this)); + dc.SetDeviceClippingRegion(*static_cast(this)); dc.SetBackground(*wxWHITE_BRUSH); dc.Clear(); dc.SelectObject(wxNullBitmap); diff --git a/src/common/sstream.cpp b/src/common/sstream.cpp index aabe01e..740ebbf 100644 --- a/src/common/sstream.cpp +++ b/src/common/sstream.cpp @@ -86,7 +86,7 @@ wxFileOffset wxStringInputStream::OnSysSeek(wxFileOffset ofs, wxSeekMode mode) return wxInvalidOffset; } - if ( ofs < 0 || ofs > wx_static_cast(wxFileOffset, m_len) ) + if ( ofs < 0 || ofs > static_cast(m_len) ) return wxInvalidOffset; // FIXME: this can't be right @@ -97,7 +97,7 @@ wxFileOffset wxStringInputStream::OnSysSeek(wxFileOffset ofs, wxSeekMode mode) wxFileOffset wxStringInputStream::OnSysTell() const { - return wx_static_cast(wxFileOffset, m_pos); + return static_cast(m_pos); } // ---------------------------------------------------------------------------- @@ -135,7 +135,7 @@ size_t wxStringInputStream::OnSysRead(void *buffer, size_t size) wxFileOffset wxStringOutputStream::OnSysTell() const { - return wx_static_cast(wxFileOffset, m_pos); + return static_cast(m_pos); } // ---------------------------------------------------------------------------- @@ -144,7 +144,7 @@ wxFileOffset wxStringOutputStream::OnSysTell() const size_t wxStringOutputStream::OnSysWrite(const void *buffer, size_t size) { - const char *p = wx_static_cast(const char *, buffer); + const char *p = static_cast(buffer); #if wxUSE_UNICODE_WCHAR // the part of the string we have here may be incomplete, i.e. it can stop diff --git a/src/common/stattextcmn.cpp b/src/common/stattextcmn.cpp index f7b6a78..b2ac7a0 100644 --- a/src/common/stattextcmn.cpp +++ b/src/common/stattextcmn.cpp @@ -323,7 +323,7 @@ wxString wxStaticTextBase::Ellipsize(const wxString& label) const return label; } - wxClientDC dc(wx_const_cast(wxStaticTextBase*, this)); + wxClientDC dc(const_cast(this)); dc.SetFont(GetFont()); wxArrayInt charOffsets; diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 0cdae01..aa084f5 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -142,7 +142,7 @@ static wxUint32 wxDecodeSurrogate(const wxDecodeSurrogate_t **pSrc) { wxUint32 out; const size_t - n = decode_utf16(wx_reinterpret_cast(const wxUint16 *, *pSrc), out); + n = decode_utf16(reinterpret_cast(*pSrc), out); if ( n == wxCONV_FAILED ) *pSrc = NULL; else @@ -584,7 +584,7 @@ size_t wxMBConvUTF7::ToWChar(wchar_t *dst, size_t dstLen, } else // when working with partial strings we do use the shift state { - statePtr = wx_const_cast(DecoderState *, &m_stateDecoder); + statePtr = const_cast(&m_stateDecoder); // also save the old state to be able to rollback to it on error stateOrig = m_stateDecoder; @@ -771,7 +771,7 @@ size_t wxMBConvUTF7::FromWChar(char *dst, size_t dstLen, else // do use the mode we left the output in previously { stateOrig = m_stateEncoder; - statePtr = wx_const_cast(EncoderState *, &m_stateEncoder); + statePtr = const_cast(&m_stateEncoder); } EncoderState& state = *statePtr; @@ -1407,7 +1407,7 @@ size_t wxMBConvUTF16Base::GetLength(const char *src, size_t srcLen) if ( srcLen == wxNO_LEN ) { // count the number of bytes in input, including the trailing NULs - const wxUint16 *inBuff = wx_reinterpret_cast(const wxUint16 *, src); + const wxUint16 *inBuff = reinterpret_cast(src); for ( srcLen = 1; *inBuff++; srcLen++ ) ; @@ -1491,7 +1491,7 @@ wxMBConvUTF16swap::ToWChar(wchar_t *dst, size_t dstLen, if ( dstLen < srcLen ) return wxCONV_FAILED; - const wxUint16 *inBuff = wx_reinterpret_cast(const wxUint16 *, src); + const wxUint16 *inBuff = reinterpret_cast(src); for ( size_t n = 0; n < srcLen; n++, inBuff++ ) { *dst++ = wxUINT16_SWAP_ALWAYS(*inBuff); @@ -1515,7 +1515,7 @@ wxMBConvUTF16swap::FromWChar(char *dst, size_t dstLen, if ( dstLen < srcLen ) return wxCONV_FAILED; - wxUint16 *outBuff = wx_reinterpret_cast(wxUint16 *, dst); + wxUint16 *outBuff = reinterpret_cast(dst); for ( size_t n = 0; n < srcLen; n += BYTES_PER_CHAR, src++ ) { *outBuff++ = wxUINT16_SWAP_ALWAYS(*src); @@ -1549,7 +1549,7 @@ wxMBConvUTF16straight::ToWChar(wchar_t *dst, size_t dstLen, } size_t outLen = 0; - const wxUint16 *inBuff = wx_reinterpret_cast(const wxUint16 *, src); + const wxUint16 *inBuff = reinterpret_cast(src); for ( const wxUint16 * const inEnd = inBuff + inLen; inBuff < inEnd; ) { const wxUint32 ch = wxDecodeSurrogate(&inBuff); @@ -1574,7 +1574,7 @@ wxMBConvUTF16straight::FromWChar(char *dst, size_t dstLen, srcLen = wxWcslen(src) + 1; size_t outLen = 0; - wxUint16 *outBuff = wx_reinterpret_cast(wxUint16 *, dst); + wxUint16 *outBuff = reinterpret_cast(dst); for ( size_t n = 0; n < srcLen; n++ ) { wxUint16 cc[2]; @@ -1622,7 +1622,7 @@ wxMBConvUTF16swap::ToWChar(wchar_t *dst, size_t dstLen, } size_t outLen = 0; - const wxUint16 *inBuff = wx_reinterpret_cast(const wxUint16 *, src); + const wxUint16 *inBuff = reinterpret_cast(src); for ( const wxUint16 * const inEnd = inBuff + inLen; inBuff < inEnd; ) { wxUint32 ch; @@ -1657,7 +1657,7 @@ wxMBConvUTF16swap::FromWChar(char *dst, size_t dstLen, srcLen = wxWcslen(src) + 1; size_t outLen = 0; - wxUint16 *outBuff = wx_reinterpret_cast(wxUint16 *, dst); + wxUint16 *outBuff = reinterpret_cast(dst); for ( const wchar_t *srcEnd = src + srcLen; src < srcEnd; src++ ) { wxUint16 cc[2]; @@ -1708,7 +1708,7 @@ size_t wxMBConvUTF32Base::GetLength(const char *src, size_t srcLen) if ( srcLen == wxNO_LEN ) { // count the number of bytes in input, including the trailing NULs - const wxUint32 *inBuff = wx_reinterpret_cast(const wxUint32 *, src); + const wxUint32 *inBuff = reinterpret_cast(src); for ( srcLen = 1; *inBuff++; srcLen++ ) ; @@ -1739,7 +1739,7 @@ wxMBConvUTF32straight::ToWChar(wchar_t *dst, size_t dstLen, if ( srcLen == wxNO_LEN ) return wxCONV_FAILED; - const wxUint32 *inBuff = wx_reinterpret_cast(const wxUint32 *, src); + const wxUint32 *inBuff = reinterpret_cast(src); const size_t inLen = srcLen / BYTES_PER_CHAR; size_t outLen = 0; for ( size_t n = 0; n < inLen; n++ ) @@ -1786,7 +1786,7 @@ wxMBConvUTF32straight::FromWChar(char *dst, size_t dstLen, return srcLen * BYTES_PER_CHAR; } - wxUint32 *outBuff = wx_reinterpret_cast(wxUint32 *, dst); + wxUint32 *outBuff = reinterpret_cast(dst); size_t outLen = 0; for ( const wchar_t * const srcEnd = src + srcLen; src < srcEnd; ) { @@ -1817,7 +1817,7 @@ wxMBConvUTF32swap::ToWChar(wchar_t *dst, size_t dstLen, if ( srcLen == wxNO_LEN ) return wxCONV_FAILED; - const wxUint32 *inBuff = wx_reinterpret_cast(const wxUint32 *, src); + const wxUint32 *inBuff = reinterpret_cast(src); const size_t inLen = srcLen / BYTES_PER_CHAR; size_t outLen = 0; for ( size_t n = 0; n < inLen; n++, inBuff++ ) @@ -1864,7 +1864,7 @@ wxMBConvUTF32swap::FromWChar(char *dst, size_t dstLen, return srcLen*BYTES_PER_CHAR; } - wxUint32 *outBuff = wx_reinterpret_cast(wxUint32 *, dst); + wxUint32 *outBuff = reinterpret_cast(dst); size_t outLen = 0; for ( const wchar_t * const srcEnd = src + srcLen; src < srcEnd; ) { @@ -1949,7 +1949,7 @@ wxMBConvUTF32swap::ToWChar(wchar_t *dst, size_t dstLen, if ( dstLen < srcLen ) return wxCONV_FAILED; - const wxUint32 *inBuff = wx_reinterpret_cast(const wxUint32 *, src); + const wxUint32 *inBuff = reinterpret_cast(src); for ( size_t n = 0; n < srcLen; n++, inBuff++ ) { *dst++ = wxUINT32_SWAP_ALWAYS(*inBuff); @@ -1973,7 +1973,7 @@ wxMBConvUTF32swap::FromWChar(char *dst, size_t dstLen, if ( dstLen < srcLen ) return wxCONV_FAILED; - wxUint32 *outBuff = wx_reinterpret_cast(wxUint32 *, dst); + wxUint32 *outBuff = reinterpret_cast(dst); for ( size_t n = 0; n < srcLen; n += BYTES_PER_CHAR, src++ ) { *outBuff++ = wxUINT32_SWAP_ALWAYS(*src); diff --git a/src/common/strvararg.cpp b/src/common/strvararg.cpp index dc86bf2..b06f3e6 100644 --- a/src/common/strvararg.cpp +++ b/src/common/strvararg.cpp @@ -72,14 +72,14 @@ wxString wxArgNormalizedString::GetString() const return wxEmptyString; #if wxUSE_UTF8_LOCALE_ONLY - return wxString(wx_reinterpret_cast(const char*, m_ptr)); + return wxString(reinterpret_cast(m_ptr)); #else #if wxUSE_UNICODE_UTF8 if ( wxLocaleIsUtf8 ) - return wxString(wx_reinterpret_cast(const char*, m_ptr)); + return wxString(reinterpret_cast(m_ptr)); else #endif - return wxString(wx_reinterpret_cast(const wxChar*, m_ptr)); + return wxString(reinterpret_cast(m_ptr)); #endif // !wxUSE_UTF8_LOCALE_ONLY } diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index 0bd8d63..d33262d 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -123,7 +123,7 @@ bool wxTopLevelWindowBase::Destroy() i != end; ++i ) { - wxTopLevelWindow * const win = wx_static_cast(wxTopLevelWindow *, *i); + wxTopLevelWindow * const win = static_cast(*i); if ( win != this && win->IsShown() ) { // there remains at least one other visible TLW, we can hide this @@ -150,7 +150,7 @@ bool wxTopLevelWindowBase::IsLastBeforeExit() const // then decide whether we should exit at all for ( i = wxTopLevelWindows.begin(); i != end; ++i ) { - wxTopLevelWindow * const win = wx_static_cast(wxTopLevelWindow *, *i); + wxTopLevelWindow * const win = static_cast(*i); if ( win->ShouldPreventAppExit() ) { // there remains at least one important TLW, don't exit @@ -162,7 +162,7 @@ bool wxTopLevelWindowBase::IsLastBeforeExit() const for ( i = wxTopLevelWindows.begin(); i != end; ++i ) { // don't close twice the windows which are already marked for deletion - wxTopLevelWindow * const win = wx_static_cast(wxTopLevelWindow *, *i); + wxTopLevelWindow * const win = static_cast(*i); if ( !wxPendingDelete.Member(win) && !win->Close() ) { // one of the windows refused to close, don't exit diff --git a/src/common/uri.cpp b/src/common/uri.cpp index 41d2e64..fd5b69c 100644 --- a/src/common/uri.cpp +++ b/src/common/uri.cpp @@ -132,7 +132,7 @@ wxString wxURI::Unescape(const wxString& uri) wxASSERT_MSG( n >= 0 && n <= 0xff, "unexpected character value" ); - c = wx_static_cast(char, n); + c = static_cast(n); } *p = c; diff --git a/src/common/variant.cpp b/src/common/variant.cpp index 6d3996a..95633e6 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -1034,7 +1034,7 @@ bool wxVariantDataWxObjectPtr::Write(wxSTD ostream& str) const bool wxVariantDataWxObjectPtr::Write(wxString& str) const { - str.Printf(wxT("%s(%p)"), GetType().c_str(), wx_static_cast(void*, m_value)); + str.Printf(wxT("%s(%p)"), GetType().c_str(), static_cast(m_value)); return true; } diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 1de8082..531c674 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -2617,7 +2617,7 @@ bool wxWindowBase::ms_winCaptureChanging = false; void wxWindowBase::CaptureMouse() { - wxLogTrace(_T("mousecapture"), _T("CaptureMouse(%p)"), wx_static_cast(void*, this)); + wxLogTrace(_T("mousecapture"), _T("CaptureMouse(%p)"), static_cast(this)); wxASSERT_MSG( !ms_winCaptureChanging, _T("recursive CaptureMouse call?") ); @@ -2644,7 +2644,7 @@ void wxWindowBase::CaptureMouse() void wxWindowBase::ReleaseMouse() { - wxLogTrace(_T("mousecapture"), _T("ReleaseMouse(%p)"), wx_static_cast(void*, this)); + wxLogTrace(_T("mousecapture"), _T("ReleaseMouse(%p)"), static_cast(this)); wxASSERT_MSG( !ms_winCaptureChanging, _T("recursive ReleaseMouse call?") ); @@ -2673,7 +2673,7 @@ void wxWindowBase::ReleaseMouse() wxLogTrace(_T("mousecapture"), (const wxChar *) _T("After ReleaseMouse() mouse is captured by %p"), - wx_static_cast(void*, GetCapture())); + static_cast(GetCapture())); } static void DoNotifyWindowAboutCaptureLost(wxWindow *win) diff --git a/src/common/wrapsizer.cpp b/src/common/wrapsizer.cpp index 3884201..9cb3285 100644 --- a/src/common/wrapsizer.cpp +++ b/src/common/wrapsizer.cpp @@ -112,7 +112,7 @@ void wxWrapSizer::ClearRows() row->GetChildren().clear(); wxPropChanger * const - propChanger = wx_static_cast(wxPropChanger *, item->GetUserData()); + propChanger = static_cast(item->GetUserData()); if ( propChanger ) { // this deletes propChanger and so restores the old proportion diff --git a/src/common/wxcrt.cpp b/src/common/wxcrt.cpp index 9dbdc1b..99982f5 100644 --- a/src/common/wxcrt.cpp +++ b/src/common/wxcrt.cpp @@ -304,7 +304,7 @@ static int vswscanf(const wchar_t *ws, const wchar_t *format, va_list argptr) wxCHECK_MSG( wxStrstr(format, _T("%c")) == NULL, -1, _T("incomplete vswscanf implementation doesn't allow %c") ); - return vsscanf(wx_static_cast(const char*, wxConvLibc.cWX2MB(ws)), + return vsscanf(static_cast(wxConvLibc.cWX2MB(ws)), wxConvLibc.cWX2MB(format), argptr); } #endif @@ -1311,15 +1311,15 @@ int wxVsscanf(const char *str, const char *format, va_list ap) int wxVsscanf(const wchar_t *str, const wchar_t *format, va_list ap) { return wxCRT_VsscanfW(str, format, ap); } int wxVsscanf(const wxCharBuffer& str, const char *format, va_list ap) - { return wxCRT_VsscanfA(wx_static_cast(const char*, str), format, ap); } + { return wxCRT_VsscanfA(static_cast(str), format, ap); } int wxVsscanf(const wxWCharBuffer& str, const wchar_t *format, va_list ap) { return wxCRT_VsscanfW(str, format, ap); } int wxVsscanf(const wxString& str, const char *format, va_list ap) - { return wxCRT_VsscanfA(wx_static_cast(const char*, str.mb_str()), format, ap); } + { return wxCRT_VsscanfA(static_cast(str.mb_str()), format, ap); } int wxVsscanf(const wxString& str, const wchar_t *format, va_list ap) { return wxCRT_VsscanfW(str.wc_str(), format, ap); } int wxVsscanf(const wxCStrData& str, const char *format, va_list ap) - { return wxCRT_VsscanfA(wx_static_cast(const char*, str.AsCharBuf()), format, ap); } + { return wxCRT_VsscanfA(static_cast(str.AsCharBuf()), format, ap); } int wxVsscanf(const wxCStrData& str, const wchar_t *format, va_list ap) { return wxCRT_VsscanfW(str.AsWCharBuf(), format, ap); } #endif // HAVE_NO_VSSCANF diff --git a/src/common/xlocale.cpp b/src/common/xlocale.cpp index 6adb86b..b04288c 100644 --- a/src/common/xlocale.cpp +++ b/src/common/xlocale.cpp @@ -71,7 +71,7 @@ wxXLocale& wxXLocale::GetCLocale() { if ( !gs_cLocale ) { - gs_cLocale = new wxXLocale(wx_static_cast(wxXLocaleCTag *, NULL)); + gs_cLocale = new wxXLocale(static_cast(NULL)); } return *gs_cLocale; diff --git a/src/common/zipstrm.cpp b/src/common/zipstrm.cpp index 70d5651..6a6ea74 100644 --- a/src/common/zipstrm.cpp +++ b/src/common/zipstrm.cpp @@ -1336,7 +1336,7 @@ void wxZipInputStream::Init(const wxString& file) Init(); m_allowSeeking = true; wxFFileInputStream *ffile; - ffile = wx_static_cast(wxFFileInputStream*, m_parent_i_stream); + ffile = static_cast(m_parent_i_stream); wxZipEntryPtr_ entry; if (ffile->Ok()) { @@ -2051,7 +2051,7 @@ bool wxZipOutputStream::CopyEntry(wxArchiveEntry *entry, return false; } - return CopyEntry(zipEntry, wx_static_cast(wxZipInputStream&, stream)); + return CopyEntry(zipEntry, static_cast(stream)); } bool wxZipOutputStream::CopyArchiveMetaData(wxZipInputStream& inputStream) @@ -2065,7 +2065,7 @@ bool wxZipOutputStream::CopyArchiveMetaData(wxZipInputStream& inputStream) bool wxZipOutputStream::CopyArchiveMetaData(wxArchiveInputStream& stream) { - return CopyArchiveMetaData(wx_static_cast(wxZipInputStream&, stream)); + return CopyArchiveMetaData(static_cast(stream)); } void wxZipOutputStream::SetLevel(int level) diff --git a/src/dfb/app.cpp b/src/dfb/app.cpp index 093bd63..ad9144d 100644 --- a/src/dfb/app.cpp +++ b/src/dfb/app.cpp @@ -190,7 +190,7 @@ bool wxApp::Yield(bool onlyIfNeeded) #endif // wxUSE_LOG wxEventLoop * const - loop = wx_static_cast(wxEventLoop *, wxEventLoop::GetActive()); + loop = static_cast(wxEventLoop::GetActive()); if ( loop ) loop->Yield(); diff --git a/src/generic/animateg.cpp b/src/generic/animateg.cpp index a2a50f9..0815503 100644 --- a/src/generic/animateg.cpp +++ b/src/generic/animateg.cpp @@ -42,7 +42,7 @@ wxAnimationDecoderList wxAnimation::sm_handlers; // ---------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxAnimation, wxAnimationBase) -#define M_ANIMDATA wx_static_cast(wxAnimationDecoder*, m_refData) +#define M_ANIMDATA static_cast(m_refData) wxSize wxAnimation::GetSize() const { diff --git a/src/generic/calctrlg.cpp b/src/generic/calctrlg.cpp index d593094..ec7a531 100644 --- a/src/generic/calctrlg.cpp +++ b/src/generic/calctrlg.cpp @@ -785,7 +785,7 @@ size_t wxGenericCalendarCtrl::GetWeek(const wxDateTime& date) const wxSize wxGenericCalendarCtrl::DoGetBestSize() const { // calc the size of the calendar - wx_const_cast(wxGenericCalendarCtrl *, this)->RecalcGeometry(); + const_cast(this)->RecalcGeometry(); wxCoord width = 7*m_widthCol, height = 7*m_heightRow + m_rowOffset; diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 76306c3..ed19073 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -2693,7 +2693,7 @@ int wxDataViewMainWindow::GetEndOfLastCol() const for (i = 0; i < GetOwner()->GetColumnCount(); i++) { const wxDataViewColumn *c = - wx_const_cast(wxDataViewCtrl*, GetOwner())->GetColumn( i ); + const_cast(GetOwner())->GetColumn( i ); if (!c->IsHidden()) width += c->GetWidth(); diff --git a/src/generic/filectrlg.cpp b/src/generic/filectrlg.cpp index e6404bf..e58ada1 100644 --- a/src/generic/filectrlg.cpp +++ b/src/generic/filectrlg.cpp @@ -1176,7 +1176,7 @@ void wxGenericFileCtrl::DoSetFilterIndex( int filterindex ) if ( !pcd ) return; - const wxString& str = ((wx_static_cast(wxStringClientData *, pcd))->GetData()); + const wxString& str = ((static_cast(pcd))->GetData()); m_list->SetWild( str ); m_filterIndex = filterindex; if ( str.Left( 2 ) == wxT( "*." ) ) diff --git a/src/generic/notebook.cpp b/src/generic/notebook.cpp index 04d8719..ae59e3f 100644 --- a/src/generic/notebook.cpp +++ b/src/generic/notebook.cpp @@ -102,7 +102,7 @@ private: static int GetPageId(wxTabView *tabview, wxNotebookPage *page) { - return wx_static_cast(wxNotebookTabView*, tabview)->GetId(page); + return static_cast(tabview)->GetId(page); } // ---------------------------------------------------------------------------- diff --git a/src/generic/paletteg.cpp b/src/generic/paletteg.cpp index 760e603..5b89e26 100644 --- a/src/generic/paletteg.cpp +++ b/src/generic/paletteg.cpp @@ -152,7 +152,7 @@ wxGDIRefData *wxPalette::CreateGDIRefData() const wxGDIRefData *wxPalette::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxPaletteRefData(*wx_static_cast(const wxPaletteRefData *, data)); + return new wxPaletteRefData(*static_cast(data)); } #endif // wxUSE_PALETTE diff --git a/src/generic/vlbox.cpp b/src/generic/vlbox.cpp index 861dc0d..0d7f8ef 100644 --- a/src/generic/vlbox.cpp +++ b/src/generic/vlbox.cpp @@ -427,11 +427,11 @@ void wxVListBox::OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const flags |= wxCONTROL_SELECTED; if ( IsCurrent(n) ) flags |= wxCONTROL_CURRENT; - if ( wxWindow::FindFocus() == wx_const_cast(wxVListBox*, this) ) + if ( wxWindow::FindFocus() == const_cast(this) ) flags |= wxCONTROL_FOCUSED; wxRendererNative::Get().DrawItemSelectionRect( - wx_const_cast(wxVListBox *, this), dc, rect, flags); + const_cast(this), dc, rect, flags); } } diff --git a/src/gtk/aboutdlg.cpp b/src/gtk/aboutdlg.cpp index 853d9a2..6e06f39 100644 --- a/src/gtk/aboutdlg.cpp +++ b/src/gtk/aboutdlg.cpp @@ -71,7 +71,7 @@ public: { #if !wxUSE_UNICODE_UTF8 for ( size_t n = 0; n < m_count; n++ ) - free(wx_const_cast(gchar *, m_strings[n])); + free(const_cast(m_strings[n])); #endif delete [] m_strings; diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index ede32fc..466cd68 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -228,7 +228,7 @@ wxBitmapRefData::~wxBitmapRefData() //----------------------------------------------------------------------------- -#define M_BMPDATA wx_static_cast(wxBitmapRefData*, m_refData) +#define M_BMPDATA static_cast(m_refData) IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxGDIObject) @@ -258,7 +258,7 @@ wxBitmap::wxBitmap(const char* const* bits) wxCHECK2_MSG(bits != NULL, return, wxT("invalid bitmap data")); GdkBitmap* mask = NULL; - SetPixmap(gdk_pixmap_create_from_xpm_d(wxGetRootWindow()->window, &mask, NULL, wx_const_cast(char**, bits))); + SetPixmap(gdk_pixmap_create_from_xpm_d(wxGetRootWindow()->window, &mask, NULL, const_cast(bits))); if (M_BMPDATA->m_pixmap != NULL && mask != NULL) { @@ -930,7 +930,7 @@ wxGDIRefData* wxBitmap::CreateGDIRefData() const wxGDIRefData* wxBitmap::CloneGDIRefData(const wxGDIRefData* data) const { - const wxBitmapRefData* oldRef = wx_static_cast(const wxBitmapRefData*, data); + const wxBitmapRefData* oldRef = static_cast(data); wxBitmapRefData* newRef = new wxBitmapRefData; newRef->m_width = oldRef->m_width; newRef->m_height = oldRef->m_height; diff --git a/src/gtk/colordlg.cpp b/src/gtk/colordlg.cpp index 8300d82..8eaca8b 100644 --- a/src/gtk/colordlg.cpp +++ b/src/gtk/colordlg.cpp @@ -99,7 +99,7 @@ void wxColourDialog::ColourDataToDialog() #if wxUSE_LIBHILDON HildonColorSelector * const sel = HILDON_COLOR_SELECTOR(m_widget); - hildon_color_selector_set_color(sel, wx_const_cast(GdkColor *, col)); + hildon_color_selector_set_color(sel, const_cast(col)); #else // !wxUSE_LIBHILDON GtkColorSelection *sel = GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(m_widget)->colorsel); diff --git a/src/gtk/colour.cpp b/src/gtk/colour.cpp index 484ba9b..ff2b953 100644 --- a/src/gtk/colour.cpp +++ b/src/gtk/colour.cpp @@ -83,7 +83,7 @@ void wxColourRefData::AllocColour( GdkColormap *cmap ) //----------------------------------------------------------------------------- -#define M_COLDATA wx_static_cast(wxColourRefData*, m_refData) +#define M_COLDATA static_cast(m_refData) // GDK's values are in 0..65535 range, ours are in 0..255 #define SHIFT 8 @@ -108,7 +108,7 @@ bool wxColour::operator == ( const wxColour& col ) const return false; wxColourRefData* refData = M_COLDATA; - wxColourRefData* that_refData = wx_static_cast(wxColourRefData*, col.m_refData); + wxColourRefData* that_refData = static_cast(col.m_refData); return refData->m_red == that_refData->m_red && refData->m_green == that_refData->m_green && refData->m_blue == that_refData->m_blue && diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 3e2a20c..1400774 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -49,7 +49,7 @@ wxCursorRefData::~wxCursorRefData() //----------------------------------------------------------------------------- -#define M_CURSORDATA wx_static_cast(wxCursorRefData*, m_refData) +#define M_CURSORDATA static_cast(m_refData) IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxGDIObject) @@ -361,7 +361,7 @@ wxGDIRefData *wxCursor::CreateGDIRefData() const wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data)); + return new wxCursorRefData(*static_cast(data)); } //----------------------------------------------------------------------------- diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 4610c07..1ce4c92 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -1605,7 +1605,7 @@ bool wxDataViewTextRenderer::GetValue( wxVariant &value ) const GValue gvalue = { 0, }; g_value_init( &gvalue, G_TYPE_STRING ); g_object_get_property( G_OBJECT(m_renderer), "text", &gvalue ); - wxString tmp = wxGTK_CONV_BACK_FONT( g_value_get_string( &gvalue ), wx_const_cast(wxDataViewTextRenderer*, this)->GetOwner()->GetOwner()->GetFont() ); + wxString tmp = wxGTK_CONV_BACK_FONT( g_value_get_string( &gvalue ), const_cast(this)->GetOwner()->GetOwner()->GetFont() ); g_value_unset( &gvalue ); value = tmp; diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index bd108eb..c1a2bda 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -551,5 +551,5 @@ wxGDIRefData* wxFont::CreateGDIRefData() const wxGDIRefData* wxFont::CloneGDIRefData(const wxGDIRefData* data) const { - return new wxFontRefData(*wx_static_cast(const wxFontRefData*, data)); + return new wxFontRefData(*static_cast(data)); } diff --git a/src/gtk/glcanvas.cpp b/src/gtk/glcanvas.cpp index 23d49c1..c8b805c 100644 --- a/src/gtk/glcanvas.cpp +++ b/src/gtk/glcanvas.cpp @@ -174,7 +174,7 @@ wxGLCanvas::wxGLCanvas(wxWindow *parent, const wxPalette& palette) : m_createImplicitContext(true) { - m_sharedContext = wx_const_cast(wxGLContext *, shared); + m_sharedContext = const_cast(shared); Create(parent, id, pos, size, style, name, attribList, palette); } @@ -189,7 +189,7 @@ wxGLCanvas::wxGLCanvas(wxWindow *parent, : m_createImplicitContext(true) { m_sharedContext = NULL; - m_sharedContextOf = wx_const_cast(wxGLCanvas *, shared); + m_sharedContextOf = const_cast(shared); Create(parent, id, pos, size, style, name, attribList, palette); } diff --git a/src/gtk/mdi.cpp b/src/gtk/mdi.cpp index f3f027e..f5703a9 100644 --- a/src/gtk/mdi.cpp +++ b/src/gtk/mdi.cpp @@ -404,7 +404,7 @@ void wxMDIChildFrame::SetTitle( const wxString &title ) void wxMDIClientWindow::AddChildGTK(wxWindowGTK* child) { - wxMDIChildFrame* child_frame = wx_static_cast(wxMDIChildFrame*, child); + wxMDIChildFrame* child_frame = static_cast(child); wxString s = child_frame->GetTitle(); if (s.IsNull()) s = _("MDI child"); @@ -417,7 +417,7 @@ void wxMDIClientWindow::AddChildGTK(wxWindowGTK* child) child_frame->m_page = (GtkNotebookPage*) (g_list_last(notebook->children)->data); - wxMDIParentFrame* parent_frame = wx_static_cast(wxMDIParentFrame*, GetParent()); + wxMDIParentFrame* parent_frame = static_cast(GetParent()); parent_frame->m_justInserted = true; } diff --git a/src/gtk/spinctrl.cpp b/src/gtk/spinctrl.cpp index 952d003..cb2d02f 100644 --- a/src/gtk/spinctrl.cpp +++ b/src/gtk/spinctrl.cpp @@ -142,7 +142,7 @@ double wxSpinCtrlGTKBase::DoGetValue() const GtkDisableEvents(); gtk_spin_button_update( GTK_SPIN_BUTTON(m_widget) ); - wx_const_cast(wxSpinCtrlGTKBase*, this)->m_value = + const_cast(this)->m_value = gtk_spin_button_get_value(GTK_SPIN_BUTTON(m_widget)); GtkEnableEvents(); diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp index 7deab1f..fcc213e 100644 --- a/src/gtk/tbargtk.cpp +++ b/src/gtk/tbargtk.cpp @@ -447,7 +447,7 @@ void wxToolBar::SetWindowStyleFlag( long style ) bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase); + wxToolBarTool* tool = static_cast(toolBase); GSList* radioGroup; switch ( tool->GetStyle() ) @@ -552,7 +552,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) bool wxToolBar::DoDeleteTool(size_t /* pos */, wxToolBarToolBase* toolBase) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase); + wxToolBarTool* tool = static_cast(toolBase); if (tool->GetStyle() == wxTOOL_STYLE_CONTROL) { @@ -597,7 +597,7 @@ GSList* wxToolBar::GetRadioGroup(size_t pos) void wxToolBar::DoEnableTool(wxToolBarToolBase *toolBase, bool enable) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase); + wxToolBarTool* tool = static_cast(toolBase); if (tool->m_item) gtk_widget_set_sensitive(GTK_WIDGET(tool->m_item), enable); @@ -605,7 +605,7 @@ void wxToolBar::DoEnableTool(wxToolBarToolBase *toolBase, bool enable) void wxToolBar::DoToggleTool( wxToolBarToolBase *toolBase, bool toggle ) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, toolBase); + wxToolBarTool* tool = static_cast(toolBase); if (tool->m_item) { @@ -653,7 +653,7 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord WXUNUSED(x), void wxToolBar::SetToolShortHelp( int id, const wxString& helpString ) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id)); + wxToolBarTool* tool = static_cast(FindById(id)); if ( tool ) { @@ -668,7 +668,7 @@ void wxToolBar::SetToolShortHelp( int id, const wxString& helpString ) void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap ) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id)); + wxToolBarTool* tool = static_cast(FindById(id)); if ( tool ) { wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools.")); @@ -680,7 +680,7 @@ void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap ) void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap ) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id)); + wxToolBarTool* tool = static_cast(FindById(id)); if ( tool ) { wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools.")); diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index 4c42bd8..d235fe8 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -216,7 +216,7 @@ void GTK_EndProcessDetector(gpointer data, gint source, GdkInputCondition WXUNUSED(condition)) { wxEndProcessData * const - proc_data = wx_static_cast(wxEndProcessData *, data); + proc_data = static_cast(data); // child exited, end waiting close(source); diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 30c48b9..367f3ae 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1893,7 +1893,7 @@ wxWindow *wxWindowBase::DoFindFocus() { wxWindowGTK *focus = gs_pendingFocus ? gs_pendingFocus : gs_currentFocus; // the cast is necessary when we compile in wxUniversal mode - return wx_static_cast(wxWindow*, focus); + return static_cast(focus); } void wxWindowGTK::AddChildGTK(wxWindowGTK* child) @@ -2633,8 +2633,8 @@ void wxWindowGTK::DoGetPosition( int *x, int *y ) const if (m_parent) m_parent->ScreenToClient(&org_x, &org_y); - wx_const_cast(wxWindowGTK*, this)->m_x = org_x; - wx_const_cast(wxWindowGTK*, this)->m_y = org_y; + const_cast(this)->m_x = org_x; + const_cast(this)->m_y = org_y; } } diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index be92430..cbd92cd 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -369,7 +369,7 @@ wxGDIRefData *wxBitmap::CreateGDIRefData() const wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data)); + return new wxBitmapRefData(*static_cast(data)); } bool wxBitmap::Create( int width, int height, int depth ) diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp index 836a62e..e6d11cc 100644 --- a/src/gtk1/choice.cpp +++ b/src/gtk1/choice.cpp @@ -264,7 +264,7 @@ void wxChoice::DoDeleteOneItem(unsigned int n) void ** const data = &itemsData[0]; if ( HasClientObjectData() ) - Append(items, wx_reinterpret_cast(wxClientData **, data)); + Append(items, reinterpret_cast(data)); else Append(items, data); } diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index 942cf56..d9373ef 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -327,7 +327,7 @@ wxGDIRefData *wxCursor::CreateGDIRefData() const wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data)); + return new wxCursorRefData(*static_cast(data)); } //----------------------------------------------------------------------------- diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 9fa41bf..d3770fd 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -1147,7 +1147,7 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCHECK_MSG( srcDC, false, "source must be a window DC" ); // FIXME: this cast is not always valid, see the code using m_isMemDC - wxMemoryDCImpl *memDC = wx_static_cast(wxMemoryDCImpl *, srcDC); + wxMemoryDCImpl *memDC = static_cast(srcDC); bool use_bitmap_method = false; bool is_mono = false; diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index 0975199..b032de7 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -543,7 +543,7 @@ wxGDIRefData *wxFont::CreateGDIRefData() const wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data)); + return new wxFontRefData(*static_cast(data)); } // ---------------------------------------------------------------------------- diff --git a/src/gtk1/glcanvas.cpp b/src/gtk1/glcanvas.cpp index 4f8a411..b90d59b 100644 --- a/src/gtk1/glcanvas.cpp +++ b/src/gtk1/glcanvas.cpp @@ -177,7 +177,7 @@ wxGLCanvas::wxGLCanvas(wxWindow *parent, const wxPalette& palette) : m_createImplicitContext(true) { - m_sharedContext = wx_const_cast(wxGLContext *, shared); + m_sharedContext = const_cast(shared); Create(parent, id, pos, size, style, name, attribList, palette); } @@ -191,7 +191,7 @@ wxGLCanvas::wxGLCanvas(wxWindow *parent, const wxPalette& palette ) : m_createImplicitContext(true) { - m_sharedContextOf = wx_const_cast(wxGLCanvas *, shared); + m_sharedContextOf = const_cast(shared); Create(parent, id, pos, size, style, name, attribList, palette); } diff --git a/src/gtk1/minifram.cpp b/src/gtk1/minifram.cpp index 568e643..4b1572b 100644 --- a/src/gtk1/minifram.cpp +++ b/src/gtk1/minifram.cpp @@ -105,7 +105,7 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g gdk_gc_unref( gc ); // Hack alert - wx_static_cast(wxClientDCImpl *, dc.GetImpl())->m_window = pizza->bin_window; + static_cast(dc.GetImpl())->m_window = pizza->bin_window; dc.SetTextForeground( *wxWHITE ); dc.DrawText( win->GetTitle(), 6, 3 ); } @@ -151,7 +151,7 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU gdk_gc_unref( gc ); // Hack alert - wx_static_cast(wxClientDCImpl *, dc.GetImpl())->m_window = pizza->bin_window; + static_cast(dc.GetImpl())->m_window = pizza->bin_window; dc.SetTextForeground( *wxWHITE ); dc.DrawText( win->GetTitle(), 6, 3 ); } diff --git a/src/gtk1/settings.cpp b/src/gtk1/settings.cpp index a428fd8..18cef0d 100644 --- a/src/gtk1/settings.cpp +++ b/src/gtk1/settings.cpp @@ -149,7 +149,7 @@ static void GetTooltipColors() gs_objects.m_colTooltip = wxColor(c.red >> SHIFT, c.green >> SHIFT, c.blue >> SHIFT); c = tooltips->tip_window->style->fg[GTK_STATE_NORMAL]; gs_objects.m_colTooltipText = wxColor(c.red >> SHIFT, c.green >> SHIFT, c.blue >> SHIFT); - gtk_object_sink(wx_reinterpret_cast(GtkObject*, tooltips)); + gtk_object_sink(reinterpret_cast(tooltips)); } wxColour wxSystemSettingsNative::GetColour( wxSystemColour index ) diff --git a/src/gtk1/utilsgtk.cpp b/src/gtk1/utilsgtk.cpp index 3cf71d3..7271066 100644 --- a/src/gtk1/utilsgtk.cpp +++ b/src/gtk1/utilsgtk.cpp @@ -135,7 +135,7 @@ void GTK_EndProcessDetector(gpointer data, gint source, GdkInputCondition WXUNUSED(condition) ) { wxEndProcessData * const - proc_data = wx_static_cast(wxEndProcessData *, data); + proc_data = static_cast(data); // child exited, end waiting close(source); diff --git a/src/mgl/bitmap.cpp b/src/mgl/bitmap.cpp index a5e7521..b58ad78 100644 --- a/src/mgl/bitmap.cpp +++ b/src/mgl/bitmap.cpp @@ -182,7 +182,7 @@ wxGDIRefData *wxBitmap::CreateGDIRefData() const wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data)); + return new wxBitmapRefData(*static_cast(data)); } bool wxBitmap::Create(int width, int height, int depth) diff --git a/src/motif/cursor.cpp b/src/motif/cursor.cpp index 2f5b567..df2e6c1 100644 --- a/src/motif/cursor.cpp +++ b/src/motif/cursor.cpp @@ -305,7 +305,7 @@ wxGDIRefData *wxCursor::CreateGDIRefData() const wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data)); + return new wxCursorRefData(*static_cast(data)); } // Motif-specific: create/get a cursor for the current display diff --git a/src/motif/font.cpp b/src/motif/font.cpp index 15bc878..04d2e08 100644 --- a/src/motif/font.cpp +++ b/src/motif/font.cpp @@ -351,7 +351,7 @@ wxGDIRefData *wxFont::CreateGDIRefData() const wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data)); + return new wxFontRefData(*static_cast(data)); } // ---------------------------------------------------------------------------- @@ -690,7 +690,7 @@ void wxGetTextExtent(WXDisplay* display, const wxFont& font, int slen = str.length(); XTextExtents((XFontStruct*) pFontStruct, - wx_const_cast(char*, (const char *)str.mb_str()), slen, + const_cast((const char *)str.mb_str()), slen, &direction, &ascent2, &descent2, &overall); if ( width ) diff --git a/src/msdos/utilsdos.cpp b/src/msdos/utilsdos.cpp index ff46476..006603a 100644 --- a/src/msdos/utilsdos.cpp +++ b/src/msdos/utilsdos.cpp @@ -321,7 +321,7 @@ long wxExecute(const wxString& command, int flags, wxProcess *process) argv[n] = NULL; while (n-- > 0) - argv[n] = wx_const_cast(wxChar*, (const char *)args[n].c_str()); + argv[n] = const_cast((const char *)args[n].c_str()); long result = wxExecute(argv, flags, process); diff --git a/src/msw/app.cpp b/src/msw/app.cpp index ae79732..ccac439 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -341,7 +341,7 @@ public: { if ( m_ok == -1 ) { - wxConsoleStderr * const self = wx_const_cast(wxConsoleStderr *, this); + wxConsoleStderr * const self = const_cast(this); self->m_ok = self->DoInit(); // no need to call IsHistoryUnchanged() as we just initialized diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 307c67b..1e8ff64 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -254,7 +254,7 @@ wxGDIImageRefData *wxBitmap::CreateData() const wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *dataOrig) const { const wxBitmapRefData * - data = wx_static_cast(const wxBitmapRefData *, dataOrig); + data = static_cast(dataOrig); if ( !data ) return NULL; @@ -262,7 +262,7 @@ wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *dataOrig) const // wxBitmapRefData using its copy ctor but instead it modifies this // bitmap itself and then returns its m_refData -- which works, of // course (except in !wxUSE_WXDIB), but is completely illogical - wxBitmap *self = wx_const_cast(wxBitmap *, this); + wxBitmap *self = const_cast(this); wxBitmapRefData *selfdata; #if wxUSE_WXDIB @@ -272,7 +272,7 @@ wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *dataOrig) const wxDIB dib((HBITMAP)(data->m_hBitmap)); self->CopyFromDIB(dib); - selfdata = wx_static_cast(wxBitmapRefData *, m_refData); + selfdata = static_cast(m_refData); selfdata->m_hasAlpha = data->m_hasAlpha; } else diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 6325415..ef43802 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -305,7 +305,7 @@ void wxButton::SetLabel(const wxString& label) wxSize wxButton::DoGetBestSize() const { - return wxMSWButton::ComputeBestSize(wx_const_cast(wxButton *, this)); + return wxMSWButton::ComputeBestSize(const_cast(this)); } /* static */ diff --git a/src/msw/calctrl.cpp b/src/msw/calctrl.cpp index 3b96095..dc18f88 100644 --- a/src/msw/calctrl.cpp +++ b/src/msw/calctrl.cpp @@ -190,7 +190,7 @@ wxCalendarCtrl::HitTest(const wxPoint& pos, case MCHT_CALENDARDAY: if ( wd ) { - *wd = wx_static_cast(wxDateTime::WeekDay, hti.st.wDayOfWeek); + *wd = static_cast(hti.st.wDayOfWeek); } return wxCAL_HITTEST_HEADER; diff --git a/src/msw/checkbox.cpp b/src/msw/checkbox.cpp index 5dba255..bc59d8a 100644 --- a/src/msw/checkbox.cpp +++ b/src/msw/checkbox.cpp @@ -200,7 +200,7 @@ wxSize wxCheckBox::DoGetBestSize() const int wCheckbox, hCheckbox; if ( !str.empty() ) { - wxClientDC dc(wx_const_cast(wxCheckBox *, this)); + wxClientDC dc(const_cast(this)); dc.SetFont(GetFont()); dc.GetMultiLineTextExtent(GetLabelText(str), &wCheckbox, &hCheckbox); wCheckbox += s_checkSize + GetCharWidth(); diff --git a/src/msw/colordlg.cpp b/src/msw/colordlg.cpp index 7a52b05..f369f47 100644 --- a/src/msw/colordlg.cpp +++ b/src/msw/colordlg.cpp @@ -77,7 +77,7 @@ wxColourDialogHookProc(HWND hwnd, { CHOOSECOLOR *pCC = (CHOOSECOLOR *)lParam; wxColourDialog * const - dialog = wx_reinterpret_cast(wxColourDialog *, pCC->lCustData); + dialog = reinterpret_cast(pCC->lCustData); const wxString title = dialog->GetTitle(); if ( !title.empty() ) diff --git a/src/msw/datectrl.cpp b/src/msw/datectrl.cpp index 0b291ec..1009211 100644 --- a/src/msw/datectrl.cpp +++ b/src/msw/datectrl.cpp @@ -124,7 +124,7 @@ WXDWORD wxDatePickerCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const wxSize wxDatePickerCtrl::DoGetBestSize() const { - wxClientDC dc(wx_const_cast(wxDatePickerCtrl *, this)); + wxClientDC dc(const_cast(this)); // we can't use FormatDate() here as the CRT doesn't always use the same // format as the date picker control diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index 7eac011..4b5b72c 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -337,7 +337,7 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst) NULL, // no driver name as we use device name deviceName.wx_str(), NULL, // unused - wx_static_cast(DEVMODE *, lockDevMode.Get()) + static_cast(lockDevMode.Get()) ); if ( !hDC ) wxLogLastError(_T("CreateDC(printer)")); diff --git a/src/msw/display.cpp b/src/msw/display.cpp index 4ae8806..aec1509 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -852,7 +852,7 @@ wxDisplayFactoryDirectDraw::DDEnumExCallback(GUID *pGuid, if ( pGuid ) { wxDisplayFactoryDirectDraw * self = - wx_static_cast(wxDisplayFactoryDirectDraw *, lpContext); + static_cast(lpContext); self->AddDisplay(*pGuid, hmon, driverName); } //else: we're called for the primary monitor, skip it @@ -881,7 +881,7 @@ wxDisplayImpl *wxDisplayFactoryDirectDraw::CreateDisplay(unsigned n) wxCHECK_MSG( n < m_displays.size(), NULL, _T("invalid display index") ); wxDisplayInfoDirectDraw * - info = wx_static_cast(wxDisplayInfoDirectDraw *, m_displays[n]); + info = static_cast(m_displays[n]); if ( !info->m_pDD2 ) { @@ -955,7 +955,7 @@ HRESULT WINAPI wxDDEnumModesCallback(LPDDSURFACEDESC lpDDSurfaceDesc, if ( (lpDDSurfaceDesc->dwFlags & FLAGS_REQUIRED) == FLAGS_REQUIRED ) { wxDDVideoModesAdder * const vmodes = - wx_static_cast(wxDDVideoModesAdder *, lpContext); + static_cast(lpContext); vmodes->Add(wxVideoMode(lpDDSurfaceDesc->dwWidth, lpDDSurfaceDesc->dwHeight, diff --git a/src/msw/dlmsw.cpp b/src/msw/dlmsw.cpp index ac4f88b..0b4d76d 100644 --- a/src/msw/dlmsw.cpp +++ b/src/msw/dlmsw.cpp @@ -194,7 +194,7 @@ wxString wxVersionDLL::GetFileVersion(const wxString& filename) const wxString ver; if ( m_dll.IsLoaded() ) { - wxChar *pc = wx_const_cast(wxChar *, (const wxChar*) filename.t_str()); + wxChar *pc = const_cast((const wxChar*) filename.t_str()); DWORD dummy; DWORD sizeVerInfo = m_pfnGetFileVersionInfoSize(pc, &dummy); diff --git a/src/msw/enhmeta.cpp b/src/msw/enhmeta.cpp index a3931c9..82d4adf 100644 --- a/src/msw/enhmeta.cpp +++ b/src/msw/enhmeta.cpp @@ -321,7 +321,7 @@ wxEnhMetaFileDC::wxEnhMetaFileDC(const wxString& filename, wxEnhMetaFile *wxEnhMetaFileDC::Close() { wxEnhMetaFileDCImpl * const - impl = wx_static_cast(wxEnhMetaFileDCImpl *, GetImpl()); + impl = static_cast(GetImpl()); wxCHECK_MSG( impl, NULL, _T("no wxEnhMetaFileDC implementation") ); return impl->Close(); diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index b788f8a..c618fe3 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -88,10 +88,10 @@ wxFileDialogHookFunction(HWND hDlg, { case WM_NOTIFY: { - OFNOTIFY *pNotifyCode = wx_reinterpret_cast(OFNOTIFY *, lParam); + OFNOTIFY *pNotifyCode = reinterpret_cast(lParam); if ( pNotifyCode->hdr.code == CDN_INITDONE ) { - wx_reinterpret_cast(wxFileDialog *, + reinterpret_cast( pNotifyCode->lpOFN->lCustData) ->MSWOnInitDone((WXHWND)hDlg); } diff --git a/src/msw/font.cpp b/src/msw/font.cpp index f2ff677..992dea1 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -214,7 +214,7 @@ public: WXHFONT GetHFONT(const wxFont *font) const { if ( !m_hFont ) - wx_const_cast(wxFontRefData *, this)->Alloc(font); + const_cast(this)->Alloc(font); return (WXHFONT)m_hFont; } @@ -902,7 +902,7 @@ wxGDIRefData *wxFont::CreateGDIRefData() const wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data)); + return new wxFontRefData(*static_cast(data)); } bool wxFont::RealizeResource() diff --git a/src/msw/gdiobj.cpp b/src/msw/gdiobj.cpp index 7a3f65e..cc43985 100644 --- a/src/msw/gdiobj.cpp +++ b/src/msw/gdiobj.cpp @@ -27,7 +27,7 @@ #include "wx/msw/private.h" -#define M_GDIDATA wx_static_cast(wxGDIRefData*, m_refData) +#define M_GDIDATA static_cast(m_refData) /* void wxGDIObject::IncrementResourceUsage(void) diff --git a/src/msw/icon.cpp b/src/msw/icon.cpp index 14d2029..778aace 100644 --- a/src/msw/icon.cpp +++ b/src/msw/icon.cpp @@ -100,7 +100,7 @@ wxIcon::~wxIcon() wxObjectRefData *wxIcon::CloneRefData(const wxObjectRefData *dataOrig) const { const wxIconRefData * - data = wx_static_cast(const wxIconRefData *, dataOrig); + data = static_cast(dataOrig); if ( !data ) return NULL; diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 17edff1..c337ef1 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -802,7 +802,7 @@ wxTextCtrl* wxListCtrl::GetEditControl() const HWND hwndEdit = ListView_GetEditControl(GetHwnd()); if ( hwndEdit ) { - wxListCtrl * const self = wx_const_cast(wxListCtrl *, this); + wxListCtrl * const self = const_cast(this); if ( !m_textCtrl ) self->m_textCtrl = new wxTextCtrl; diff --git a/src/msw/mediactrl_am.cpp b/src/msw/mediactrl_am.cpp index 5c8ed2c..d86f872 100644 --- a/src/msw/mediactrl_am.cpp +++ b/src/msw/mediactrl_am.cpp @@ -1983,7 +1983,7 @@ double wxAMMediaBackend::GetVolume() bool wxAMMediaBackend::SetVolume(double dVolume) { // inverse the transformation above - long lVolume = wx_static_cast(long, 2000*log10(dVolume + (1 - dVolume)*0.00001)); + long lVolume = static_cast(2000*log10(dVolume + (1 - dVolume)*0.00001)); HRESULT hr = GetAM()->put_Volume(lVolume); if(FAILED(hr)) diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 4c929ad..8cae440 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -469,7 +469,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) } mii.cch = itemText.length(); - mii.dwTypeData = wx_const_cast(wxChar *, itemText.wx_str()); + mii.dwTypeData = const_cast(itemText.wx_str()); if (flags & MF_POPUP) { @@ -489,7 +489,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) // item and this looks downright ugly // // so instead draw it ourselves in MSWOnDrawItem() - mii.dwItemData = wx_reinterpret_cast(ULONG_PTR, pItem); + mii.dwItemData = reinterpret_cast(pItem); if ( pItem->IsCheckable() ) { mii.hbmpChecked = @@ -760,7 +760,7 @@ void wxMenu::SetTitle(const wxString& label) info.fMask = MIIM_TYPE; info.fType = MFT_STRING; info.cch = m_title.length(); - info.dwTypeData = wx_const_cast(wxChar *, m_title.wx_str()); + info.dwTypeData = const_cast(m_title.wx_str()); if ( !SetMenuItemInfo(hMenu, 0, TRUE, & info) ) { wxLogLastError(wxT("SetMenuItemInfo")); @@ -930,7 +930,7 @@ WXHMENU wxMenuBar::Create() if ( m_hMenu != 0 ) return m_hMenu; - wxToolMenuBar * const bar = wx_static_cast(wxToolMenuBar *, GetToolBar()); + wxToolMenuBar * const bar = static_cast(GetToolBar()); if ( !bar ) return NULL; @@ -1080,7 +1080,7 @@ void wxMenuBar::SetMenuLabel(size_t pos, const wxString& label) info.fMask = MIIM_TYPE; info.fType = MFT_STRING; info.cch = label.length(); - info.dwTypeData = wx_const_cast(wxChar *, label.wx_str()); + info.dwTypeData = const_cast(label.wx_str()); if ( !SetMenuItemInfo(GetHmenu(), id, TRUE, &info) ) { wxLogLastError(wxT("SetMenuItemInfo")); diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index e2d5bcb..cc55d41 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -195,7 +195,7 @@ WXWPARAM wxMenuItem::GetMSWId() const // generating WM_COMMAND messages with negative high word of wParam), so // use the cast to ensure the id is in range return m_subMenu ? wxPtrToUInt(m_subMenu->GetHMenu()) - : wx_static_cast(unsigned short, GetId()); + : static_cast(GetId()); } // get item state diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index 7152568..96c4771 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -101,7 +101,7 @@ wxGDIRefData *wxMetafile::CreateGDIRefData() const wxGDIRefData *wxMetafile::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxMetafileRefData(*wx_static_cast(const wxMetafileRefData *, data)); + return new wxMetafileRefData(*static_cast(data)); } bool wxMetafile::SetClipboard(int width, int height) diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 6ee2c39..2e1739d 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -325,7 +325,7 @@ bool wxNotebook::Create(wxWindow *parent, if ( ::GetClassInfo(NULL, WC_TABCONTROL, &wc) ) { gs_wndprocNotebook = - wx_reinterpret_cast(WXFARPROC, wc.lpfnWndProc); + reinterpret_cast(wc.lpfnWndProc); wc.lpszClassName = wxT("_wx_SysTabCtl32"); wc.style &= ~(CS_HREDRAW | CS_VREDRAW); wc.hInstance = wxGetInstance(); diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index 3003abd..ff9169d 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -693,7 +693,7 @@ const void *wxDataObject::GetSizeFromBuffer(const void *buffer, // hack: the third parameter is declared non-const in Wine's headers so // cast away the const const size_t realsz = ::HeapSize(::GetProcessHeap(), 0, - wx_const_cast(void*, buffer)); + const_cast(buffer)); if ( realsz == (size_t)-1 ) { // note that HeapSize() does not set last error diff --git a/src/msw/palette.cpp b/src/msw/palette.cpp index 800db50..a9c9fc8 100644 --- a/src/msw/palette.cpp +++ b/src/msw/palette.cpp @@ -133,7 +133,7 @@ wxGDIRefData *wxPalette::CreateGDIRefData() const wxGDIRefData *wxPalette::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxPaletteRefData(*wx_static_cast(const wxPaletteRefData *, data)); + return new wxPaletteRefData(*static_cast(data)); } int wxPalette::GetColoursCount() const diff --git a/src/msw/pen.cpp b/src/msw/pen.cpp index ae66559..e09178b 100644 --- a/src/msw/pen.cpp +++ b/src/msw/pen.cpp @@ -74,14 +74,14 @@ public: // accessors and setters // --------------------- - wxColour& GetColour() const { return wx_const_cast(wxColour&, m_colour); } + wxColour& GetColour() const { return const_cast(m_colour); } int GetWidth() const { return m_width; } wxPenStyle GetStyle() const { return m_style; } wxPenJoin GetJoin() const { return m_join; } wxPenCap GetCap() const { return m_cap; } wxDash* GetDash() const { return m_dash; } int GetDashCount() const { return m_nbDash; } - wxBitmap* GetStipple() const { return wx_const_cast(wxBitmap *, &m_stipple); } + wxBitmap* GetStipple() const { return const_cast(&m_stipple); } void SetColour(const wxColour& col) { Free(); m_colour = col; } void SetWidth(int width) { Free(); m_width = width; } @@ -99,7 +99,7 @@ public: Free(); m_nbDash = nb_dashes; - m_dash = wx_const_cast(wxDash *, dash); + m_dash = const_cast(dash); } void SetJoin(wxPenJoin join) { Free(); m_join = join; } @@ -419,7 +419,7 @@ bool wxPenRefData::Free() WXHPEN wxPenRefData::GetHPEN() const { if ( !m_hPen ) - wx_const_cast(wxPenRefData *, this)->Alloc(); + const_cast(this)->Alloc(); return (WXHPEN)m_hPen; } @@ -450,7 +450,7 @@ wxPen::wxPen(const wxBitmap& stipple, int width) bool wxPen::operator==(const wxPen& pen) const { const wxPenRefData * - penData = wx_static_cast(const wxPenRefData *, pen.m_refData); + penData = static_cast(pen.m_refData); // an invalid pen is only equal to another invalid pen return m_refData ? penData && *M_PENDATA == *penData : !penData; @@ -483,7 +483,7 @@ wxGDIRefData* wxPen::CreateGDIRefData() const wxGDIRefData* wxPen::CloneGDIRefData(const wxGDIRefData* data) const { - return new wxPenRefData(*wx_static_cast(const wxPenRefData*, data)); + return new wxPenRefData(*static_cast(data)); } void wxPen::SetColour(const wxColour& col) diff --git a/src/msw/printdlg.cpp b/src/msw/printdlg.cpp index eb2d5dd..46d8776 100644 --- a/src/msw/printdlg.cpp +++ b/src/msw/printdlg.cpp @@ -129,10 +129,10 @@ wxWindowsPrintNativeData::wxWindowsPrintNativeData() wxWindowsPrintNativeData::~wxWindowsPrintNativeData() { if ( m_devMode ) - ::GlobalFree(wx_static_cast(HGLOBAL, m_devMode)); + ::GlobalFree(static_cast(m_devMode)); if ( m_devNames ) - ::GlobalFree(wx_static_cast(HGLOBAL, m_devNames)); + ::GlobalFree(static_cast(m_devNames)); } bool wxWindowsPrintNativeData::IsOk() const @@ -147,7 +147,7 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data ) GlobalPtrLock lockDevMode(m_devMode); - LPDEVMODE devMode = wx_static_cast(LPDEVMODE, lockDevMode.Get()); + LPDEVMODE devMode = static_cast(lockDevMode.Get()); //// Orientation if (devMode->dmFields & DM_ORIENTATION) @@ -312,7 +312,7 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data ) if ( m_devNames ) { GlobalPtrLock lockDevNames(m_devNames); - LPDEVNAMES lpDevNames = wx_static_cast(LPDEVNAMES, lockDevNames.Get()); + LPDEVNAMES lpDevNames = static_cast(lockDevNames.Get()); // TODO: Unicode-ification @@ -335,7 +335,7 @@ bool wxWindowsPrintNativeData::TransferTo( wxPrintData &data ) bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) { - HGLOBAL hDevMode = wx_static_cast(HGLOBAL, m_devMode); + HGLOBAL hDevMode = static_cast(m_devMode); if ( !m_devMode ) { // Use PRINTDLG as a way of creating a DEVMODE object @@ -393,7 +393,7 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) if ( hDevMode ) { GlobalPtrLock lockDevMode(hDevMode); - DEVMODE * const devMode = wx_static_cast(DEVMODE *, lockDevMode.Get()); + DEVMODE * const devMode = static_cast(lockDevMode.Get()); //// Orientation devMode->dmOrientation = (short)data.GetOrientation(); @@ -412,7 +412,7 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) { // NB: the cast is needed in the ANSI build, strangely enough // dmDeviceName is BYTE[] and not char[] there - wxStrncpy(wx_reinterpret_cast(wxChar *, devMode->dmDeviceName), + wxStrncpy(reinterpret_cast(devMode->dmDeviceName), name.wx_str(), WXSIZEOF(devMode->dmDeviceName) - 1); devMode->dmDeviceName[WXSIZEOF(devMode->dmDeviceName) - 1] = wxT('\0'); @@ -544,7 +544,7 @@ bool wxWindowsPrintNativeData::TransferFrom( const wxPrintData &data ) if ( m_devNames ) { - ::GlobalFree(wx_static_cast(HGLOBAL, m_devNames)); + ::GlobalFree(static_cast(m_devNames)); } // TODO: I hope it's OK to pass some empty strings to DEVNAMES. @@ -675,13 +675,13 @@ bool wxWindowsPrintDialog::ConvertToNative( wxPrintDialogData &data ) if (pd->hDevNames) GlobalFree(pd->hDevNames); - pd->hDevMode = wx_static_cast(HGLOBAL, native_data->GetDevMode()); + pd->hDevMode = static_cast(native_data->GetDevMode()); native_data->SetDevMode(NULL); // Shouldn't assert; we should be able to test Ok-ness at a higher level //wxASSERT_MSG( (pd->hDevMode), wxT("hDevMode must be non-NULL in ConvertToNative!")); - pd->hDevNames = wx_static_cast(HGLOBAL, native_data->GetDevNames()); + pd->hDevNames = static_cast(native_data->GetDevNames()); native_data->SetDevNames(NULL); @@ -741,7 +741,7 @@ bool wxWindowsPrintDialog::ConvertFromNative( wxPrintDialogData &data ) { if (native_data->GetDevMode()) { - ::GlobalFree(wx_static_cast(HGLOBAL, native_data->GetDevMode())); + ::GlobalFree(static_cast(native_data->GetDevMode())); } native_data->SetDevMode(pd->hDevMode); pd->hDevMode = NULL; @@ -752,7 +752,7 @@ bool wxWindowsPrintDialog::ConvertFromNative( wxPrintDialogData &data ) { if (native_data->GetDevNames()) { - ::GlobalFree(wx_static_cast(HGLOBAL, native_data->GetDevNames())); + ::GlobalFree(static_cast(native_data->GetDevNames())); } native_data->SetDevNames(pd->hDevNames); pd->hDevNames = NULL; diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index 281521c..41e0c03 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -508,7 +508,7 @@ public: const wxSize& fullSize) : wxDC(new PageFragmentDCImpl((wxMemoryDC*)this, printer, offset, fullSize)) { - wx_static_cast(PageFragmentDCImpl*, m_pimpl)->DoSelect(bmp); + static_cast(m_pimpl)->DoSelect(bmp); } }; diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 1def8c5..4067064 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -1197,7 +1197,7 @@ FormatAsHex(const void *data, // write all the rest as comma-separated bytes value.reserve(3*size + 10); - const char * const p = wx_static_cast(const char *, data); + const char * const p = static_cast(data); for ( size_t n = 0; n < size; n++ ) { // TODO: line wrapping: although not required by regedit, this makes @@ -1364,7 +1364,7 @@ bool wxRegKey::DoExport(wxOutputStream& ostr) const // dump all our values long dummy; wxString name; - wxRegKey& self = wx_const_cast(wxRegKey&, *this); + wxRegKey& self = const_cast(*this); bool cont = self.GetFirstValue(name, dummy); while ( cont ) { diff --git a/src/msw/stackwalk.cpp b/src/msw/stackwalk.cpp index c620eae..1b96e36 100644 --- a/src/msw/stackwalk.cpp +++ b/src/msw/stackwalk.cpp @@ -161,7 +161,7 @@ void wxStackFrame::OnParam(PSYMBOL_INFO pSymInfo) BOOL CALLBACK EnumSymbolsProc(PSYMBOL_INFO pSymInfo, ULONG WXUNUSED(SymSize), PVOID data) { - wxStackFrame *frame = wx_static_cast(wxStackFrame *, data); + wxStackFrame *frame = static_cast(data); // we're only interested in parameters if ( pSymInfo->Flags & IMAGEHLP_SYMBOL_INFO_PARAMETER ) diff --git a/src/msw/stattext.cpp b/src/msw/stattext.cpp index a3b52ca..c16b89c 100644 --- a/src/msw/stattext.cpp +++ b/src/msw/stattext.cpp @@ -135,7 +135,7 @@ WXDWORD wxStaticText::MSWGetStyle(long style, WXDWORD *exstyle) const wxSize wxStaticText::DoGetBestSize() const { - wxClientDC dc(wx_const_cast(wxStaticText *, this)); + wxClientDC dc(const_cast(this)); wxFont font(GetFont()); if (!font.Ok()) font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 83d1ffb..0f4ac93 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -82,7 +82,7 @@ // dummy value used for m_dropTarget, different from any valid pointer value // (which are all even under Windows) and NULL static wxDropTarget * - wxRICHTEXT_DEFAULT_DROPTARGET = wx_reinterpret_cast(wxDropTarget *, 1); + wxRICHTEXT_DEFAULT_DROPTARGET = reinterpret_cast(1); #endif // wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT diff --git a/src/msw/textentry.cpp b/src/msw/textentry.cpp index 9c5a0fc..f8b91e3 100644 --- a/src/msw/textentry.cpp +++ b/src/msw/textentry.cpp @@ -103,7 +103,7 @@ public: memcpy(olestr, wcbuf, size); - *rgelt++ = wx_static_cast(LPOLESTR, olestr); + *rgelt++ = static_cast(olestr); ++(*pceltFetched); } @@ -341,7 +341,7 @@ bool wxTextEntry::AutoComplete(const wxArrayString& choices) NULL, CLSCTX_INPROC_SERVER, IID_IAutoComplete, - wx_reinterpret_cast(void **, &pAutoComplete) + reinterpret_cast(&pAutoComplete) ); if ( FAILED(hr) ) { @@ -365,7 +365,7 @@ bool wxTextEntry::AutoComplete(const wxArrayString& choices) hr = pAutoComplete->QueryInterface ( IID_IAutoComplete2, - wx_reinterpret_cast(void **, &pAutoComplete2) + reinterpret_cast(&pAutoComplete2) ); if ( SUCCEEDED(hr) ) { diff --git a/src/msw/tglbtn.cpp b/src/msw/tglbtn.cpp index 358a3a0..1c6c6a8 100644 --- a/src/msw/tglbtn.cpp +++ b/src/msw/tglbtn.cpp @@ -101,7 +101,7 @@ WXDWORD wxToggleButton::MSWGetStyle(long style, WXDWORD *exstyle) const wxSize wxToggleButton::DoGetBestSize() const { - return wxMSWButton::ComputeBestSize(wx_const_cast(wxToggleButton *, this)); + return wxMSWButton::ComputeBestSize(const_cast(this)); } void wxToggleButton::SetLabel(const wxString& label) diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 09b7d22..bc29e61 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -1501,7 +1501,7 @@ void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(tog void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap ) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id)); + wxToolBarTool* tool = static_cast(FindById(id)); if ( tool ) { wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools.")); @@ -1513,7 +1513,7 @@ void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap ) void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap ) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id)); + wxToolBarTool* tool = static_cast(FindById(id)); if ( tool ) { wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools.")); diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 612ced8..1822254 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -1093,7 +1093,7 @@ int wxIsWindowsServer() wxZeroMemory(info); info.dwOSVersionInfoSize = sizeof(info); - if ( ::GetVersionEx(wx_reinterpret_cast(OSVERSIONINFO *, &info)) ) + if ( ::GetVersionEx(reinterpret_cast(&info)) ) { switch ( info.wProductType ) { diff --git a/src/os2/bitmap.cpp b/src/os2/bitmap.cpp index bdd712e..74db703 100644 --- a/src/os2/bitmap.cpp +++ b/src/os2/bitmap.cpp @@ -97,7 +97,7 @@ void wxBitmapRefData::Free() wxGDIRefData* wxBitmap::CloneGDIRefData(const wxGDIRefData* data) const { - return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data)); + return new wxBitmapRefData(*static_cast(data)); } // this function should be called from all wxBitmap ctors diff --git a/src/os2/font.cpp b/src/os2/font.cpp index 4a97f97..d8d7d0e 100644 --- a/src/os2/font.cpp +++ b/src/os2/font.cpp @@ -938,7 +938,7 @@ wxGDIRefData *wxFont::CreateGDIRefData() const wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data)); + return new wxFontRefData(*static_cast(data)); } bool wxFont::RealizeResource() diff --git a/src/os2/metafile.cpp b/src/os2/metafile.cpp index 2938562..65d034b 100644 --- a/src/os2/metafile.cpp +++ b/src/os2/metafile.cpp @@ -73,7 +73,7 @@ wxGDIRefData *wxMetafile::CreateGDIRefData() const wxGDIRefData *wxMetafile::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxMetafileRefData(*wx_static_cast(const wxMetafileRefData *, data)); + return new wxMetafileRefData(*static_cast(data)); } bool wxMetafile::SetClipboard(int width, int height) diff --git a/src/os2/palette.cpp b/src/os2/palette.cpp index 42454c0..55f4190 100644 --- a/src/os2/palette.cpp +++ b/src/os2/palette.cpp @@ -111,7 +111,7 @@ wxGDIRefData *wxPalette::CreateGDIRefData() const wxGDIRefData *wxPalette::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxPaletteRefData(*wx_static_cast(const wxPaletteRefData *, data)); + return new wxPaletteRefData(*static_cast(data)); } int wxPalette::GetPixel( unsigned char cRed, diff --git a/src/os2/pen.cpp b/src/os2/pen.cpp index 301c860..e0af18a 100644 --- a/src/os2/pen.cpp +++ b/src/os2/pen.cpp @@ -171,7 +171,7 @@ wxPen::wxPen( bool wxPen::operator==(const wxPen& pen) const { const wxPenRefData * - penData = wx_static_cast(const wxPenRefData *, pen.m_refData); + penData = static_cast(pen.m_refData); // an invalid pen is only equal to another invalid pen return m_refData ? penData && *M_PENDATA == *penData : !penData; @@ -408,7 +408,7 @@ wxGDIRefData* wxPen::CreateGDIRefData() const wxGDIRefData* wxPen::CloneGDIRefData(const wxGDIRefData* data) const { - return new wxPenRefData(*wx_static_cast(const wxPenRefData*, data)); + return new wxPenRefData(*static_cast(data)); } void wxPen::SetColour( const wxColour& rColour ) diff --git a/src/os2/stdpaths.cpp b/src/os2/stdpaths.cpp index 98cf196..f7ba584 100644 --- a/src/os2/stdpaths.cpp +++ b/src/os2/stdpaths.cpp @@ -54,7 +54,7 @@ wxString wxStandardPaths::GetInstallPrefix() const { if ( m_prefix.empty() ) { - wxStandardPaths *self = wx_const_cast(wxStandardPaths *, this); + wxStandardPaths *self = const_cast(this); self->m_prefix = _T("/usr/local"); } diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index 14c97c2..9f85b4d 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -1151,7 +1151,7 @@ bool wxApp::Yield(bool onlyIfNeeded) #endif // wxUSE_LOG wxEventLoop * const - loop = wx_static_cast(wxEventLoop *, wxEventLoop::GetActive()); + loop = static_cast(wxEventLoop::GetActive()); if ( loop ) { // process all pending events: diff --git a/src/osx/carbon/cursor.cpp b/src/osx/carbon/cursor.cpp index a6fd1ec..6cfcea3 100644 --- a/src/osx/carbon/cursor.cpp +++ b/src/osx/carbon/cursor.cpp @@ -69,7 +69,7 @@ protected: DECLARE_NO_ASSIGN_CLASS(wxCursorRefData) }; -#define M_CURSORDATA wx_static_cast(wxCursorRefData*, m_refData) +#define M_CURSORDATA static_cast(m_refData) #if wxOSX_USE_COCOA_OR_CARBON @@ -293,7 +293,7 @@ wxGDIRefData *wxCursor::CreateGDIRefData() const wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data)); + return new wxCursorRefData(*static_cast(data)); } bool wxCursor::CreateFromXpm(const char* const* bits) diff --git a/src/osx/carbon/dialog.cpp b/src/osx/carbon/dialog.cpp index 4779594..cbd7712 100644 --- a/src/osx/carbon/dialog.cpp +++ b/src/osx/carbon/dialog.cpp @@ -48,7 +48,7 @@ void wxDialog::DoShowModal() BeginAppModalStateForWindow(windowRef) ; wxEventLoop * const - loop = wx_static_cast(wxEventLoop *, wxEventLoop::GetActive()); + loop = static_cast(wxEventLoop::GetActive()); wxASSERT_MSG( loop , wxT("No Event Loop in place") ); diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index 11fe47b..bc6040b 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -822,7 +822,7 @@ wxGDIRefData *wxFont::CreateGDIRefData() const wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data)); + return new wxFontRefData(*static_cast(data)); } void wxFont::SetPointSize(int pointSize) diff --git a/src/osx/carbon/glcanvas.cpp b/src/osx/carbon/glcanvas.cpp index f61a03c..111e298 100644 --- a/src/osx/carbon/glcanvas.cpp +++ b/src/osx/carbon/glcanvas.cpp @@ -258,7 +258,7 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const aglSetInteger(m_glContext, AGL_BUFFER_NAME, &bufnummer); //win.SetLastContext(m_glContext); - wx_const_cast(wxGLCanvas&, win).SetViewport(); + const_cast(win).SetViewport(); if ( !aglSetDrawable(m_glContext, drawable) ) { diff --git a/src/osx/carbon/icon.cpp b/src/osx/carbon/icon.cpp index 4b0ffbe..5720f1b 100644 --- a/src/osx/carbon/icon.cpp +++ b/src/osx/carbon/icon.cpp @@ -124,7 +124,7 @@ wxGDIRefData *wxIcon::CreateGDIRefData() const wxGDIRefData *wxIcon::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxIconRefData(*wx_static_cast(const wxIconRefData *, data)); + return new wxIconRefData(*static_cast(data)); } WXHICON wxIcon::GetHICON() const diff --git a/src/osx/carbon/listctrl_mac.cpp b/src/osx/carbon/listctrl_mac.cpp index fb89dc3..655502d 100644 --- a/src/osx/carbon/listctrl_mac.cpp +++ b/src/osx/carbon/listctrl_mac.cpp @@ -3162,7 +3162,7 @@ void wxMacDataBrowserListCtrlControl::MacSetColumnInfo( unsigned int row, unsign wxASSERT_MSG( dataItem, _T("could not obtain wxMacDataItem for row in MacSetColumnInfo. Is row a valid wxListCtrl row?") ); if (item) { - wxMacListCtrlItem* listItem = wx_static_cast(wxMacListCtrlItem*,dataItem); + wxMacListCtrlItem* listItem = static_cast(dataItem); bool hasInfo = listItem->HasColumnInfo( column ); listItem->SetColumnInfo( column, item ); listItem->SetOrder(row); @@ -3205,7 +3205,7 @@ void wxMacDataBrowserListCtrlControl::MacGetColumnInfo( unsigned int row, unsign // CS should this guard against dataItem = 0 ? , as item is not a pointer if (item) is not appropriate //if (item) { - wxMacListCtrlItem* listItem =wx_static_cast(wxMacListCtrlItem*,dataItem); + wxMacListCtrlItem* listItem = static_cast(dataItem); if (!listItem->HasColumnInfo( column )) return; diff --git a/src/osx/carbon/metafile.cpp b/src/osx/carbon/metafile.cpp index a671b77..0c93600 100644 --- a/src/osx/carbon/metafile.cpp +++ b/src/osx/carbon/metafile.cpp @@ -156,8 +156,8 @@ void wxMetafileRefData::UpdateDocumentFromData() { CGPDFPageRef page = CGPDFDocumentGetPage( m_pdfDoc, 1 ); CGRect rect = CGPDFPageGetBoxRect ( page, kCGPDFMediaBox); - m_width = wx_static_cast(int, rect.size.width); - m_height = wx_static_cast(int, rect.size.height); + m_width = static_cast(rect.size.width); + m_height = static_cast(rect.size.height); } } @@ -177,7 +177,7 @@ wxGDIRefData *wxMetaFile::CreateGDIRefData() const wxGDIRefData *wxMetaFile::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxMetafileRefData(*wx_static_cast(const wxMetafileRefData *, data)); + return new wxMetafileRefData(*static_cast(data)); } WXHMETAFILE wxMetaFile::GetHMETAFILE() const @@ -227,8 +227,8 @@ void wxMetafile::SetPICT(void* pictHandle) wxCFRef provider(wxMacCGDataProviderCreateWithCFData(data)); QDPictRef pictRef = QDPictCreateWithProvider(provider); CGRect rect = QDPictGetBounds(pictRef); - m_refData = new wxMetafileRefData(wx_static_cast(int, rect.size.width), - wx_static_cast(int, rect.size.height)); + m_refData = new wxMetafileRefData(static_cast(rect.size.width), + static_cast(rect.size.height)); QDPictDrawToCGContext( ((wxMetafileRefData*) m_refData)->GetContext(), rect, pictRef ); CFRelease( data ); QDPictRelease( pictRef ); diff --git a/src/osx/carbon/region.cpp b/src/osx/carbon/region.cpp index e645ea9..eae2dd8 100644 --- a/src/osx/carbon/region.cpp +++ b/src/osx/carbon/region.cpp @@ -167,7 +167,7 @@ wxGDIRefData *wxRegion::CreateGDIRefData() const wxGDIRefData *wxRegion::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxRegionRefData(*wx_static_cast(const wxRegionRefData *, data)); + return new wxRegionRefData(*static_cast(data)); } //----------------------------------------------------------------------------- @@ -262,10 +262,10 @@ bool wxRegion::DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const { CGRect box ; HIShapeGetBounds( M_REGION , &box ) ; - x = wx_static_cast(int, box.origin.x); - y = wx_static_cast(int, box.origin.y); - w = wx_static_cast(int, box.size.width); - h = wx_static_cast(int, box.size.height); + x = static_cast(box.origin.x); + y = static_cast(box.origin.y); + w = static_cast(box.size.width); + h = static_cast(box.size.height); return true; } diff --git a/src/osx/carbon/textctrl.cpp b/src/osx/carbon/textctrl.cpp index 8ae1c6b..fc308b6 100644 --- a/src/osx/carbon/textctrl.cpp +++ b/src/osx/carbon/textctrl.cpp @@ -950,7 +950,7 @@ void wxMacMLTEControl::SetBackgroundColour(const wxColour& col ) static inline int wxConvertToTXN(int x) { - return wx_static_cast(int, x / 254.0 * 72 + 0.5); + return static_cast(x / 254.0 * 72 + 0.5); } void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , long to ) diff --git a/src/osx/carbon/toolbar.cpp b/src/osx/carbon/toolbar.cpp index f1ff79c..71f3a57 100644 --- a/src/osx/carbon/toolbar.cpp +++ b/src/osx/carbon/toolbar.cpp @@ -1447,7 +1447,7 @@ void wxToolBar::MacSuperChangedPosition() void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap ) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id)); + wxToolBarTool* tool = static_cast(FindById(id)); if ( tool ) { wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools.")); @@ -1461,7 +1461,7 @@ void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap ) void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap ) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id)); + wxToolBarTool* tool = static_cast(FindById(id)); if ( tool ) { wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools.")); @@ -1513,7 +1513,7 @@ void wxToolBar::DoToggleTool(wxToolBarToolBase *t, bool toggle) bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase) { - wxToolBarTool *tool = wx_static_cast( wxToolBarTool*, toolBase ); + wxToolBarTool *tool = static_cast< wxToolBarTool*>(toolBase ); if (tool == NULL) return false; @@ -1697,7 +1697,7 @@ void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(tog bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolbase) { - wxToolBarTool* tool = wx_static_cast( wxToolBarTool*, toolbase ); + wxToolBarTool* tool = static_cast< wxToolBarTool*>(toolbase ); wxToolBarToolsList::compatibility_iterator node; for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) { diff --git a/src/osx/carbon/utils.cpp b/src/osx/carbon/utils.cpp index e225698..1a5c28d 100644 --- a/src/osx/carbon/utils.cpp +++ b/src/osx/carbon/utils.cpp @@ -679,11 +679,10 @@ bool wxMacDataItem::IsLessThan(wxMacDataItemBrowserControl *WXUNUSED(owner) , const wxMacDataItem* rhs, DataBrowserPropertyID sortProperty) const { - const wxMacDataItem* otherItem = wx_const_cast(wxMacDataItem*,rhs); bool retval = false; if ( sortProperty == kNumericOrderColumnId ) - retval = m_order < otherItem->m_order; + retval = m_order < rhs->m_order; return retval; } diff --git a/src/osx/carbon/window.cpp b/src/osx/carbon/window.cpp index 39ed9fe..1f760a8 100644 --- a/src/osx/carbon/window.cpp +++ b/src/osx/carbon/window.cpp @@ -287,7 +287,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl thisWindow->GetCaret()->OnKillFocus(); #endif - wxLogTrace(_T("Focus"), _T("focus lost(%p)"), wx_static_cast(void*, thisWindow)); + wxLogTrace(_T("Focus"), _T("focus lost(%p)"), static_cast(thisWindow)); // remove this as soon as posting the synthesized event works properly static bool inKillFocusEvent = false ; @@ -307,7 +307,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl { // set focus // panel wants to track the window which was the last to have focus in it - wxLogTrace(_T("Focus"), _T("focus set(%p)"), wx_static_cast(void*, thisWindow)); + wxLogTrace(_T("Focus"), _T("focus set(%p)"), static_cast(thisWindow)); wxChildFocusEvent eventFocus((wxWindow*)thisWindow); thisWindow->HandleWindowEvent(eventFocus); @@ -335,12 +335,12 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl if ( controlPart != kControlFocusNoPart ) { targetFocusWindow = thisWindow; - wxLogTrace(_T("Focus"), _T("focus to be set(%p)"), wx_static_cast(void*, thisWindow)); + wxLogTrace(_T("Focus"), _T("focus to be set(%p)"), static_cast(thisWindow)); } else { formerFocusWindow = thisWindow; - wxLogTrace(_T("Focus"), _T("focus to be lost(%p)"), wx_static_cast(void*, thisWindow)); + wxLogTrace(_T("Focus"), _T("focus to be lost(%p)"), static_cast(thisWindow)); } ControlPartCode previousControlPart = 0; @@ -393,7 +393,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl thisWindow->GetCaret()->OnKillFocus(); #endif - wxLogTrace(_T("Focus"), _T("focus lost(%p)"), wx_static_cast(void*, thisWindow)); + wxLogTrace(_T("Focus"), _T("focus lost(%p)"), static_cast(thisWindow)); static bool inKillFocusEvent = false ; @@ -409,7 +409,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl else { // panel wants to track the window which was the last to have focus in it - wxLogTrace(_T("Focus"), _T("focus set(%p)"), wx_static_cast(void*, thisWindow)); + wxLogTrace(_T("Focus"), _T("focus set(%p)"), static_cast(thisWindow)); wxChildFocusEvent eventFocus((wxWindow*)thisWindow); thisWindow->HandleWindowEvent(eventFocus); diff --git a/src/osx/cocoa/toolbar.mm b/src/osx/cocoa/toolbar.mm index a5e2638..320f101 100644 --- a/src/osx/cocoa/toolbar.mm +++ b/src/osx/cocoa/toolbar.mm @@ -1104,7 +1104,7 @@ void wxToolBar::MacSuperChangedPosition() void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap ) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id)); + wxToolBarTool* tool = static_cast(FindById(id)); if ( tool ) { wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools.")); @@ -1118,7 +1118,7 @@ void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap ) void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmap& bitmap ) { - wxToolBarTool* tool = wx_static_cast(wxToolBarTool*, FindById(id)); + wxToolBarTool* tool = static_cast(FindById(id)); if ( tool ) { wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools.")); @@ -1173,7 +1173,7 @@ void wxToolBar::DoToggleTool(wxToolBarToolBase *t, bool toggle) bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase) { - wxToolBarTool *tool = wx_static_cast( wxToolBarTool*, toolBase ); + wxToolBarTool *tool = static_cast< wxToolBarTool*>(toolBase ); if (tool == NULL) return false; @@ -1305,7 +1305,7 @@ void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(tog bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolbase) { - wxToolBarTool* tool = wx_static_cast( wxToolBarTool*, toolbase ); + wxToolBarTool* tool = static_cast< wxToolBarTool*>(toolbase ); wxToolBarToolsList::compatibility_iterator node; for ( node = m_tools.GetFirst(); node; node = node->GetNext() ) { diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index 83e6b6c..563eaf5 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -974,7 +974,7 @@ wxGDIRefData* wxBitmap::CreateGDIRefData() const wxGDIRefData* wxBitmap::CloneGDIRefData(const wxGDIRefData* data) const { - return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data)); + return new wxBitmapRefData(*static_cast(data)); } void * wxBitmap::GetRawAccess() const diff --git a/src/osx/core/gsockosx.cpp b/src/osx/core/gsockosx.cpp index 000252b..5c5660f 100644 --- a/src/osx/core/gsockosx.cpp +++ b/src/osx/core/gsockosx.cpp @@ -99,9 +99,9 @@ private: const void* data, void* info) { - GSocket * const socket = wx_static_cast(GSocket *, info); + GSocket * const socket = static_cast(info); MacGSocketData * const - macdata = wx_static_cast(MacGSocketData *, socket->m_gui_dependent); + macdata = static_cast(socket->m_gui_dependent); if ( !macdata ) return; @@ -167,7 +167,7 @@ private: // may return NULL if we hadn't created the data for this socket yet MacGSocketData *GetData(GSocket *socket) const { - return wx_static_cast(MacGSocketData *, socket->m_gui_dependent); + return static_cast(socket->m_gui_dependent); } // return the custom data pointer initializing it if it hadn't been done diff --git a/src/osx/imaglist.cpp b/src/osx/imaglist.cpp index 9bd7720..7c16b41 100644 --- a/src/osx/imaglist.cpp +++ b/src/osx/imaglist.cpp @@ -133,9 +133,9 @@ wxBitmap wxImageList::GetBitmap(int index) const if ( obj == NULL ) return wxNullBitmap ; else if ( obj->IsKindOf(CLASSINFO(wxIcon)) ) - return wxBitmap( *(wx_static_cast(wxIcon*, obj)) ) ; + return wxBitmap( *(static_cast(obj)) ) ; else - return *(wx_static_cast(wxBitmap*, obj)) ; + return *(static_cast(obj)) ; } // Get the icon @@ -154,7 +154,7 @@ wxIcon wxImageList::GetIcon(int index) const return wxNullIcon ; } else - return *(wx_static_cast(wxIcon*, obj)) ; + return *(static_cast(obj)) ; } bool wxImageList::Replace( int index, const wxBitmap &bitmap ) @@ -269,13 +269,13 @@ bool wxImageList::GetSize( int index, int &width, int &height ) const wxObject *obj = (wxObject*)node->GetData(); if (obj->IsKindOf(CLASSINFO(wxIcon))) { - wxIcon *bm = wx_static_cast( wxIcon* , obj ) ; + wxIcon *bm = static_cast< wxIcon* >(obj ) ; width = bm->GetWidth(); height = bm->GetHeight(); } else { - wxBitmap *bm = wx_static_cast( wxBitmap* , obj ) ; + wxBitmap *bm = static_cast< wxBitmap* >(obj ) ; width = bm->GetWidth(); height = bm->GetHeight(); } @@ -294,12 +294,12 @@ bool wxImageList::Draw( wxObject *obj = (wxObject*)node->GetData(); if (obj->IsKindOf(CLASSINFO(wxIcon))) { - wxIcon *bm = wx_static_cast( wxIcon* , obj ) ; + wxIcon *bm = static_cast< wxIcon* >(obj ) ; dc.DrawIcon( *bm , x, y ); } else { - wxBitmap *bm = wx_static_cast( wxBitmap* , obj ) ; + wxBitmap *bm = static_cast< wxBitmap* >(obj ) ; dc.DrawBitmap( *bm, x, y, (flags & wxIMAGELIST_DRAW_TRANSPARENT) > 0 ); } diff --git a/src/osx/palette.cpp b/src/osx/palette.cpp index c92d1da..3c1a22c 100644 --- a/src/osx/palette.cpp +++ b/src/osx/palette.cpp @@ -149,7 +149,7 @@ wxGDIRefData *wxPalette::CreateGDIRefData() const wxGDIRefData *wxPalette::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxPaletteRefData(*wx_static_cast(const wxPaletteRefData *, data)); + return new wxPaletteRefData(*static_cast(data)); } #endif // wxUSE_PALETTE diff --git a/src/osx/pen.cpp b/src/osx/pen.cpp index e902ada..55f5f0c 100644 --- a/src/osx/pen.cpp +++ b/src/osx/pen.cpp @@ -151,7 +151,7 @@ wxGDIRefData *wxPen::CreateGDIRefData() const wxGDIRefData *wxPen::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxPenRefData(*wx_static_cast(const wxPenRefData *, data)); + return new wxPenRefData(*static_cast(data)); } bool wxPen::operator==(const wxPen& pen) const diff --git a/src/palmos/font.cpp b/src/palmos/font.cpp index 305441e..5c79e75 100644 --- a/src/palmos/font.cpp +++ b/src/palmos/font.cpp @@ -405,7 +405,7 @@ wxGDIRefData *wxFont::CreateGDIRefData() const wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data)); + return new wxFontRefData(*static_cast(data)); } bool wxFont::RealizeResource() diff --git a/src/palmos/main.cpp b/src/palmos/main.cpp index b79eb05..7268bcc 100644 --- a/src/palmos/main.cpp +++ b/src/palmos/main.cpp @@ -52,7 +52,7 @@ int wxEntry() // argv[] must be NULL-terminated argv[argc] = NULL; - return wxEntry(wx_const_cast(int, argc), argv); + return wxEntry(const_cast(argc), argv); } #endif // wxUSE_GUI diff --git a/src/palmos/pen.cpp b/src/palmos/pen.cpp index 65bdffb..c9db991 100644 --- a/src/palmos/pen.cpp +++ b/src/palmos/pen.cpp @@ -119,6 +119,6 @@ wxGDIRefData *wxPen::CreateGDIRefData() const wxGDIRefData *wxPen::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxPenRefData(*wx_static_cast(const wxPenRefData *, data)); + return new wxPenRefData(*static_cast(data)); } diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp index de3a03b..23d2885 100644 --- a/src/unix/displayx11.cpp +++ b/src/unix/displayx11.cpp @@ -71,7 +71,7 @@ public: operator const XineramaScreenInfo *() const { return m_screens; } - unsigned GetCount() const { return wx_static_cast(unsigned, m_num); } + unsigned GetCount() const { return static_cast(m_num); } private: XineramaScreenInfo *m_screens; diff --git a/src/unix/stdpaths.cpp b/src/unix/stdpaths.cpp index 1c4bacc..3749968 100644 --- a/src/unix/stdpaths.cpp +++ b/src/unix/stdpaths.cpp @@ -66,7 +66,7 @@ wxString wxStandardPaths::GetInstallPrefix() const { if ( m_prefix.empty() ) { - wx_const_cast(wxStandardPaths *, this)->m_prefix = wxT("/sys$system"); + const_cast(this)->m_prefix = wxT("/sys$system"); } return m_prefix; @@ -173,7 +173,7 @@ wxString wxStandardPaths::GetInstallPrefix() const { if ( m_prefix.empty() ) { - wxStandardPaths *pathPtr = wx_const_cast(wxStandardPaths *, this); + wxStandardPaths *pathPtr = const_cast(this); pathPtr->DetectPrefix(); } diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index 7306e90..5f9df2b 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -439,7 +439,7 @@ wxGDIRefData *wxBitmap::CreateGDIRefData() const wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxBitmapRefData(*wx_static_cast(const wxBitmapRefData *, data)); + return new wxBitmapRefData(*static_cast(data)); } bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) diff --git a/src/x11/cursor.cpp b/src/x11/cursor.cpp index 354e8dc..7eaa5e6 100644 --- a/src/x11/cursor.cpp +++ b/src/x11/cursor.cpp @@ -149,7 +149,7 @@ wxGDIRefData *wxCursor::CreateGDIRefData() const wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxCursorRefData(*wx_static_cast(const wxCursorRefData *, data)); + return new wxCursorRefData(*static_cast(data)); } WXCursor wxCursor::GetCursor() const diff --git a/src/x11/font.cpp b/src/x11/font.cpp index 0855e06..7d035d8 100644 --- a/src/x11/font.cpp +++ b/src/x11/font.cpp @@ -693,7 +693,7 @@ wxGDIRefData *wxFont::CreateGDIRefData() const wxGDIRefData *wxFont::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxFontRefData(*wx_static_cast(const wxFontRefData *, data)); + return new wxFontRefData(*static_cast(data)); } // ---------------------------------------------------------------------------- diff --git a/src/x11/glcanvas.cpp b/src/x11/glcanvas.cpp index acc3134..2689a7a 100644 --- a/src/x11/glcanvas.cpp +++ b/src/x11/glcanvas.cpp @@ -84,7 +84,7 @@ Window wxGLCanvas::GetXWindow() const int wxGLCanvas::GetColourIndex(const wxColour& col_) { - wxColour& col = wx_const_cast(wxColour&, col_); + wxColour& col = const_cast(col_); #ifdef __WXMOTIF__ col.AllocColour(GetXDisplay()); diff --git a/src/x11/palette.cpp b/src/x11/palette.cpp index 79f2767..8062102 100644 --- a/src/x11/palette.cpp +++ b/src/x11/palette.cpp @@ -177,7 +177,7 @@ wxGDIRefData *wxPalette::CreateGDIRefData() const wxGDIRefData *wxPalette::CloneGDIRefData(const wxGDIRefData *data) const { - return new wxPaletteRefData(*wx_static_cast(const wxPaletteRefData *, data)); + return new wxPaletteRefData(*static_cast(data)); } int wxPalette::GetPixel(unsigned char WXUNUSED(red), -- 2.7.4