Ignore:
Timestamp:
Apr 25, 2017, 8:21:10 AM (5 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
89a9be2
Parents:
b3d70eb
Message:

more cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/c-stack.c

    rb3d70eb r6a8ac0b  
    1111void copy_stack(struct stack* s, const struct stack* t, void* (*copy)(const void*)) {
    1212        struct stack_node** crnt = &s->head;
    13         struct stack_node* next = t->head;
    14         while ( next ) {
     13        for ( struct stack_node* next = t->head; next; next = next->next ) {
    1514                *crnt = malloc(sizeof(struct stack_node)); /***/
    1615                **crnt = (struct stack_node){ copy(next->value) }; /***/
    1716                crnt = &(*crnt)->next;
    18                 next = next->next;
    1917        }
    2018        *crnt = 0;
     
    2220
    2321void clear_stack(struct stack* s, void (*free_el)(void*)) {
    24         struct stack_node* next = s->head;
    25         while ( next ) {
     22    for ( struct stack_node* next = s->head; next; ) {
    2623                struct stack_node* crnt = next;
    2724                next = crnt->next;
Note: See TracChangeset for help on using the changeset viewer.