Changeset 3860 in orxonox.OLD for orxonox/trunk/src/lib/util
- Timestamp:
- Apr 17, 2005, 6:20:02 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/util/list.h
r3832 r3860 3 3 #define _LIST_H 4 4 5 #include "stdincl.h" 5 #include "compiler.h" 6 #ifndef NULL 7 #define NULL 0 8 #endif 6 9 7 10 //! An enum to list all the modes available when adding an object to a List … … 38 41 listElement* next; 39 42 }; 40 Uint32size;43 unsigned int size; 41 44 listElement* first; 42 45 listElement* last; … … 118 121 119 122 private: 120 Uint32size;123 unsigned int size; 121 124 listElement<T>* first; 122 125 listElement<T>* last; … … 153 156 inline void tList<T>::add(T* entity) 154 157 { 155 __UNLIKELY_IF( entity == NULL) return;158 if( unlikely(entity == NULL)) return; 156 159 listElement<T>* el = new listElement<T>; 157 160 el->prev = this->last; … … 161 164 this->last = el; 162 165 163 __UNLIKELY_IF(el->prev == NULL) this->first = el; /* if first element */166 if( unlikely(el->prev == NULL)) this->first = el; /* if first element */ 164 167 else el->prev->next = el; 165 168 this->size++; … … 174 177 while( this->currentEl != NULL) 175 178 { 176 __UNLIKELY_IF( this->currentEl->curr == entity)179 if( unlikely(this->currentEl->curr == entity)) 177 180 { 178 __UNLIKELY_IF( this->currentEl->prev == NULL) this->first = this->currentEl->next;181 if( unlikely(this->currentEl->prev == NULL)) this->first = this->currentEl->next; 179 182 else this->currentEl->prev->next = this->currentEl->next; 180 183 181 __UNLIKELY_IF( this->currentEl->next == NULL) this->last = this->currentEl->prev;184 if( unlikely(this->currentEl->next == NULL)) this->last = this->currentEl->prev; 182 185 else this->currentEl->next->prev = this->currentEl->prev; 183 186
Note: See TracChangeset
for help on using the changeset viewer.