Changeset 1504536 for doc/generic_types/evaluation/c-stack.c
- Timestamp:
- Apr 14, 2017, 5:03:43 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:
- 952d201
- Parents:
- bbe856c (diff), 3fb7f5e (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
-
doc/generic_types/evaluation/c-stack.c
rbbe856c r1504536 8 8 9 9 struct stack new_stack() { 10 return (struct stack){ NULL }; 10 return (struct stack){ NULL }; /***/ 11 11 } 12 12 … … 15 15 struct stack_node* next = t->head; 16 16 while ( next ) { 17 *crnt = malloc(sizeof(struct stack_node)); 18 **crnt = (struct stack_node){ copy(next->value) }; 17 *crnt = malloc(sizeof(struct stack_node)); /***/ 18 **crnt = (struct stack_node){ copy(next->value) }; /***/ 19 19 crnt = &(*crnt)->next; 20 20 next = next->next; … … 39 39 40 40 void push_stack(struct stack* s, void* value) { 41 struct stack_node* n = malloc(sizeof(struct stack_node)); 42 *n = (struct stack_node){ value, s->head }; 41 struct stack_node* n = malloc(sizeof(struct stack_node)); /***/ 42 *n = (struct stack_node){ value, s->head }; /***/ 43 43 s->head = n; 44 44 }
Note: See TracChangeset
for help on using the changeset viewer.