Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove stack.[ch] as unused.

  • Loading branch information...
commit ee6f39b75dc254bf6a414d706be1b2489d2e515c 1 parent 1a75103
Nelson Elhage authored
Showing with 1 addition and 68 deletions.
  1. +1 −1  Makefile
  2. +0 −53 stack.c
  3. +0 −11 stack.h
  4. +0 −3  test.c
2  Makefile
View
@@ -1,5 +1,5 @@
CFLAGS=-g -Wall $(DEFS) $(TEST_CFLAGS)
-OBJECTS=gc.o symbol.o stack.o read.o
+OBJECTS=gc.o symbol.o read.o
TEST_OBJECTS=$(OBJECTS) test.o
TEST_CFLAGS=-DBUILD_TEST
53 stack.c
View
@@ -1,53 +0,0 @@
-#include "stack.h"
-
-sc_val stack_new() {
- return gc_alloc_cons();
-}
-
-void stack_push(sc_val stack, sc_val val) {
- gc_register_roots(&stack, &val, NULL);
-
- sc_val new_cell = gc_alloc_cons();
-
- sc_set_cdr(new_cell, sc_cdr(stack));
- sc_set_car(new_cell, val);
-
- sc_set_cdr(stack, new_cell);
-
- gc_pop_roots();
-}
-
-sc_val stack_pop(sc_val stack) {
- sc_val v = sc_car(sc_cdr(stack));
- sc_set_cdr(stack, sc_cdr(sc_cdr(stack)));
- return v;
-}
-
-#ifdef BUILD_TEST
-
-#include <stdio.h>
-#include <assert.h>
-
-void test_stack() {
- sc_val stack = NIL, val = NIL;
- gc_register_roots(&stack, &val, NULL);
-
- stack = stack_new();
-
- int i;
- for(i = 0; i < 20; i++) {
- val = sc_make_number(i);
- stack_push(stack, val);
- }
-
- sc_val v;
- for(i = 19; i; i--) {
- v = stack_pop(stack);
- assert(sc_numberp(v));
- assert(sc_number(v) == i);
- }
-
- gc_pop_roots();
-}
-
-#endif
11 stack.h
View
@@ -1,11 +0,0 @@
-#ifndef __MINISCHEME_STACK__
-#define __MINISCHEME_STACK__
-
-#include "gc.h"
-
-sc_val stack_new();
-
-void stack_push(sc_val stack, sc_val val);
-sc_val stack_pop(sc_val stack);
-
-#endif
3  test.c
View
@@ -1,11 +1,9 @@
#include "gc.h"
#include "read.h"
-#include "stack.h"
#include "symbol.h"
extern void test_gc();
extern void test_read();
-extern void test_stack();
extern void test_symbol();
int main() {
@@ -14,7 +12,6 @@ int main() {
test_gc();
test_read();
- test_stack();
test_symbol();
return 0;
Please sign in to comment.
Something went wrong with that request. Please try again.