X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..f9007c324c9b4f6288156dcf0b865090ee0c0c38:/src/common/string.cpp?ds=sidebyside diff --git a/src/common/string.cpp b/src/common/string.cpp index b120724457..9f97667da3 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -6,7 +6,7 @@ // Created: 29/01/98 // RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -160,6 +160,18 @@ wxSTD ostream& operator<<(wxSTD ostream& os, const wxString& str) #define STATISTICS_ADD(av, val) #endif // WXSTRING_STATISTICS +// =========================================================================== +// wxStringData class deallocation +// =========================================================================== + +#if defined(__VISUALC__) && defined(_MT) && !defined(_DLL) +# pragma message (__FILE__ ": building with Multithreaded non DLL runtime has a performance impact on wxString!") +void wxStringData::Free() +{ + free(this); +} +#endif + // =========================================================================== // wxString class core // =========================================================================== @@ -255,6 +267,7 @@ wxString::wxString(const char *psz, wxMBConv& conv, size_t nLength) if ( conv.MB2WC(m_pchData, psz, nLen + 1) != (size_t)-1 ) { // initialized ok + m_pchData[nLen] = 0; return; } //else: the conversion failed -- leave the string empty (what else?) @@ -608,7 +621,7 @@ wxString& wxString::operator=(const wchar_t *pwz) // --------------------------------------------------------------------------- // add something to this string -bool wxString::ConcatSelf(int nSrcLen, const wxChar *pszSrcData) +bool wxString::ConcatSelf(size_t nSrcLen, const wxChar *pszSrcData) { STATISTICS_ADD(SummandLength, nSrcLen); @@ -761,7 +774,7 @@ wxString wxString::FromAscii(const char ascii) wxString res; res += (wchar_t)(unsigned char) ascii; - + return res; } @@ -2091,7 +2104,7 @@ static wxArrayString::CompareFunction gs_compareFunction = NULL; static bool gs_sortAscending = TRUE; // function which is called by quick sort -extern "C" int LINKAGEMODE +extern "C" int wxC_CALLING_CONV // LINKAGEMODE wxStringCompareFunction(const void *first, const void *second) { wxString *strFirst = (wxString *)first;