Changeset 87c5f40 for doc/generic_types/evaluation/c-stack.c
- Timestamp:
- Apr 11, 2017, 5:11:55 PM (8 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:
- 4f57930
- Parents:
- e6dceef
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/evaluation/c-stack.c
re6dceef r87c5f40 11 11 } 12 12 13 void copy_stack(struct stack* s, struct stack* t, void* (*copy)(void*)) {13 void copy_stack(struct stack* s, const struct stack* t, void* (*copy)(const void*)) { 14 14 struct stack_node** crnt = &s->head; 15 15 struct stack_node* next = t->head; … … 23 23 } 24 24 25 void clear_stack(struct stack* s ) {25 void clear_stack(struct stack* s, void (*free_el)(void*)) { 26 26 struct stack_node* next = s->head; 27 27 while ( next ) { 28 28 struct stack_node* crnt = next; 29 29 next = crnt->next; 30 free (crnt->value);30 free_el(crnt->value); 31 31 free(crnt); 32 32 }
Note: See TracChangeset
for help on using the changeset viewer.