From: Julian Smart Date: Thu, 11 Dec 2003 10:54:38 +0000 (+0000) Subject: Applied patch [ 857446 ] wxStaticCast evaluates argument twice X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e32d4836066565f3eaba7b8fc3f73080e9f26622?ds=inline Applied patch [ 857446 ] wxStaticCast evaluates argument twice git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/object.h b/include/wx/object.h index e4faf7a05b..bc0824541b 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -348,12 +348,13 @@ name##PluginSentinel m_pluginsentinel; #ifdef __WXDEBUG__ -inline void wxCheckCast(void *ptr) +inline void* wxCheckCast(void *ptr) { wxASSERT_MSG( ptr, _T("wxStaticCast() used incorrectly") ); + return ptr; } #define wxStaticCast(obj, className) \ - (wxCheckCast(wxDynamicCast(obj, className)), ((className *)(obj))) + ((className *)wxCheckCast(wxDynamicCast(obj, className))) #else // !__WXDEBUG__ #define wxStaticCast(obj, className) ((className *)(obj))