removed duplicate function + added some comments to header files
[smdp.git] / test / cstack.c
index cf1b504..30d4df3 100644 (file)
@@ -9,13 +9,13 @@ int main(int argc, char *argv[]) {
     printf("INIT: head: %d, size: %zu, alloc: %zu\n", s->head, s->size, s->alloc);
 
     (s->push)(s, 'a');
-    printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", (s->top)(s), s->head, s->size, s->alloc);
+    printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc);
 
     (s->push)(s, 'b');
-    printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", (s->top)(s), s->head, s->size, s->alloc);
+    printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc);
 
     (s->push)(s, 'c');
-    printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", (s->top)(s), s->head, s->size, s->alloc);
+    printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc);
 
     char ch = (s->pop)(s);
     printf("POP: char: %c, head: %d, size: %zu, alloc: %zu\n", ch, s->head, s->size, s->alloc);
@@ -24,10 +24,10 @@ int main(int argc, char *argv[]) {
     printf("POP: char: %c, head: %d, size: %zu, alloc: %zu\n", ch, s->head, s->size, s->alloc);
 
     (s->push)(s, 'd');
-    printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", (s->top)(s), s->head, s->size, s->alloc);
+    printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc);
 
     (s->push)(s, 'e');
-    printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", (s->top)(s), s->head, s->size, s->alloc);
+    printf("PUSH: char: %c, head: %d, size: %zu, alloc: %zu\n", s->content[s->head], s->head, s->size, s->alloc);
 
     while(s->size > 0) {
         ch = (s->pop)(s);