diff --git a/femtolisp/Makefile b/femtolisp/Makefile index 5182893..6c72984 100644 --- a/femtolisp/Makefile +++ b/femtolisp/Makefile @@ -25,8 +25,8 @@ test: %.do: %.c $(CC) $(DEBUGFLAGS) -c $< -o $@ -flisp.o: flisp.c cvalues.c types.c flisp.h print.c read.c -flisp.do: flisp.c cvalues.c types.c flisp.h print.c read.c +flisp.o: flisp.c cvalues.c types.c flisp.h print.c read.c equal.c +flisp.do: flisp.c cvalues.c types.c flisp.h print.c read.c equal.c $(LLT): cd $(LLTDIR) && make diff --git a/femtolisp/Makefile.macosx b/femtolisp/Makefile.macosx index b02ed91..e13090f 100644 --- a/femtolisp/Makefile.macosx +++ b/femtolisp/Makefile.macosx @@ -25,8 +25,8 @@ test: %.do: %.c $(CC) $(DEBUGFLAGS) -c $< -o $@ -flisp.o: flisp.c cvalues.c types.c flisp.h print.c read.c -flisp.do: flisp.c cvalues.c types.c flisp.h print.c read.c +flisp.o: flisp.c cvalues.c types.c flisp.h print.c read.c equal.c +flisp.do: flisp.c cvalues.c types.c flisp.h print.c read.c equal.c $(LLT): cd $(LLTDIR) && make diff --git a/femtolisp/equal.c b/femtolisp/equal.c index c953364..a01bf2e 100644 --- a/femtolisp/equal.c +++ b/femtolisp/equal.c @@ -329,7 +329,7 @@ static uptrint_t bounded_hash(value_t a, int bound, int *oob) } len = vector_size(a); for(i=0; i < len; i++) { - h = MIX(h, bounded_hash(vector_elt(a,i), bound/2, &oob2)+1); + h = MIX(h, bounded_hash(vector_elt(a,i), bound/2, &oob2)^1); if (oob2) bound/=2; *oob = *oob || oob2; @@ -354,7 +354,7 @@ static uptrint_t bounded_hash(value_t a, int bound, int *oob) *oob = *oob || oob2; a = cdr_(a); } while (iscons(a)); - h = MIX(h, bounded_hash(a, bound-1, &oob2)+2); + h = MIX(h, bounded_hash(a, bound-1, &oob2)^2); *oob = *oob || oob2; return h; } diff --git a/femtolisp/flisp.c b/femtolisp/flisp.c index 83ef151..16ec57e 100644 --- a/femtolisp/flisp.c +++ b/femtolisp/flisp.c @@ -659,6 +659,7 @@ value_t applyn(uint32_t n, value_t f, ...) } value_t v = _applyn(n); POPN(n+1); + va_end(ap); return v; }