From 8146be0250fa76b42bbe3764e5271175032cefb9 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Fri, 4 Nov 2011 18:39:26 +0900 Subject: [PATCH] Various fixes for alternate builds. --- eval.c | 8 ++-- gc.c | 31 ++++++++++--- include/chibi/features.h | 21 ++++++--- include/chibi/sexp.h | 8 +++- opt/bignum.c | 90 +++++++++++++++++++++++++------------- sexp.c | 30 +++++++++---- tests/build/build-opts.txt | 4 +- tests/build/build-tests.sh | 3 +- vm.c | 2 + 9 files changed, 140 insertions(+), 57 deletions(-) diff --git a/eval.c b/eval.c index f0173a89..89d52fa7 100644 --- a/eval.c +++ b/eval.c @@ -1174,14 +1174,14 @@ sexp sexp_register_optimization (sexp ctx sexp_api_params(self, n), sexp f, sexp #if SEXP_USE_MATH #if SEXP_USE_BIGNUMS -#define maybe_convert_bignum(z) \ +#define maybe_convert_bignum(z) \ else if (sexp_bignump(z)) d = sexp_bignum_to_double(z); #else #define maybe_convert_bignum(z) #endif #if SEXP_USE_RATIOS -#define maybe_convert_ratio(z) \ +#define maybe_convert_ratio(z) \ else if (sexp_ratiop(z)) d = sexp_ratio_to_double(z); #else #define maybe_convert_ratio(z) @@ -1224,7 +1224,9 @@ define_math_op(sexp_floor, floor, 0, sexp_complex_dummy) define_math_op(sexp_ceiling, ceil, 0, sexp_complex_dummy) sexp sexp_sqrt (sexp ctx sexp_api_params(self, n), sexp z) { +#if SEXP_USE_COMPLEX int negativep = 0; +#endif double d, r; sexp_gc_var1(res); if (sexp_flonump(z)) @@ -1257,7 +1259,7 @@ sexp sexp_sqrt (sexp ctx sexp_api_params(self, n), sexp z) { return res; } -#endif +#endif /* SEXP_USE_MATH */ #if SEXP_USE_RATIOS sexp sexp_generic_expt (sexp ctx, sexp x, sexp_sint_t e) { diff --git a/gc.c b/gc.c index ecd54a40..e432707b 100644 --- a/gc.c +++ b/gc.c @@ -312,7 +312,8 @@ sexp sexp_sweep (sexp ctx, size_t *sum_freed_ptr) { } size = sexp_heap_align(sexp_allocated_bytes(ctx, p)); #if SEXP_USE_DEBUG_GC - sexp_valid_object_p(ctx, p); + if (!sexp_valid_object_p(ctx, p)) + fprintf(stderr, SEXP_BANNER("%p sweep: invalid object at %p"), ctx, p); if ((char*)q + q->size > (char*)p) fprintf(stderr, SEXP_BANNER("%p sweep: bad size at %p < %p + %lu"), ctx, p, q, q->size); @@ -366,7 +367,7 @@ sexp sexp_sweep (sexp ctx, size_t *sum_freed_ptr) { } #if SEXP_USE_GLOBAL_SYMBOLS -void sexp_mark_global_symbols(ctx) { +void sexp_mark_global_symbols(sexp ctx) { int i; for (i=0; isize); } else { +#if SEXP_USE_DL if (sexp_opcodep(p) && sexp_opcode_func(p)) { name = (sexp_opcode_data2(p) && sexp_stringp(sexp_opcode_data2(p))) ? sexp_opcode_data2(p) : sexp_opcode_name(p); if (sexp_dlp(sexp_opcode_dl(p))) { @@ -587,9 +596,19 @@ void sexp_offset_heap_pointers (sexp_heap heap, sexp_heap from_heap, sexp* types } else { sexp_opcode_func(p) = dlsym(SEXP_RTLD_DEFAULT, sexp_string_data(name)); } - } else if (sexp_typep(p)) { - if (sexp_type_finalize(p)) - sexp_type_finalize(p) = sexp_type_tag(p) == SEXP_DL ? sexp_finalize_dl : SEXP_FINALIZE_PORT; + } else +#endif + if (sexp_typep(p)) { + if (sexp_type_finalize(p)) { + /* TODO: handle arbitrary finalizers in images */ +#if SEXP_USE_DL + if (sexp_type_tag(p) == SEXP_DL) + sexp_type_finalize(p) = SEXP_FINALIZE_DL; + else +#endif + sexp_type_finalize(p) = SEXP_FINALIZE_PORT; + } + /* TODO: handle arbitrary printers in images */ if (sexp_type_print(p)) sexp_type_print(p) = sexp_write_simple_object; } diff --git a/include/chibi/features.h b/include/chibi/features.h index 5c12d9f8..0776acdc 100644 --- a/include/chibi/features.h +++ b/include/chibi/features.h @@ -366,23 +366,30 @@ #endif #ifndef SEXP_USE_EXTENDED_FCALL -#define SEXP_USE_EXTENDED_FCALL ! SEXP_USE_NO_FEATURES +#define SEXP_USE_EXTENDED_FCALL (!SEXP_USE_NO_FEATURES) #endif #ifndef SEXP_USE_RATIOS -#define SEXP_USE_RATIOS ! SEXP_USE_NO_FEATURES +#define SEXP_USE_RATIOS (!SEXP_USE_NO_FEATURES) #endif #ifndef SEXP_USE_COMPLEX -#define SEXP_USE_COMPLEX ! SEXP_USE_NO_FEATURES +#define SEXP_USE_COMPLEX (!SEXP_USE_NO_FEATURES) #endif #ifndef SEXP_USE_BIGNUMS -#define SEXP_USE_BIGNUMS (SEXP_USE_RATIOS || SEXP_USE_COMPLEX) +#define SEXP_USE_BIGNUMS (!SEXP_USE_NO_FEATURES) #endif #ifndef SEXP_USE_FLONUMS -#define SEXP_USE_FLONUMS (SEXP_USE_COMPLEX || ! SEXP_USE_NO_FEATURES) +#define SEXP_USE_FLONUMS (!SEXP_USE_NO_FEATURES) +#endif + +#if (SEXP_USE_RATIOS || SEXP_USE_COMPLEX) +#undef SEXP_USE_BIGNUMS +#define SEXP_USE_BIGNUMS 1 +#undef SEXP_USE_FLONUMS +#define SEXP_USE_FLONUMS 1 #endif #ifndef SEXP_USE_INFINITIES @@ -418,7 +425,7 @@ #endif #ifndef SEXP_USE_OBJECT_BRACE_LITERALS -#define SEXP_USE_OBJECT_BRACE_LITERALS ! SEXP_USE_NO_FEATURES +#define SEXP_USE_OBJECT_BRACE_LITERALS (SEXP_USE_TYPE_DEFS && !SEXP_USE_NO_FEATURES) #endif #ifndef SEXP_USE_BYTEVECTOR_LITERALS @@ -527,7 +534,7 @@ #endif #ifndef SEXP_USE_IMAGE_LOADING -#define SEXP_USE_IMAGE_LOADING SEXP_USE_DL && !SEXP_USE_BOEHM && !SEXP_USE_NO_FEATURES +#define SEXP_USE_IMAGE_LOADING SEXP_USE_DL && !SEXP_USE_GLOBAL_HEAP && !SEXP_USE_BOEHM && !SEXP_USE_NO_FEATURES #endif #if SEXP_USE_NATIVE_X86 diff --git a/include/chibi/sexp.h b/include/chibi/sexp.h index ad992952..3b180699 100755 --- a/include/chibi/sexp.h +++ b/include/chibi/sexp.h @@ -693,9 +693,15 @@ SEXP_API sexp sexp_make_unsigned_integer(sexp ctx, sexp_luint_t x); else if (sexp_fixnump(x)) \ x = sexp_fx_neg(x); +#if SEXP_USE_IMMEDIATE_FLONUMS +#define sexp_negate_flonum(x) (x) = sexp_make_flonum(NULL, -(sexp_flonum_value(x))) +#else +#define sexp_negate_flonum(x) sexp_flonum_value(x) = -(sexp_flonum_value(x)) +#endif + #define sexp_negate(x) \ if (sexp_flonump(x)) \ - sexp_flonum_value(x) = -sexp_flonum_value(x); \ + sexp_negate_flonum(x); \ else \ sexp_negate_exact(x) diff --git a/opt/bignum.c b/opt/bignum.c index 33b9e02d..e74f377b 100644 --- a/opt/bignum.c +++ b/opt/bignum.c @@ -473,10 +473,10 @@ double sexp_ratio_to_double (sexp rat) { sexp sexp_double_to_ratio (sexp ctx, double f) { int sign, i; - sexp_gc_var4(res, whole, scale, tmp); + sexp_gc_var3(res, whole, scale); if (f == trunc(f)) return sexp_double_to_bignum(ctx, f); - sexp_gc_preserve4(ctx, res, whole, scale, tmp); + sexp_gc_preserve3(ctx, res, whole, scale); whole = sexp_double_to_bignum(ctx, trunc(f)); res = sexp_fixnum_to_bignum(ctx, SEXP_ZERO); scale = SEXP_ONE; @@ -492,7 +492,7 @@ sexp sexp_double_to_ratio (sexp ctx, double f) { res = sexp_make_ratio(ctx, res, scale); res = sexp_ratio_normalize(ctx, res, SEXP_FALSE); res = sexp_add(ctx, res, whole); - sexp_gc_release4(ctx); + sexp_gc_release3(ctx); return res; } @@ -605,8 +605,6 @@ sexp sexp_complex_div (sexp ctx, sexp a, sexp b) { return sexp_complex_normalize(res); } -#if SEXP_USE_MATH - static double sexp_to_double (sexp x) { if (sexp_flonump(x)) return sexp_flonum_value(x); @@ -623,33 +621,24 @@ static double sexp_to_double (sexp x) { } static sexp sexp_to_complex (sexp ctx, sexp x) { +#if SEXP_USE_RATIOS sexp_gc_var1(tmp); +#endif if (sexp_flonump(x) || sexp_fixnump(x) || sexp_bignump(x)) { return sexp_make_complex(ctx, x, SEXP_ZERO); +#if SEXP_USE_RATIOS } else if (sexp_ratiop(x)) { sexp_gc_preserve1(ctx, tmp); tmp = sexp_make_complex(ctx, SEXP_ZERO, SEXP_ZERO); sexp_complex_real(tmp) = sexp_make_flonum(ctx, sexp_to_double(x)); sexp_gc_release1(ctx); return tmp; +#endif } else { return x; } } -sexp sexp_complex_sqrt (sexp ctx, sexp z) { - double x = sexp_to_double(sexp_complex_real(z)), - y = sexp_to_double(sexp_complex_imag(z)), r; - sexp_gc_var1(res); - sexp_gc_preserve1(ctx, res); - r = sqrt(x*x + y*y); - res = sexp_make_complex(ctx, SEXP_ZERO, SEXP_ZERO); - sexp_complex_real(res) = sexp_make_flonum(ctx, sqrt((x+r)/2)); - sexp_complex_imag(res) = sexp_make_flonum(ctx, (y<0?-1:1)*sqrt((-x+r)/2)); - sexp_gc_release1(ctx); - return res; -} - sexp sexp_complex_exp (sexp ctx, sexp z) { double x = sexp_to_double(sexp_complex_real(z)), y = sexp_to_double(sexp_complex_imag(z)); @@ -662,6 +651,18 @@ sexp sexp_complex_exp (sexp ctx, sexp z) { return res; } +sexp sexp_complex_log (sexp ctx, sexp z) { + double x = sexp_to_double(sexp_complex_real(z)), + y = sexp_to_double(sexp_complex_imag(z)); + sexp_gc_var1(res); + sexp_gc_preserve1(ctx, res); + res = sexp_make_complex(ctx, SEXP_ZERO, SEXP_ZERO); + sexp_complex_real(res) = sexp_make_flonum(ctx, log(sqrt(x*x + y*y))); + sexp_complex_imag(res) = sexp_make_flonum(ctx, atan2(y, x)); + sexp_gc_release1(ctx); + return res; +} + sexp sexp_complex_expt (sexp ctx, sexp a, sexp b) { sexp_gc_var1(res); sexp_gc_preserve1(ctx, res); @@ -673,14 +674,17 @@ sexp sexp_complex_expt (sexp ctx, sexp a, sexp b) { return res; } -sexp sexp_complex_log (sexp ctx, sexp z) { +#if SEXP_USE_MATH + +sexp sexp_complex_sqrt (sexp ctx, sexp z) { double x = sexp_to_double(sexp_complex_real(z)), - y = sexp_to_double(sexp_complex_imag(z)); + y = sexp_to_double(sexp_complex_imag(z)), r; sexp_gc_var1(res); sexp_gc_preserve1(ctx, res); + r = sqrt(x*x + y*y); res = sexp_make_complex(ctx, SEXP_ZERO, SEXP_ZERO); - sexp_complex_real(res) = sexp_make_flonum(ctx, log(sqrt(x*x + y*y))); - sexp_complex_imag(res) = sexp_make_flonum(ctx, atan2(y, x)); + sexp_complex_real(res) = sexp_make_flonum(ctx, sqrt((x+r)/2)); + sexp_complex_imag(res) = sexp_make_flonum(ctx, (y<0?-1:1)*sqrt((-x+r)/2)); sexp_gc_release1(ctx); return res; } @@ -923,9 +927,11 @@ sexp sexp_add (sexp ctx, sexp a, sexp b) { break; #endif #if SEXP_USE_COMPLEX +#if SEXP_USE_RATIOS case SEXP_NUM_RAT_CPX: a = tmp = sexp_make_flonum(ctx, sexp_ratio_to_double(a)); /* ... FALLTHROUGH ... */ +#endif case SEXP_NUM_FLO_CPX: case SEXP_NUM_FIX_CPX: case SEXP_NUM_BIG_CPX: @@ -1026,12 +1032,14 @@ sexp sexp_sub (sexp ctx, sexp a, sexp b) { break; #endif #if SEXP_USE_COMPLEX +#if SEXP_USE_RATIOS case SEXP_NUM_RAT_CPX: a = tmp1 = sexp_make_flonum(ctx, sexp_ratio_to_double(a)); goto complex_sub; case SEXP_NUM_CPX_RAT: b = tmp1 = sexp_make_flonum(ctx, sexp_ratio_to_double(b)); /* ... FALLTHROUGH ... */ +#endif case SEXP_NUM_CPX_FLO: case SEXP_NUM_CPX_FIX: case SEXP_NUM_CPX_BIG: @@ -1044,7 +1052,9 @@ sexp sexp_sub (sexp ctx, sexp a, sexp b) { a = tmp1 = sexp_make_complex(ctx, a, SEXP_ZERO); /* ... FALLTHROUGH ... */ case SEXP_NUM_CPX_CPX: +#if SEXP_USE_RATIOS complex_sub: +#endif r = sexp_complex_sub(ctx, a, b); if (negatep) { if (sexp_complexp(r)) { @@ -1107,8 +1117,11 @@ sexp sexp_mul (sexp ctx, sexp a, sexp b) { break; #endif #if SEXP_USE_COMPLEX +#if SEXP_USE_RATIOS case SEXP_NUM_RAT_CPX: a = tmp = sexp_make_flonum(ctx, sexp_ratio_to_double(a)); + /* ... FALLTHROUGH ... */ +#endif case SEXP_NUM_FLO_CPX: case SEXP_NUM_FIX_CPX: case SEXP_NUM_BIG_CPX: @@ -1129,8 +1142,8 @@ sexp sexp_div (sexp ctx, sexp a, sexp b) { double f; #endif sexp r=SEXP_VOID; - sexp_gc_var2(tmp, rem); - sexp_gc_preserve2(ctx, tmp, rem); + sexp_gc_var1(tmp); + sexp_gc_preserve1(ctx, tmp); switch ((at * SEXP_NUM_NUMBER_TYPES) + bt) { case SEXP_NUM_NOT_NOT: case SEXP_NUM_NOT_FIX: case SEXP_NUM_NOT_FLO: case SEXP_NUM_NOT_BIG: @@ -1189,8 +1202,8 @@ sexp sexp_div (sexp ctx, sexp a, sexp b) { tmp = sexp_make_ratio(ctx, a, b); r = sexp_ratio_normalize(ctx, tmp, SEXP_FALSE); #else - r = sexp_bignum_quot_rem(ctx, &rem, a, b); - if (sexp_bignum_normalize(rem) != SEXP_ZERO) + r = sexp_bignum_quot_rem(ctx, &tmp, a, b); + if (sexp_bignum_normalize(tmp) != SEXP_ZERO) r = sexp_make_flonum(ctx, sexp_bignum_to_double(a) / sexp_bignum_to_double(b)); else @@ -1210,6 +1223,7 @@ sexp sexp_div (sexp ctx, sexp a, sexp b) { case SEXP_NUM_RAT_FIX: case SEXP_NUM_RAT_BIG: b = tmp = sexp_make_ratio(ctx, b, SEXP_ONE); + /* ... FALLTHROUGH ... */ case SEXP_NUM_FIX_RAT: case SEXP_NUM_BIG_RAT: if (!sexp_ratiop(a)) @@ -1220,15 +1234,22 @@ sexp sexp_div (sexp ctx, sexp a, sexp b) { break; #endif #if SEXP_USE_COMPLEX +#if SEXP_USE_RATIOS case SEXP_NUM_CPX_RAT: b = tmp = sexp_make_flonum(ctx, sexp_ratio_to_double(b)); + /* ... FALLTHROUGH ... */ +#endif case SEXP_NUM_CPX_FLO: case SEXP_NUM_CPX_FIX: case SEXP_NUM_CPX_BIG: b = tmp = sexp_make_complex(ctx, b, SEXP_ZERO); + /* ... FALLTHROUGH ... */ +#if SEXP_USE_RATIOS case SEXP_NUM_RAT_CPX: if (sexp_ratiop(a)) a = tmp = sexp_make_flonum(ctx, sexp_ratio_to_double(a)); + /* ... FALLTHROUGH ... */ +#endif case SEXP_NUM_FLO_CPX: case SEXP_NUM_FIX_CPX: case SEXP_NUM_BIG_CPX: @@ -1240,7 +1261,7 @@ sexp sexp_div (sexp ctx, sexp a, sexp b) { break; #endif } - sexp_gc_release2(ctx); + sexp_gc_release1(ctx); return r; } @@ -1264,7 +1285,10 @@ sexp sexp_quotient (sexp ctx, sexp a, sexp b) { #endif #if SEXP_USE_COMPLEX case SEXP_NUM_FLO_CPX: case SEXP_NUM_CPX_FIX: case SEXP_NUM_CPX_FLO: - case SEXP_NUM_CPX_BIG: case SEXP_NUM_CPX_RAT: case SEXP_NUM_CPX_CPX: + case SEXP_NUM_CPX_BIG: case SEXP_NUM_CPX_CPX: +#if SEXP_USE_RATIOS + case SEXP_NUM_CPX_RAT: +#endif #endif r = sexp_type_exception(ctx, NULL, SEXP_FIXNUM, a); break; @@ -1314,7 +1338,10 @@ sexp sexp_remainder (sexp ctx, sexp a, sexp b) { #endif #if SEXP_USE_COMPLEX case SEXP_NUM_FLO_CPX: case SEXP_NUM_CPX_FIX: case SEXP_NUM_CPX_FLO: - case SEXP_NUM_CPX_BIG: case SEXP_NUM_CPX_RAT: case SEXP_NUM_CPX_CPX: + case SEXP_NUM_CPX_BIG: case SEXP_NUM_CPX_CPX: +#if SEXP_USE_RATIOS + case SEXP_NUM_CPX_RAT: +#endif #endif r = sexp_type_exception(ctx, NULL, SEXP_FIXNUM, a); break; @@ -1358,8 +1385,11 @@ sexp sexp_compare (sexp ctx, sexp a, sexp b) { case SEXP_NUM_NOT_NOT: case SEXP_NUM_NOT_FIX: case SEXP_NUM_NOT_FLO: case SEXP_NUM_NOT_BIG: #if SEXP_USE_COMPLEX - case SEXP_NUM_CPX_CPX: case SEXP_NUM_CPX_FIX: case SEXP_NUM_CPX_RAT: + case SEXP_NUM_CPX_CPX: case SEXP_NUM_CPX_FIX: case SEXP_NUM_CPX_FLO: case SEXP_NUM_CPX_BIG: +#if SEXP_USE_RATIOS + case SEXP_NUM_CPX_RAT: +#endif #endif r = sexp_type_exception(ctx, NULL, SEXP_NUMBER, a); break; diff --git a/sexp.c b/sexp.c index 9340acf7..8ad769c2 100644 --- a/sexp.c +++ b/sexp.c @@ -135,6 +135,9 @@ sexp sexp_finalize_dl (sexp ctx sexp_api_params(self, n), sexp dl) { dlclose(sexp_dl_handle(dl)); return SEXP_VOID; } +#define SEXP_FINALIZE_DL sexp_finalize_dl +#else +#define SEXP_FINALIZE_DL NULL #endif static struct sexp_type_struct _sexp_type_specs[] = { @@ -171,7 +174,7 @@ static struct sexp_type_struct _sexp_type_specs[] = { {SEXP_BYTECODE, sexp_offsetof(bytecode, name), 3, 3, 0, 0, sexp_sizeof(bytecode), offsetof(struct sexp_struct, value.bytecode.length), 1, 0, 0, 0, 0, 0, 0, (sexp)"Bytecode", SEXP_FALSE, SEXP_FALSE, NULL, SEXP_FALSE, NULL, NULL}, {SEXP_CORE, sexp_offsetof(core, name), 1, 1, 0, 0, sexp_sizeof(core), 0, 0, 0, 0, 0, 0, 0, 0, (sexp)"Core-Form", SEXP_FALSE, SEXP_FALSE, NULL, SEXP_FALSE, NULL, NULL}, #if SEXP_USE_DL - {SEXP_DL, sexp_offsetof(dl, file), 1, 1, 0, 0, sexp_sizeof(dl), 0, 0, 0, 0, 0, 0, 0, 0, (sexp)"Dynamic-Library", SEXP_FALSE, SEXP_FALSE, NULL, SEXP_FALSE, sexp_finalize_dl, NULL}, + {SEXP_DL, sexp_offsetof(dl, file), 1, 1, 0, 0, sexp_sizeof(dl), 0, 0, 0, 0, 0, 0, 0, 0, (sexp)"Dynamic-Library", SEXP_FALSE, SEXP_FALSE, NULL, SEXP_FALSE, SEXP_FINALIZE_DL, NULL}, #endif {SEXP_OPCODE, sexp_offsetof(opcode, name), 8+SEXP_USE_DL, 8+SEXP_USE_DL, 0, 0, sexp_sizeof(opcode), 0, 0, 0, 0, 0, 0, 0, 0, (sexp)"Opcode", SEXP_FALSE, SEXP_FALSE, NULL, SEXP_FALSE, NULL, NULL}, {SEXP_LAMBDA, sexp_offsetof(lambda, name), 11, 11, 0, 0, sexp_sizeof(lambda), 0, 0, 0, 0, 0, 0, 0, 0, (sexp)"Lambda", SEXP_FALSE, SEXP_FALSE, NULL, SEXP_FALSE, NULL, (sexp_proc4)sexp_write_simple_object}, @@ -243,7 +246,9 @@ sexp sexp_register_type_op (sexp ctx sexp_api_params(self, n), sexp name, sexp_type_name(type) = name; sexp_type_finalize(type) = f; sexp_type_id(type) = SEXP_FALSE; +#if SEXP_USE_DL if (f) sexp_type_dl(type) = sexp_context_dl(ctx); +#endif sexp_type_print(type) = p; if (sexp_typep(parent)) { len = sexp_vectorp(sexp_type_cpl(parent)) ? sexp_vector_length(sexp_type_cpl(parent)) : 1; @@ -874,7 +879,11 @@ sexp sexp_string_index_to_offset (sexp ctx sexp_api_params(self, n), sexp str, s sexp sexp_make_string_op (sexp ctx sexp_api_params(self, n), sexp len, sexp ch) { sexp i = (sexp_charp(ch) ? sexp_make_fixnum(sexp_unbox_character(ch)) : ch); +#if SEXP_USE_PACKED_STRINGS + sexp b; +#else sexp_gc_var2(b, s); +#endif #if SEXP_USE_UTF8_STRINGS int j, clen; if (sexp_charp(ch) && (sexp_unbox_character(ch) >= 0x80)) { @@ -989,18 +998,22 @@ static sexp_uint_t sexp_string_hash(const char *str, sexp_sint_t len, sexp sexp_intern(sexp ctx, const char *str, sexp_sint_t len) { #if SEXP_USE_HUFF_SYMS struct sexp_huff_entry he; - sexp_uint_t space=3, newbits; + sexp_sint_t space, newbits; char c; #endif - sexp_uint_t res=FNV_OFFSET_BASIS, bucket, i=0; - const char *p=str; sexp ls, tmp; sexp_gc_var1(sym); + sexp_sint_t bucket=0; +#if (SEXP_USE_HASH_SYMS || SEXP_USE_HUFF_SYMS) + sexp_sint_t i=0, res=FNV_OFFSET_BASIS; + const char *p=str; +#endif if (len < 0) len = strlen(str); #if SEXP_USE_HUFF_SYMS res = 0; + space = 3; if (len == 0) goto normal_intern; for ( ; i&1 >/dev/null if $MAKE $opts chibi-scheme 2>&1 >${BUILDDIR}/build${i}-make.out; then if $MAKE test 2>&1 | tee ${BUILDDIR}/build${i}-test.out | grep -q -E 'FAIL|ERROR'; then diff --git a/vm.c b/vm.c index 12dd0b69..f4c5aca3 100644 --- a/vm.c +++ b/vm.c @@ -2,6 +2,8 @@ /* Copyright (c) 2009-2011 Alex Shinn. All rights reserved. */ /* BSD-style license: http://synthcode.com/license.txt */ +#include + #if SEXP_USE_DEBUG_VM > 1 static void sexp_print_stack (sexp ctx, sexp *stack, int top, int fp, sexp out) { int i;