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:
@ -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;
|
||||
|
Reference in New Issue
Block a user