klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

commit cbe7b0c46f79188ba0f745071bdaf5fa46cf1707
parent 8cef078a1936124e7724fd018fad15d8a31f4007
Author: stevej <devnull@localhost>
Date:   Sun, 19 Feb 2012 20:13:07 -0800

port to gcc 4.2 on os x lion

Diffstat:
Msrc/Makefile | 4++--
Msrc/kenvironment.c | 4++--
Msrc/keval.c | 2+-
Msrc/kghelpers.c | 8++++----
Msrc/kghelpers.h | 2+-
Msrc/kpair.h | 4++--
Msrc/kport.h | 3+--
Msrc/krational.h | 2+-
Msrc/kstate.c | 2+-
Msrc/kstate.h | 2+-
10 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/Makefile b/src/Makefile @@ -9,11 +9,11 @@ PLAT= none CC=gcc # TEMP for now put in debug symbols # TEMP for now only 32 bit binaries (see kobject.h) -CFLAGS=-O2 -g -std=c99 -Wall -m32 $(MYCFLAGS) +CFLAGS=-arch i386 -O2 -g -std=c99 -Wall -m32 $(MYCFLAGS) AR= ar rcu RANLIB= ranlib RM= rm -f -LIBS= -lm $(MYLIBS) +LIBS= -arch i386 -lm $(MYLIBS) # Set USE_LIBFFI=1 (or other nonempty string) to enable libffi-dependent # code. diff --git a/src/kenvironment.c b/src/kenvironment.c @@ -185,7 +185,7 @@ void kadd_binding(klisp_State *K, TValue env, TValue sym, TValue val) /* This works no matter if parents is a list or a single environment */ /* GC: assumes env & sym are rooted */ -inline bool try_get_binding(klisp_State *K, TValue env, TValue sym, +static inline bool try_get_binding(klisp_State *K, TValue env, TValue sym, TValue *value) { /* assume the stack may be in use, keep track of pushed objs */ @@ -266,7 +266,7 @@ TValue kmake_keyed_static_env(klisp_State *K, TValue parent, TValue key, } /* GC: assumes parent, key & env are rooted */ -inline bool try_get_keyed(klisp_State *K, TValue env, TValue key, +static inline bool try_get_keyed(klisp_State *K, TValue env, TValue key, TValue *value) { /* MAYBE: this could be optimized to mark environments to avoid diff --git a/src/keval.c b/src/keval.c @@ -67,7 +67,7 @@ inline void clear_ls_marks(TValue ls) } /* operands should be a pair, and should be rooted (GC) */ -inline TValue make_arg_ls(klisp_State *K, TValue operands, TValue *tail) +static inline TValue make_arg_ls(klisp_State *K, TValue operands, TValue *tail) { TValue arg_ls = kcons(K, kcar(operands), KNIL); krooted_tvs_push(K, arg_ls); /* root the constructed list */ diff --git a/src/kghelpers.c b/src/kghelpers.c @@ -887,7 +887,7 @@ bool eq2p(klisp_State *K, TValue obj1, TValue obj2) /* find "name" of the set of this obj, if there isn't one create it, if there is one, flatten its branch */ -inline TValue equal_find(klisp_State *K, TValue obj) +static inline TValue equal_find(klisp_State *K, TValue obj) { /* GC: should root obj */ if (kis_unmarked(obj)) { @@ -920,7 +920,7 @@ inline TValue equal_find(klisp_State *K, TValue obj) } /* merge the smaller set into the big one, if both are equal just pick one */ -inline void equal_merge(klisp_State *K, TValue root1, TValue root2) +static inline void equal_merge(klisp_State *K, TValue root1, TValue root2) { /* K isn't needed but added for consistency */ UNUSED(K); @@ -943,7 +943,7 @@ inline void equal_merge(klisp_State *K, TValue root1, TValue root2) /* check to see if two objects were already compared, and return that. If they weren't compared yet, merge their sets (and flatten their branches) */ -inline bool equal_find2_mergep(klisp_State *K, TValue obj1, TValue obj2) +static inline bool equal_find2_mergep(klisp_State *K, TValue obj1, TValue obj2) { /* GC: should root root1 and root2 */ TValue root1 = equal_find(K, obj1); @@ -1787,7 +1787,7 @@ TValue make_bind_continuation(klisp_State *K, TValue key, /* TODO: this isn't very clean, refactor */ /* GC: assumes obj & root are rooted */ -inline TValue check_copy_single_entry(klisp_State *K, char *name, +static inline TValue check_copy_single_entry(klisp_State *K, char *name, TValue obj, TValue root) { if (!ttispair(obj) || !ttispair(kcdr(obj)) || diff --git a/src/kghelpers.h b/src/kghelpers.h @@ -316,7 +316,7 @@ inline void unmark_list(klisp_State *K, TValue obj) } } -inline void unmark_tree(klisp_State *K, TValue obj) +static inline void unmark_tree(klisp_State *K, TValue obj) { assert(ks_sisempty(K)); diff --git a/src/kpair.h b/src/kpair.h @@ -17,13 +17,13 @@ bool kpairp(TValue obj); bool kimmutable_pairp(TValue obj); bool kmutable_pairp(TValue obj); -inline TValue kcar(TValue p) +static inline TValue kcar(TValue p) { klisp_assert(kpairp(p)); return tv2pair(p)->car; } -inline TValue kcdr(TValue p) +static inline TValue kcdr(TValue p) { klisp_assert(kpairp(p)); return tv2pair(p)->cdr; diff --git a/src/kport.h b/src/kport.h @@ -55,6 +55,5 @@ void kclose_port(klisp_State *K, TValue port); void kport_reset_source_info(TValue port); void kport_update_source_info(TValue port, int32_t line, int32_t col); /* GC: port should be rooted */ -void kmport_resize_buffer(klisp_State *K, TValue port, uint32_t min_size); - +void kmport_resize_buffer(klisp_State *K, TValue port, size_t min_size); #endif diff --git a/src/krational.h b/src/krational.h @@ -19,7 +19,7 @@ /* TEMP: for now we only implement bigrats (memory allocated) */ /* This tries to convert a bigrat to a fixint or a bigint */ -inline TValue kbigrat_try_integer(klisp_State *K, TValue n) +static inline TValue kbigrat_try_integer(klisp_State *K, TValue n) { Bigrat *b = tv2bigrat(n); diff --git a/src/kstate.c b/src/kstate.c @@ -451,7 +451,7 @@ TValue select_interceptor(TValue guard_ls) */ /* GC: assume src_cont & dst_cont are rooted */ -inline TValue create_interception_list(klisp_State *K, TValue src_cont, +static inline TValue create_interception_list(klisp_State *K, TValue src_cont, TValue dst_cont) { mark_iancestors(dst_cont); diff --git a/src/kstate.h b/src/kstate.h @@ -329,7 +329,7 @@ inline bool ks_tbisempty(klisp_State *K) ** Functions to protect values from GC ** TODO: add write barriers */ -inline void krooted_tvs_push(klisp_State *K, TValue tv) +static inline void krooted_tvs_push(klisp_State *K, TValue tv) { klisp_assert(K->rooted_tvs_top < GC_PROTECT_SIZE); K->rooted_tvs_buf[K->rooted_tvs_top++] = tv;