From 1e35c3b91551582c8fb65f3905535c4123926535 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Wed, 16 Oct 2013 16:45:53 +0000 Subject: [PATCH] Silence warnings in headers with MSC -W4 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75014 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 4 +++- include/wx/strvararg.h | 2 +- include/wx/unichar.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 00c6427636..203e0f77eb 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -310,8 +310,10 @@ typedef short int WXTYPE; inline T wx_truncate_cast_impl(X x) { #pragma warning(push) - /* conversion from 'X' to 'T', possible loss of data */ + /* conversion from 'size_t' to 'type', possible loss of data */ #pragma warning(disable: 4267) + /* conversion from 'type1' to 'type2', possible loss of data */ + #pragma warning(disable: 4242) return x; diff --git a/include/wx/strvararg.h b/include/wx/strvararg.h index dc566e9443..6562ee3150 100644 --- a/include/wx/strvararg.h +++ b/include/wx/strvararg.h @@ -748,7 +748,7 @@ struct wxArgNormalizer : public wxArgNormalizer { wxArgNormalizer(const wxUniChar& s, const wxFormatString *fmt, unsigned index) - : wxArgNormalizer(s.GetValue(), fmt, index) {} + : wxArgNormalizer(wx_truncate_cast(wchar_t, s.GetValue()), fmt, index) {} }; // for wchar_t, default handler does the right thing diff --git a/include/wx/unichar.h b/include/wx/unichar.h index a661e5a4e2..e9726943ab 100644 --- a/include/wx/unichar.h +++ b/include/wx/unichar.h @@ -161,7 +161,7 @@ private: return ToHi8bit(c); #else - return c; + return wx_truncate_cast(char, c); #endif }