diff --git a/.hgignore b/.hgignore index d1af4846..e26cf91b 100644 --- a/.hgignore +++ b/.hgignore @@ -5,6 +5,7 @@ syntax: glob *.o *.so *.dylib +*.class *.dSYM *.orig .hg diff --git a/AUTHORS b/AUTHORS index df7959c1..1e15e0a5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,7 +16,7 @@ Thanks to the following people for patches: * John Samsa * Lars J Aas * Lorenzo Campedelli - * sladegen + * Michal Kowalski (sladegen) If you would prefer not to be listed, or are one of the users listed without a full name, please contact me. If you've made a contribution diff --git a/Makefile b/Makefile index 7949a71b..7c641a4c 100644 --- a/Makefile +++ b/Makefile @@ -213,3 +213,10 @@ dist: cleaner for f in `hg manifest`; do mkdir -p chibi-scheme-`cat VERSION`/`dirname $$f`; ln -s `pwd`/$$f chibi-scheme-`cat VERSION`/$$f; done tar cphzvf chibi-scheme-`cat VERSION`.tgz chibi-scheme-`cat VERSION` rm -rf chibi-scheme-`cat VERSION` + +mips-dist: cleaner + rm -f chibi-scheme-`date +%Y%m%d`-`hg tags|head -1|sed -n 's/.* \([0-9]*\):.*/\1/p'`.tgz + mkdir chibi-scheme-`date +%Y%m%d`-`hg tags|head -1|sed -n 's/.* \([0-9]*\):.*/\1/p'` + for f in `hg manifest`; do mkdir -p chibi-scheme-`date +%Y%m%d`-`hg tags|head -1|sed -n 's/.* \([0-9]*\):.*/\1/p'`/`dirname $$f`; ln -s `pwd`/$$f chibi-scheme-`date +%Y%m%d`-`hg tags|head -1|sed -n 's/.* \([0-9]*\):.*/\1/p'`/$$f; done + tar cphzvf chibi-scheme-`date +%Y%m%d`-`hg tags|head -1|sed -n 's/.* \([0-9]*\):.*/\1/p'`.tgz chibi-scheme-`date +%Y%m%d`-`hg tags|head -1|sed -n 's/.* \([0-9]*\):.*/\1/p'` + rm -rf chibi-scheme-`date +%Y%m%d`-`hg tags|head -1|sed -n 's/.* \([0-9]*\):.*/\1/p'` diff --git a/gc.c b/gc.c index fb15ec13..af7b3986 100644 --- a/gc.c +++ b/gc.c @@ -8,16 +8,8 @@ #include #endif -#if SEXP_64_BIT -#define sexp_heap_align(n) sexp_align(n, 5) -#else -#define sexp_heap_align(n) sexp_align(n, 4) -#endif - #define SEXP_MINIMUM_OBJECT_SIZE (sexp_heap_align(sexp_sizeof(pair))) -#define sexp_heap_pad_size(s) (sizeof(struct sexp_heap_t) + (s) + sexp_heap_align(1)) - #if SEXP_USE_GLOBAL_HEAP sexp_heap sexp_global_heap; #endif diff --git a/include/chibi/sexp.h b/include/chibi/sexp.h index a9c642e5..ad773145 100644 --- a/include/chibi/sexp.h +++ b/include/chibi/sexp.h @@ -113,13 +113,18 @@ enum sexp_types { typedef unsigned int sexp_tag_t; typedef unsigned long sexp_uint_t; typedef long sexp_sint_t; +#define sexp_heap_align(n) sexp_align(n, 5) #else typedef unsigned short sexp_tag_t; typedef unsigned int sexp_uint_t; typedef int sexp_sint_t; +#define sexp_heap_align(n) sexp_align(n, 4) #endif + typedef struct sexp_struct *sexp; +#define sexp_heap_pad_size(s) (sizeof(struct sexp_heap_t) + (s) + sexp_heap_align(1)) + #define __HALF_MAX_SIGNED(type) ((type)1 << (sizeof(type)*8-2)) #define __MAX_SIGNED(type) (__HALF_MAX_SIGNED(type) - 1 + __HALF_MAX_SIGNED(type)) #define __MIN_SIGNED(type) (-1 - __MAX_SIGNED(type)) diff --git a/lib/chibi/term/edit-line.scm b/lib/chibi/term/edit-line.scm index 6c63f5d9..cd8fd376 100644 --- a/lib/chibi/term/edit-line.scm +++ b/lib/chibi/term/edit-line.scm @@ -115,6 +115,7 @@ (gap buffer-gap buffer-gap-set!) (width buffer-width buffer-width-set!) (string buffer-string buffer-string-set!) + (kill-ring buffer-kill-ring buffer-kill-ring-set!) (history buffer-history buffer-history-set!)) (define default-buffer-size 256) diff --git a/sexp.c b/sexp.c index 075553a1..07a0d824 100644 --- a/sexp.c +++ b/sexp.c @@ -311,7 +311,7 @@ void sexp_destroy_context (sexp ctx) { for ( ; heap; heap=tmp) { tmp = heap->next; #if SEXP_USE_MMAP_GC - munmap(heap, heap->size); + munmap(heap, sexp_heap_pad_size(heap->size)); #else free(heap); #endif diff --git a/tests/hash-tests.scm b/tests/hash-tests.scm index 6dec5734..54fb4fc7 100644 --- a/tests/hash-tests.scm +++ b/tests/hash-tests.scm @@ -11,8 +11,8 @@ (set! *tests-run* (+ *tests-run* 1)) (let ((str (call-with-output-string (lambda (out) - (write *tests-run*) - (display ". ") + (write *tests-run* out) + (display ". " out) (display 'expr out)))) (res expr)) (display str) diff --git a/tests/r5rs-tests.scm b/tests/r5rs-tests.scm index 80db4e00..a9197fb1 100644 --- a/tests/r5rs-tests.scm +++ b/tests/r5rs-tests.scm @@ -216,24 +216,6 @@ (test 288 (lcm 32 -36)) -;;;; these will fail when compiled either without flonums or trig funcs - -;; (test #t (= -5 (floor -4.3))) - -;; (test #t (= -4 (ceiling -4.3))) - -;; (test #t (= -4 (truncate -4.3))) - -;; (test #t (= -4 (round -4.3))) - -;; (test #t (= 3 (floor 3.5))) - -;; (test #t (= 4 (ceiling 3.5))) - -;; (test #t (= 3 (truncate 3.5))) - -;; (test #t (= 4 (round 3.5))) - (test 100 (string->number "100")) (test 256 (string->number "100" 16)) diff --git a/tools/genstubs.scm b/tools/genstubs.scm index 77acbe26..95443d24 100755 --- a/tools/genstubs.scm +++ b/tools/genstubs.scm @@ -73,6 +73,7 @@ ;; ;; Port Types: ;; input-port output-port +;; port-or-fd - an fd-backed port or a fixnum ;; ;; Struct Types: ;; @@ -620,8 +621,8 @@ " return sexp_xtype_exception(ctx, self, \"not a list of " (type-name type) "s\", " arg ");\n"))) ((eq? base-type 'port-or-fd) - (cat "if (! (sexp_portp(" arg ") || sexp_fixnump(" arg ")))\n" - " return sexp_xtype_exception(ctx, self, \"not a port of file descriptor\"," arg ");\n")) + (cat " if (! (sexp_portp(" arg ") || sexp_fixnump(" arg ")))\n" + " return sexp_xtype_exception(ctx, self, \"not a port or file descriptor\"," arg ");\n")) ((or (int-type? base-type) (float-type? base-type) (string-type? base-type)