From 097d6705defe3a00769623f569493409dff99594 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Mon, 22 Jun 2009 21:30:14 +0900 Subject: [PATCH] fixes for alternate compile options --- Makefile | 2 +- include/chibi/config.h | 4 ++-- sexp.c | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1f900f0a..bad4dbfd 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ XCPPFLAGS := $(CPPFLAGS) -Iinclude endif XLDFLAGS := $(LDFLAGS) $(GCLDFLAGS) -lm -XCFLAGS := $(CFLAGS) -Wall -O2 -g +XCFLAGS := -Wall -O2 -g $(CFLAGS) INCLUDES = include/chibi/sexp.h include/chibi/config.h include/chibi/install.h diff --git a/include/chibi/config.h b/include/chibi/config.h index 07b993eb..49661145 100644 --- a/include/chibi/config.h +++ b/include/chibi/config.h @@ -35,8 +35,8 @@ /* uncomment this to enable stack overflow checks */ /* #define USE_CHECK_STACK 1 */ -/* uncomment this to enable debugging utilities */ -/* #define USE_DEBUG 1 */ +/* uncomment this to disable debugging utilities */ +/* #define USE_DEBUG 0 */ /************************************************************************/ /* DEFAULTS - DO NOT MODIFY ANYTHING BELOW THIS LINE */ diff --git a/sexp.c b/sexp.c index 82c0b73d..12ed719f 100644 --- a/sexp.c +++ b/sexp.c @@ -6,11 +6,12 @@ #include "chibi/sexp.h" /* optional huffman-compressed immediate symbols */ -#if USE_HUFF_SYMS struct sexp_huff_entry { unsigned char len; unsigned short bits; }; + +#if USE_HUFF_SYMS #include "opt/sexp-hufftabs.c" static struct sexp_huff_entry huff_table[] = { #include "opt/sexp-huff.c" @@ -433,11 +434,11 @@ sexp sexp_substring (sexp ctx, sexp str, sexp start, sexp end) { return res; } -#if USE_HASH_SYMS - #define FNV_PRIME 16777619 #define FNV_OFFSET_BASIS 2166136261uL +#if USE_HASH_SYMS + static sexp_uint_t sexp_string_hash(char *str, sexp_uint_t acc) { while (*str) {acc *= FNV_PRIME; acc ^= *str++;} return acc;