fixes for alternate compile options

This commit is contained in:
Alex Shinn 2009-06-22 21:30:14 +09:00
parent 3d46acee56
commit 097d6705de
3 changed files with 7 additions and 6 deletions

View file

@ -44,7 +44,7 @@ XCPPFLAGS := $(CPPFLAGS) -Iinclude
endif endif
XLDFLAGS := $(LDFLAGS) $(GCLDFLAGS) -lm 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 INCLUDES = include/chibi/sexp.h include/chibi/config.h include/chibi/install.h

View file

@ -35,8 +35,8 @@
/* uncomment this to enable stack overflow checks */ /* uncomment this to enable stack overflow checks */
/* #define USE_CHECK_STACK 1 */ /* #define USE_CHECK_STACK 1 */
/* uncomment this to enable debugging utilities */ /* uncomment this to disable debugging utilities */
/* #define USE_DEBUG 1 */ /* #define USE_DEBUG 0 */
/************************************************************************/ /************************************************************************/
/* DEFAULTS - DO NOT MODIFY ANYTHING BELOW THIS LINE */ /* DEFAULTS - DO NOT MODIFY ANYTHING BELOW THIS LINE */

7
sexp.c
View file

@ -6,11 +6,12 @@
#include "chibi/sexp.h" #include "chibi/sexp.h"
/* optional huffman-compressed immediate symbols */ /* optional huffman-compressed immediate symbols */
#if USE_HUFF_SYMS
struct sexp_huff_entry { struct sexp_huff_entry {
unsigned char len; unsigned char len;
unsigned short bits; unsigned short bits;
}; };
#if USE_HUFF_SYMS
#include "opt/sexp-hufftabs.c" #include "opt/sexp-hufftabs.c"
static struct sexp_huff_entry huff_table[] = { static struct sexp_huff_entry huff_table[] = {
#include "opt/sexp-huff.c" #include "opt/sexp-huff.c"
@ -433,11 +434,11 @@ sexp sexp_substring (sexp ctx, sexp str, sexp start, sexp end) {
return res; return res;
} }
#if USE_HASH_SYMS
#define FNV_PRIME 16777619 #define FNV_PRIME 16777619
#define FNV_OFFSET_BASIS 2166136261uL #define FNV_OFFSET_BASIS 2166136261uL
#if USE_HASH_SYMS
static sexp_uint_t sexp_string_hash(char *str, sexp_uint_t acc) { static sexp_uint_t sexp_string_hash(char *str, sexp_uint_t acc) {
while (*str) {acc *= FNV_PRIME; acc ^= *str++;} while (*str) {acc *= FNV_PRIME; acc ^= *str++;}
return acc; return acc;