X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/78e6050be8686ba15a6969aedf434a18f59cc6ee..42497f30ebde52ebd530a3c252eec45791669287:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index 8415f0c3f3..9a0cff0e00 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -100,6 +100,8 @@ extern const wxChar WXDLLIMPEXP_BASE *wxEmptyString = &g_strEmpty.dummy; // // ATTN: you can _not_ use both of these in the same program! +#include + wxSTD istream& operator>>(wxSTD istream& is, wxString& WXUNUSED(str)) { #if 0 @@ -168,6 +170,8 @@ wxSTD ostream& operator<<(wxSTD ostream& os, const wxString& str) #define STATISTICS_ADD(av, val) #endif // WXSTRING_STATISTICS +#if !wxUSE_STL + // =========================================================================== // wxStringData class deallocation // =========================================================================== @@ -180,8 +184,6 @@ void wxStringData::Free() } #endif -#if !wxUSE_STL - // =========================================================================== // wxStringBase // =========================================================================== @@ -1685,7 +1687,10 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) buf[size] = _T('\0'); } - if ( len >= 0 ) + // vsnprintf() may return either -1 (traditional Unix behaviour) or the + // total number of characters which would have been written if the + // buffer were large enough + if ( len >= 0 && len <= size ) { // ok, there was enough space break; @@ -2322,12 +2327,12 @@ bool wxArrayString::operator==(const wxArrayString& a) const #endif // !wxUSE_STL -int wxStringSortAscending(wxString* s1, wxString* s2) +int wxCMPFUNC_CONV wxStringSortAscending(wxString* s1, wxString* s2) { return wxStrcmp(s1->c_str(), s2->c_str()); } -int wxStringSortDescending(wxString* s1, wxString* s2) +int wxCMPFUNC_CONV wxStringSortDescending(wxString* s1, wxString* s2) { return -wxStrcmp(s1->c_str(), s2->c_str()); }