From 9de49b112f4d1c87f818ab9c62331dbb81f23937 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 19 Mar 2012 12:53:21 +0000 Subject: [PATCH] Explicitly cast size_t to int to suppress MSVC warnings. Implicit size_t-to-int conversions provoke warnings when building 64 bit version (in which sizeof(size_t) > sizeof(int)) with MSVC, so make them explicit as the size_t values used here will always fit in int range. Closes #14113. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/grid.h | 2 +- include/wx/headerctrl.h | 5 ++++- include/wx/propgrid/props.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 481a081a94..4f59d26784 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -811,7 +811,7 @@ public: // these are pure virtual in wxGridTableBase // - virtual int GetNumberRows() { return m_data.size(); } + virtual int GetNumberRows() { return static_cast(m_data.size()); } virtual int GetNumberCols() { return m_numCols; } virtual wxString GetValue( int row, int col ); virtual void SetValue( int row, int col, const wxString& s ); diff --git a/include/wx/headerctrl.h b/include/wx/headerctrl.h index 9555e26155..08940d5b21 100644 --- a/include/wx/headerctrl.h +++ b/include/wx/headerctrl.h @@ -352,7 +352,10 @@ private: void Init(); // bring the column count in sync with the number of columns we store - void UpdateColumnCount() { SetColumnCount(m_cols.size()); } + void UpdateColumnCount() + { + SetColumnCount(static_cast(m_cols.size())); + } // all our current columns diff --git a/include/wx/propgrid/props.h b/include/wx/propgrid/props.h index 66d625a24d..5d5528e44a 100644 --- a/include/wx/propgrid/props.h +++ b/include/wx/propgrid/props.h @@ -564,7 +564,7 @@ public: // helpers size_t GetItemCount() const { return m_choices.GetCount(); } const wxString& GetLabel( size_t ind ) const - { return m_choices.GetLabel(ind); } + { return m_choices.GetLabel(static_cast(ind)); } protected: // Used to detect if choices have been changed