Compare commits
No commits in common. "963c51370310e32692288c0bb9af7574c62f3e5f" and "60181349956c624b9e98bbb3c047c3e947c37b7f" have entirely different histories.
963c513703
...
6018134995
2 changed files with 2 additions and 22 deletions
20
PILE/pile.c
20
PILE/pile.c
|
@ -31,23 +31,3 @@ void Affichage(struct pile *p)
|
|||
}
|
||||
printf("NULL\n");
|
||||
}
|
||||
|
||||
void init(struct pile ** une_pile) {
|
||||
*une_pile = (struct pile *)malloc(sizeof(struct pile));
|
||||
}
|
||||
|
||||
void push(int e, struct pile * une_pile) {
|
||||
struct cell * aux;
|
||||
if (une_pile->taille == 0) {
|
||||
une_pile->taille = 1;
|
||||
une_pile->deb = (struct cell *)malloc(sizeof(struct cell));
|
||||
une_pile->deb->suiv = NULL;
|
||||
une_pile->deb->val = e;
|
||||
} else {
|
||||
une_pile->taille += 1;
|
||||
aux = une_pile->deb;
|
||||
une_pile->deb = (struct cell *)malloc(sizeof(struct cell));
|
||||
une_pile->deb->val = e;
|
||||
une_pile->deb->suiv = aux;
|
||||
}
|
||||
}
|
||||
|
|
2
makefile
2
makefile
|
@ -15,7 +15,7 @@ forth : forth.o PILE/pile.o LISTE/liste.o LEXER/lexer.o
|
|||
gcc -Wall LEXER/lexer.o LISTE/liste.o PILE/pile.o forth.o -o forth_interpretor
|
||||
|
||||
%.o : %.c
|
||||
gcc -Wall -c $< -o $@
|
||||
gcc -c $< -o $@
|
||||
|
||||
PILE/pile.o : PILE/pile.h
|
||||
LISTE/liste.o : LISTE/liste.h
|
||||
|
|
Loading…
Reference in a new issue