- File:
-
- 1 edited
-
doc/papers/general/evaluation/cfa-stack.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/evaluation/cfa-stack.c
r4c80a75 rac4dad2 8 8 }; 9 9 10 void ?{}( stack(T) & s, stack(T) t ) { // copy 10 void ?{}( stack(T) & s ) { (s.head){ 0 }; } 11 12 void ?{}( stack(T) & s, stack(T) t ) { 11 13 node(T) ** cr = &s.head; 12 14 for ( node(T) * nx = t.head; nx; nx = nx->next ) { … … 18 20 } 19 21 20 void clear( stack(T) & s ) with( s ) { 22 void ^?{}( stack(T) & s) { clear( s ); } 23 24 void clear( stack(T) & s ) with( s ) { 21 25 for ( node(T) * nx = head; nx; ) { 22 26 node(T) * cr = nx; 23 27 nx = cr->next; 24 28 ^(*cr){}; 25 free( cr);29 free(cr); 26 30 } 27 31 head = 0; 28 32 } 29 30 void ?{}( stack(T) & s ) { (s.head){ 0 }; }31 void ^?{}( stack(T) & s) { clear( s ); }32 33 33 34 stack(T) ?=?( stack(T) & s, stack(T) t ) { … … 38 39 } 39 40 40 _Bool empty( const stack(T) & s ) { 41 return s.head == 0; 42 } 41 _Bool empty( const stack(T) & s ) { return s.head == 0; } 43 42 44 43 void push( stack(T) & s, T value ) with( s ) {
Note:
See TracChangeset
for help on using the changeset viewer.