X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c67202dee33f95fa48b176dec8994340c70eaa2..a2053b27b318fe81918a72c838944d1e8cd1524f:/include/wx/dynarray.h diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index ff8c4e7356..4d87b0bed1 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -162,6 +162,9 @@ private: // types of sizeof()<=sizeof(long) or pointers if sizeof(pointer)<=sizeof(long) // // NB: it has only inline functions => takes no space at all +// Mod by JACS: Salford C++ doesn't like 'var->operator=' syntax, as in: +// { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); +// so using a temporary variable instead. // ---------------------------------------------------------------------------- #define _WX_DEFINE_ARRAY(T, name) \ typedef int (CMPFUNC_CONV *CMPFUNC##T)(T *pItem1, T *pItem2); \ @@ -172,7 +175,8 @@ public: \ { wxASSERT( sizeof(T) <= sizeof(long) ); } \ \ name& operator=(const name& src) \ - { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); \ + { wxBaseArray* temp = (wxBaseArray*) this; \ + (*temp) = ((const wxBaseArray&)src); \ return *this; } \ \ T& operator[](size_t uiIndex) const \ @@ -193,9 +197,9 @@ public: \ void Remove(size_t uiIndex) { wxBaseArray::Remove(uiIndex); } \ void Remove(T Item) \ { int iIndex = Index(Item); \ - wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ - "removing inexisting element in wxArray::Remove" ); \ - wxBaseArray::Remove((size_t)iIndex); } \ + wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ + _T("removing inexisting element in wxArray::Remove") ); \ + wxBaseArray::Remove((size_t)iIndex); } \ \ void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \ } @@ -216,6 +220,9 @@ public: \ // the normal arrays otherwise. // // NB: it has only inline functions => takes no space at all +// Mod by JACS: Salford C++ doesn't like 'var->operator=' syntax, as in: +// { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); +// so using a temporary variable instead. // ---------------------------------------------------------------------------- #define _WX_DEFINE_SORTED_ARRAY(T, name) \ typedef int (CMPFUNC_CONV *SCMPFUNC##T)(T pItem1, T pItem2); \ @@ -226,7 +233,8 @@ public: \ { wxASSERT( sizeof(T) <= sizeof(long) ); m_fnCompare = fn; } \ \ name& operator=(const name& src) \ - { ((wxBaseArray *)this)->operator=((const wxBaseArray&)src); \ + { wxBaseArray* temp = (wxBaseArray*) this; \ + (*temp) = ((const wxBaseArray&)src); \ m_fnCompare = src.m_fnCompare; \ return *this; } \ \ @@ -246,8 +254,8 @@ public: \ void Remove(size_t uiIndex) { wxBaseArray::Remove(uiIndex); } \ void Remove(T Item) \ { int iIndex = Index(Item); \ - wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ - "removing inexisting element in wxArray::Remove" ); \ + wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ + _T("removing inexisting element in wxArray::Remove") ); \ wxBaseArray::Remove((size_t)iIndex); } \ \ private: \