X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/28468136d08dfa16a4052770a6c66e2c60663941..81769ae053c0b33c4502309c5fd3560876367b69:/utils/HelpGen/src/wxstllst.h diff --git a/utils/HelpGen/src/wxstllst.h b/utils/HelpGen/src/wxstllst.h index 5a1d1bc469..471df3e6f9 100644 --- a/utils/HelpGen/src/wxstllst.h +++ b/utils/HelpGen/src/wxstllst.h @@ -6,7 +6,7 @@ // Created: 27/09/98 // RCS-ID: $Id$ // Copyright: (c) Aleskandars Gluchovas -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __WXSTLLST_G__ @@ -17,15 +17,17 @@ #endif #include -#include +#if !defined(__WXMAC__) || defined(__DARWIN__) +# include +#endif #include #include #include -// VERSION:: 0.2 (copy-constructor/adign-op added) +// VERSION:: 0.2 (copy-constructor/assign-op added) // FOR NOW:: class-member operators "new" and "delete" -// are ignored by list class, memory allocated +// are ignored by list class, memory allocated // and freed using global operators typedef int Type; @@ -38,50 +40,50 @@ typedef int Type; {\ public:\ \ - typedef Type value_type;\ - typedef value_type* pointer;\ - typedef const value_type* const_pointer;\ - typedef value_type& reference;\ - typedef const value_type& const_reference;\ - typedef size_t size_type;\ - typedef ptrdiff_t difference_type;\ + typedef Type value_type;\ + typedef value_type* pointer;\ + typedef const value_type* const_pointer;\ + typedef value_type& reference;\ + typedef const value_type& const_reference;\ + typedef size_t size_type;\ + typedef ptrdiff_t difference_type;\ \ protected:\ - struct list_node\ - {\ - list_node* mpNext;\ - list_node* mpPrev;\ - value_type mData;\ - };\ -\ - typedef list_node* node_ref_type;\ -\ - node_ref_type mpFreeListHead;\ - node_ref_type mpTerminator;\ - size_type mSize;\ -\ - inline node_ref_type AllocNode() \ - { \ - if ( mpFreeListHead ) \ - {\ - node_ref_type pFreeNode = mpFreeListHead;\ - mpFreeListHead = mpFreeListHead->mpPrev;\ -\ - return pFreeNode;\ - }\ - else\ - {\ - char* pHeapBlock = new char[sizeof(list_node)];\ -\ - return (node_ref_type)pHeapBlock;\ - }\ - }\ -\ - inline void DestroyFreeList()\ - {\ - while ( mpFreeListHead )\ - {\ - node_ref_type tmp = mpFreeListHead;\ + struct list_node\ + {\ + list_node* mpNext;\ + list_node* mpPrev;\ + value_type mData;\ + };\ +\ + typedef list_node* node_ref_type;\ +\ + node_ref_type mpFreeListHead;\ + node_ref_type mpTerminator;\ + size_type m_Size;\ +\ + inline node_ref_type AllocNode() \ + { \ + if ( mpFreeListHead ) \ + {\ + node_ref_type pFreeNode = mpFreeListHead;\ + mpFreeListHead = mpFreeListHead->mpPrev;\ +\ + return pFreeNode;\ + }\ + else\ + {\ + char* pHeapBlock = new char[sizeof(list_node)];\ +\ + return (node_ref_type)pHeapBlock;\ + }\ + }\ +\ + inline void DestroyFreeList()\ + {\ + while ( mpFreeListHead )\ + {\ + node_ref_type tmp = mpFreeListHead;\ mpFreeListHead = mpFreeListHead->mpPrev;\ \ delete [](char*)tmp;\ @@ -316,7 +318,7 @@ public:\ \ inline listClass()\ : mpFreeListHead( 0 ),\ - mSize(0)\ + m_Size(0)\ {\ mpTerminator = AllocNode();\ mpTerminator->mpPrev = mpTerminator->mpNext = mpTerminator;\ @@ -345,7 +347,7 @@ public:\ \ inline listClass(const_iterator first, const_iterator last)\ : mpFreeListHead( 0 ),\ - mSize(0)\ + m_Size(0)\ \ { while( first != last ) push_back( *first++ ); }\ \ @@ -382,9 +384,9 @@ public:\ inline const_reverse_iterator rend() const\ { return const_reverse_iterator(mpTerminator); }\ \ - inline int empty() const { return (mSize == 0); }\ + inline int empty() const { return (m_Size == 0); }\ \ - inline size_type size() const { return mSize; }\ + inline size_type size() const { return m_Size; }\ \ inline size_type max_size() const { return UINT_MAX/sizeof(list_node); }\ \ @@ -413,7 +415,7 @@ public:\ \ new (&pNew->mData) value_type(x);\ \ - ++mSize;\ + ++m_Size;\ \ return iterator(pNew);\ }\ @@ -439,8 +441,8 @@ public:\ other.mpTerminator->mpNext = \ other.mpTerminator->mpPrev = other.mpTerminator;\ \ - mSize += other.mSize;\ - other.mSize = 0;\ + m_Size += other.m_Size;\ + other.m_Size = 0;\ }\ \ inline void splice( iterator position, listClass& other, iterator first, iterator last )\ @@ -455,8 +457,8 @@ public:\ ++sz;\ }\ \ - mSize += sz;\ - other.mSize -= sz;\ + m_Size += sz;\ + other.m_Size -= sz;\ \ node_ref_type pPos = position.mpNode;\ node_ref_type pFirst = first.mpNode;\ @@ -500,7 +502,7 @@ public:\ \ firstNode = next;\ \ - --mSize;\ + --m_Size;\ }\ }\ \ @@ -516,13 +518,13 @@ public:\ \ void sort()\ {\ - if ( mSize < 2 ) return;\ + if ( m_Size < 2 ) return;\ \ iterator from = begin();\ iterator other_end = end();\ --other_end;\ \ - for( size_type i = 0; i != mSize; ++i )\ + for( size_type i = 0; i != m_Size; ++i )\ {\ size_type nSwaps = 0;\ \ @@ -556,4 +558,4 @@ public:\ \ _WXSTL_LIST_##ELEMENT_CLASS, ELEMENT_CLASS ) -#endif \ No newline at end of file +#endif