X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d93f63db9d836a7d303343e60fb034dc9a1360d0..d1427b705318677afe28b1291867f6930c8823a7:/src/common/string.cpp?ds=inline diff --git a/src/common/string.cpp b/src/common/string.cpp index 7e6e2270d7..1273610fb6 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -34,6 +34,7 @@ #ifndef WX_PRECOMP #include "wx/defs.h" #include "wx/string.h" +#include #endif #include @@ -46,7 +47,8 @@ // allocating extra space for each string consumes more memory but speeds up // the concatenation operations (nLen is the current string's length) -#define EXTRA_ALLOC 16 +// NB: EXTRA_ALLOC must be >= 0! +#define EXTRA_ALLOC (19 - nLen % 16) // --------------------------------------------------------------------------- // static class variables definition @@ -1230,7 +1232,7 @@ void wxArrayString::Insert(const wxString& str, size_t nIndex) { wxASSERT( str.GetStringData()->IsValid() ); - wxCHECK_RET( nIndex <= m_nCount, "bad index in wxArrayString::Insert" ); + wxCHECK_RET( nIndex <= m_nCount, ("bad index in wxArrayString::Insert") ); Grow(); @@ -1246,7 +1248,7 @@ void wxArrayString::Insert(const wxString& str, size_t nIndex) // removes item from array (by index) void wxArrayString::Remove(size_t nIndex) { - wxCHECK_RET( nIndex <= m_nCount, "bad index in wxArrayString::Remove" ); + wxCHECK_RET( nIndex <= m_nCount, _("bad index in wxArrayString::Remove") ); // release our lock Item(nIndex).GetStringData()->Unlock(); @@ -1262,7 +1264,7 @@ void wxArrayString::Remove(const char *sz) int iIndex = Index(sz); wxCHECK_RET( iIndex != NOT_FOUND, - "removing inexistent element in wxArrayString::Remove" ); + _("removing inexistent element in wxArrayString::Remove") ); Remove((size_t)iIndex); }