]> git.saurik.com Git - wxWidgets.git/commitdiff
fixes to the new pointer array implementation
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 6 Mar 2002 16:26:25 +0000 (16:26 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 6 Mar 2002 16:26:25 +0000 (16:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/dynarray.h
src/common/dynarray.cpp

index da55179b2393acac3af2b9e0a52ee901e85c8d61..1a7bf28d2f5a0b00ca51595c21f978e81d869aeb 100644 (file)
@@ -463,11 +463,11 @@ private:                                                                 \
 // Some commonly used predefined base arrays
 // ----------------------------------------------------------------------------
 
-WX_DECLARE_EXPORTED_BASEARRAY(void *, wxBaseArrayPtrVoid);
-WX_DECLARE_EXPORTED_BASEARRAY(short,  wxBaseArrayShort);
-WX_DECLARE_EXPORTED_BASEARRAY(int,    wxBaseArrayInt);
-WX_DECLARE_EXPORTED_BASEARRAY(long,   wxBaseArrayLong);
-WX_DECLARE_EXPORTED_BASEARRAY(double, wxBaseArrayDouble);
+WX_DECLARE_EXPORTED_BASEARRAY(const void *, wxBaseArrayPtrVoid);
+WX_DECLARE_EXPORTED_BASEARRAY(short,        wxBaseArrayShort);
+WX_DECLARE_EXPORTED_BASEARRAY(int,          wxBaseArrayInt);
+WX_DECLARE_EXPORTED_BASEARRAY(long,         wxBaseArrayLong);
+WX_DECLARE_EXPORTED_BASEARRAY(double,       wxBaseArrayDouble);
 
 // ----------------------------------------------------------------------------
 // Convenience macros to define arrays from base arrays
index e8efb32ecb06ed51d7bbcbf83ad490038ddad004..07ddf168df9536bc2da9617d69338551b0f620a0 100644 (file)
@@ -48,7 +48,7 @@
 // wxBaseArray - dynamic array of 'T's
 // ----------------------------------------------------------------------------
 
-#define _DECLARE_BASEARRAY(T, name)                                         \
+#define _WX_DEFINE_BASEARRAY(T, name)                                       \
 /* ctor */                                                                  \
 name::name()                                                                \
 {                                                                           \
@@ -217,7 +217,7 @@ size_t name::IndexForInsert(T lItem, CMPFUNC fnCompare) const               \
   while ( lo < hi ) {                                                       \
     i = (lo + hi)/2;                                                        \
                                                                             \
-    res = (*fnCompare)((const void *)&lItem, (const void *)&(m_pItems[i])); \
+    res = (*fnCompare)((const void *)lItem, (const void *)(m_pItems[i]));   \
     if ( res < 0 )                                                          \
       hi = i;                                                               \
     else if ( res > 0 )                                                     \
@@ -292,9 +292,9 @@ void name::Sort(CMPFUNC fCmp)                                               \
   qsort(m_pItems, m_nCount, sizeof(T), fCmp);                               \
 }
 
-_DECLARE_BASEARRAY(void *, wxBaseArrayPtrVoid)
-_DECLARE_BASEARRAY(short,  wxBaseArrayShort)
-_DECLARE_BASEARRAY(int,    wxBaseArrayInt)
-_DECLARE_BASEARRAY(long,   wxBaseArrayLong)
-_DECLARE_BASEARRAY(double, wxBaseArrayDouble)
+_WX_DEFINE_BASEARRAY(const void *, wxBaseArrayPtrVoid)
+_WX_DEFINE_BASEARRAY(short,        wxBaseArrayShort)
+_WX_DEFINE_BASEARRAY(int,          wxBaseArrayInt)
+_WX_DEFINE_BASEARRAY(long,         wxBaseArrayLong)
+//_WX_DEFINE_BASEARRAY(double,       wxBaseArrayDouble)