Mercurial > baum
changeset 10:0e15841ae111
s/list/stack/g because thats what it is
author | meillo@marmaro.de |
---|---|
date | Sat, 09 Feb 2008 16:49:29 +0100 |
parents | c020b0d1cfca |
children | 8a8da74530dd |
files | actions.c baum.c baum.h |
diffstat | 3 files changed, 16 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/actions.c Sat Feb 09 16:41:41 2008 +0100 +++ b/actions.c Sat Feb 09 16:49:29 2008 +0100 @@ -74,7 +74,8 @@ unsigned char action_input(struct Node* node) { /* unsigned char input = (unsigned char) getchar(); - getchar(); /* catches the newline */ + getchar(); + */ /* reads a number which is treated as ASCII value */ int input; @@ -90,7 +91,7 @@ struct Node* tp; unsigned char i; tp = node->down; - for (i; i < node->value; i++) { + for (i = 0; i < node->value; i++) { /* deep copy */ } return 0;
--- a/baum.c Sat Feb 09 16:41:41 2008 +0100 +++ b/baum.c Sat Feb 09 16:49:29 2008 +0100 @@ -16,7 +16,7 @@ struct Node* root = 0; -struct Listitem* list = NULL; +struct Stackitem* stack = NULL; void logit(char* text) { @@ -108,22 +108,22 @@ void push(struct Node* node) { - struct Listitem* tmp; - struct Listitem* new; - new = (struct Listitem*) malloc(sizeof(struct Listitem)); + struct Stackitem* tmp; + struct Stackitem* new; + new = (struct Stackitem*) malloc(sizeof(struct Stackitem)); new->node = node; - tmp = list; - list = new; - list->next = tmp; + tmp = stack; + stack = new; + stack->next = tmp; } struct Node* pull() { - if (list == NULL) { + if (stack == NULL) { return NULL; } - struct Listitem* tmp; + struct Stackitem* tmp; struct Node* node; - tmp = list; - list = list->next; + tmp = stack; + stack = stack->next; node = tmp->node; free(tmp); tmp=0; return node;