use static_cast<> for wxStaticCast; updated comment in front of wxDynamicCast()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -304,7 +304,11 @@ name##PluginSentinel m_pluginsentinel;
|
|||||||
// Just seems a bit nicer-looking (pretend it's not a macro)
|
// Just seems a bit nicer-looking (pretend it's not a macro)
|
||||||
#define wxIsKindOf(obj, className) obj->IsKindOf(&className::ms_classInfo)
|
#define wxIsKindOf(obj, className) obj->IsKindOf(&className::ms_classInfo)
|
||||||
|
|
||||||
// to be replaced by dynamic_cast<> in the future
|
// this cast does some more checks at compile time as it uses static_cast
|
||||||
|
// internally
|
||||||
|
//
|
||||||
|
// note that it still has different semantics from dynamic_cast<> and so can't
|
||||||
|
// be replaced by it as long as there are any compilers not supporting it
|
||||||
#define wxDynamicCast(obj, className) \
|
#define wxDynamicCast(obj, className) \
|
||||||
((className *) wxCheckDynamicCast( \
|
((className *) wxCheckDynamicCast( \
|
||||||
wx_const_cast(wxObject *, wx_static_cast(const wxObject *, \
|
wx_const_cast(wxObject *, wx_static_cast(const wxObject *, \
|
||||||
@@ -326,7 +330,7 @@ inline void* wxCheckCast(void *ptr)
|
|||||||
((className *)wxCheckCast(wxDynamicCast(obj, className)))
|
((className *)wxCheckCast(wxDynamicCast(obj, className)))
|
||||||
|
|
||||||
#else // !__WXDEBUG__
|
#else // !__WXDEBUG__
|
||||||
#define wxStaticCast(obj, className) ((className *)(obj))
|
#define wxStaticCast(obj, className) wx_static_cast(className *, obj)
|
||||||
|
|
||||||
#endif // __WXDEBUG__
|
#endif // __WXDEBUG__
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user