From dfb60af47f0158569fbd1448686d270ea163c083 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 23 Sep 2015 00:24:29 +0200 Subject: [PATCH] Disable check in wxLongLong::ToLong() for LP64 platforms The check is redundant there as conversion can never fail and just results in warnings from static code analyzers. --- include/wx/longlong.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/wx/longlong.h b/include/wx/longlong.h index 9589c9d638..88d3f72ebf 100644 --- a/include/wx/longlong.h +++ b/include/wx/longlong.h @@ -175,8 +175,12 @@ public: // convert to long with range checking in debug mode (only!) long ToLong() const { + // This assert is useless if long long is the same as long (which is + // the case under the standard Unix LP64 model). +#ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG wxASSERT_MSG( (m_ll >= LONG_MIN) && (m_ll <= LONG_MAX), wxT("wxLongLong to long conversion loss of precision") ); +#endif return wx_truncate_cast(long, m_ll); }