wxArray<T> macros have been changed to fix runtime problems under 64 bit
architectures. The base class is now implemented once for each needed primitive type in order to avoid invalid reference casts. Macros are provided to implement new arrays using these primitive base arrays. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -60,16 +60,16 @@ name::name(const name& src) \
|
||||
void name::DoEmpty() \
|
||||
{ \
|
||||
for ( size_t ui = 0; ui < Count(); ui++ ) \
|
||||
delete (T*)wxBaseArray::Item(ui); \
|
||||
delete (T*)wxBaseArrayPtrVoid::Item(ui); \
|
||||
} \
|
||||
\
|
||||
void name::RemoveAt(size_t uiIndex) \
|
||||
{ \
|
||||
wxCHECK_RET( uiIndex < Count(), _WX_ERROR_REMOVE2(name) ); \
|
||||
\
|
||||
delete (T*)wxBaseArray::Item(uiIndex); \
|
||||
delete (T*)wxBaseArrayPtrVoid::Item(uiIndex); \
|
||||
\
|
||||
wxBaseArray::RemoveAt(uiIndex); \
|
||||
wxBaseArrayPtrVoid::RemoveAt(uiIndex); \
|
||||
} \
|
||||
\
|
||||
void name::Add(const T& item) \
|
||||
@@ -92,7 +92,7 @@ int name::Index(const T& Item, bool bFromEnd) const \
|
||||
if ( Count() > 0 ) { \
|
||||
size_t ui = Count() - 1; \
|
||||
do { \
|
||||
if ( (T*)wxBaseArray::Item(ui) == &Item ) \
|
||||
if ( (T*)wxBaseArrayPtrVoid::Item(ui) == &Item ) \
|
||||
return ui; \
|
||||
ui--; \
|
||||
} \
|
||||
@@ -101,7 +101,7 @@ int name::Index(const T& Item, bool bFromEnd) const \
|
||||
} \
|
||||
else { \
|
||||
for( size_t ui = 0; ui < Count(); ui++ ) { \
|
||||
if( (T*)wxBaseArray::Item(ui) == &Item ) \
|
||||
if( (T*)wxBaseArrayPtrVoid::Item(ui) == &Item ) \
|
||||
return ui; \
|
||||
} \
|
||||
} \
|
||||
|
Reference in New Issue
Block a user