]> git.saurik.com Git - wxWidgets.git/commitdiff
Explicitly cast size_t to int to suppress MSVC warnings.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 19 Mar 2012 12:53:21 +0000 (12:53 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 19 Mar 2012 12:53:21 +0000 (12:53 +0000)
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
include/wx/headerctrl.h
include/wx/propgrid/props.h

index 481a081a94a1aa711aa896987257cf50ad42aacf..4f59d2678448d609d8e13070dfc8fa44a109e2e7 100644 (file)
@@ -811,7 +811,7 @@ public:
 
     // these are pure virtual in wxGridTableBase
     //
-    virtual int GetNumberRows() { return m_data.size(); }
+    virtual int GetNumberRows() { return static_cast<int>(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 );
index 9555e26155dd5ee2acf846e31389101d7f2d3a13..08940d5b21170af70ccf791fcbdb70101962e727 100644 (file)
@@ -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<int>(m_cols.size()));
+    }
 
 
     // all our current columns
index 66d625a24d3b6ee009dc9979c7bc2abc391675cb..5d5528e44ad81fae256b9963116feaef392e3934 100644 (file)
@@ -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<int>(ind)); }
 
 protected:
     // Used to detect if choices have been changed