Changeset 633a642 for src/libcfa/bits/containers.h
- Timestamp:
- Jan 30, 2018, 4:52:54 PM (6 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 1449d83, 5ff188f
- Parents:
- 320eb73a (diff), 7416d46a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/bits/containers.h
r320eb73a r633a642 140 140 141 141 #ifdef __cforall 142 142 143 forall(dtype T | is_node(T)) 143 static inline void ?{}( __queue(T) & this ) {144 (this.head){ NULL };145 (this.tail){ &this.head };144 static inline void ?{}( __queue(T) & this ) with( this ) { 145 head{ NULL }; 146 tail{ &head }; 146 147 } 147 148 148 149 forall(dtype T | is_node(T) | sized(T)) 149 static inline void append( __queue(T) & this, T * val ) {150 verify(t his.tail != NULL);151 *t his.tail = val;152 t his.tail = &get_next( *val );150 static inline void append( __queue(T) & this, T * val ) with( this ) { 151 verify(tail != NULL); 152 *tail = val; 153 tail = &get_next( *val ); 153 154 } 154 155 … … 167 168 168 169 forall(dtype T | is_node(T) | sized(T)) 169 static inline T * remove( __queue(T) & this, T ** it ) {170 static inline T * remove( __queue(T) & this, T ** it ) with( this ) { 170 171 T * val = *it; 171 172 verify( val ); … … 173 174 (*it) = get_next( *val ); 174 175 175 if( t his.tail == &get_next( *val ) ) {176 t his.tail = it;176 if( tail == &get_next( *val ) ) { 177 tail = it; 177 178 } 178 179 179 180 get_next( *val ) = NULL; 180 181 181 verify( ( this.head == NULL) == (&this.head == this.tail) );182 verify( *t his.tail == NULL );182 verify( (head == NULL) == (&head == tail) ); 183 verify( *tail == NULL ); 183 184 return val; 184 185 } 185 186 #endif 187 188 //----------------------------------------------------------------------------- 189 // Tools 190 //----------------------------------------------------------------------------- 191 #ifdef __cforall 192 193 #endif
Note: See TracChangeset
for help on using the changeset viewer.