push_front( e ); \
return compatibility_iterator( this, begin() ); \
} \
- compatibility_iterator Insert( compatibility_iterator & i, elT e ) \
+ compatibility_iterator Insert(const compatibility_iterator & i, elT e)\
{ \
return compatibility_iterator( this, insert( i.m_iter, e ) ); \
} \
friend class wxListBase;
public:
// ctor
- wxNodeBase(wxListBase *list = (wxListBase *)NULL,
- wxNodeBase *previous = (wxNodeBase *)NULL,
- wxNodeBase *next = (wxNodeBase *)NULL,
+ wxNodeBase(wxListBase *list = NULL,
+ wxNodeBase *previous = NULL,
+ wxNodeBase *next = NULL,
void *data = NULL,
const wxListKey& key = wxDefaultListKey);
virtual void DeleteData() { }
public:
// for wxList::iterator
- void** GetDataPtr() const { return &(wx_const_cast(wxNodeBase*, this)->m_data); }
+ void** GetDataPtr() const { return &(const_cast<wxNodeBase*>(this)->m_data); }
private:
// optional key stuff
wxListKeyValue m_key;
{
wxNodeBase *node = Item(n);
- return node ? node->GetData() : (wxNodeBase *)NULL;
+ return node ? node->GetData() : NULL;
}
// operations
// append to beginning of list
wxNodeBase *Append(void *object);
// insert a new item at the beginning of the list
- wxNodeBase *Insert(void *object) { return Insert( (wxNodeBase*)NULL, object); }
+ wxNodeBase *Insert(void *object)
+ { return Insert(static_cast<wxNodeBase *>(NULL), object); }
// insert a new item at the given position
wxNodeBase *Insert(size_t pos, void *object)
{ return pos == GetCount() ? Append(object)
classexp nodetype : public wxNodeBase \
{ \
public: \
- nodetype(wxListBase *list = (wxListBase *)NULL, \
- nodetype *previous = (nodetype *)NULL, \
- nodetype *next = (nodetype *)NULL, \
- T *data = (T *)NULL, \
+ nodetype(wxListBase *list = NULL, \
+ nodetype *previous = NULL, \
+ nodetype *next = NULL, \
+ T *data = NULL, \
const wxListKey& key = wxDefaultListKey) \
: wxNodeBase(list, previous, next, data, key) { } \
\
T *operator[](size_t index) const \
{ \
nodetype *node = Item(index); \
- return node ? (T*)(node->GetData()) : (T*)NULL; \
+ return node ? (T*)(node->GetData()) : NULL; \
} \
\
nodetype *Append(Tbase *object) \
{ return (nodetype *)wxListBase::Append(object); } \
nodetype *Insert(Tbase *object) \
- { return (nodetype *)Insert((nodetype*)NULL, object); } \
+ { return (nodetype *)Insert(static_cast<nodetype *>(NULL), \
+ object); } \
nodetype *Insert(size_t pos, Tbase *object) \
{ return (nodetype *)wxListBase::Insert(pos, object); } \
nodetype *Insert(nodetype *prev, Tbase *object) \