It worksgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit statusgit status!

This commit is contained in:
Meyer Simon
2025-05-01 15:22:37 -04:00
parent 456346f68e
commit 99dffaee01
4 changed files with 23 additions and 40 deletions

View File

@ -25,7 +25,7 @@ void S_Push(Stack * s, void *v, int i) {
}
void * S_Pop(Stack *s) {
if (s == NULL || !S_IsEmpty(s)) {
if (s == NULL || S_IsEmpty(s)) {
return NULL;
}
__Node * node = s->n;
@ -38,14 +38,14 @@ void * S_Pop(Stack *s) {
void * S_Peek(Stack *s){
if (s == NULL || !S_IsEmpty(s)) {
if (s == NULL || S_IsEmpty(s)) {
return NULL;
}
return s->n->v;
}
bool S_IsEmpty(Stack *s){
if(!s) {
if(s == NULL || s->size == 0) {
return true;
}
return false;
@ -69,7 +69,7 @@ char * temp = NULL;
*/
void emit_push_all(Stack * s){
for (Instruction * i = S_Pop(s); s; i = S_Pop(s)){
for (Instruction * i = S_Pop(s); i; i = S_Pop(s)){
current->next = i;
i->prev = current;
current = i;