X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2d615fe9336b30558216af831eb52b598af336c9..b5ec7dd6eebda65b5f430cebf2f92eaddc4f7c9e:/include/wx/vector.h diff --git a/include/wx/vector.h b/include/wx/vector.h index 1132087a5e..6fc0be174a 100644 --- a/include/wx/vector.h +++ b/include/wx/vector.h @@ -59,9 +59,12 @@ public: // increase the size twice, unless we're already too big or unless // more is requested - const size_type increment = (m_size > 0) - ? wxMin(m_size, ALLOC_MAX_SIZE) - : ALLOC_INITIAL_SIZE; + // + // NB: casts to size_t are needed to suppress mingw32 warnings about + // mixing enums and ints in the same expression + const size_type increment = m_size > 0 + ? wxMin(m_size, (size_type)ALLOC_MAX_SIZE) + : (size_type)ALLOC_INITIAL_SIZE; if ( m_capacity + increment > n ) n = m_capacity + increment; @@ -170,8 +173,8 @@ public: *(i - count) = *i; // erase items behind the new end of m_values: - for ( iterator i = end() - count; i < end(); ++i ) - *i = value_type(); + for ( iterator j = end() - count; j < end(); ++j ) + *j = value_type(); m_size -= count; @@ -183,8 +186,9 @@ public: #endif // WXWIN_COMPATIBILITY_2_8 private: - static const size_type ALLOC_INITIAL_SIZE = 16; - static const size_type ALLOC_MAX_SIZE = 4096; + // VC6 can't compile static const int members + enum { ALLOC_INITIAL_SIZE = 16 }; + enum { ALLOC_MAX_SIZE = 4096 }; void Copy(const wxVector& vb) {