tisp

tiny lisp
git clone git://edryd.org/tisp
Log | Files | Refs | LICENSE

commit 8b19ac55a39fb0d743b921797b8e173fa45157ef
parent 596d3d79e67c9cbdcbb28204e62bdce5395f99b2
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Mon, 27 Jan 2020 12:47:06 -0800

Remove need for DEBUG flag in tisp.c and header

Diffstat:
Makefile | 2+-
tisp.c | 3---
tisp.h | 17+++--------------
3 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile @@ -4,7 +4,7 @@ include config.mk ifeq ($(DEBUG), 1) -CFLAGS += -g -Og -DDEBUG +CFLAGS += -g -Og LDFLAGS += -g -Og endif diff --git a/tisp.c b/tisp.c @@ -987,9 +987,6 @@ prim_load(Tsp st, Hash env, Val args) void (*tibenv)(Tsp); char *name; const char *paths[] = { -#ifdef DEBUG - "./", /* check working directory first when in debug mode */ -#endif "/usr/local/share/tisp/", "/usr/share/tisp/", "./", NULL }; diff --git a/tisp.h b/tisp.h @@ -19,27 +19,16 @@ * 3. This notice may not be removed or altered from any source distribution. */ -#ifdef DEBUG -# define tsp_warnf(M, ...) do { \ - fprintf(stderr, "tisp:%s:%d: error: " M "\n", \ - __FILE__, __LINE__, ##__VA_ARGS__); \ - return NULL; \ -} while(0) -# define tsp_warn(M) do { \ - fprintf(stderr, "tisp:%s:%d: error: " M "\n", __FILE__, __LINE__); \ - return NULL; \ -} while(0) -#else -# define tsp_warnf(M, ...) do { \ +#define tsp_warnf(M, ...) do { \ fprintf(stderr, "tisp: error: " M "\n", ##__VA_ARGS__); \ return NULL; \ } while(0) -# define tsp_warn(M) do { \ +#define tsp_warn(M) do { \ fprintf(stderr, "tisp: error: " M "\n"); \ return NULL; \ } while(0) -#endif +/* TODO test general condition */ #define tsp_arg_min(ARGS, NAME, NARGS) do { \ if (list_len(ARGS) < NARGS) \ tsp_warnf("%s: expected at least %d argument%s, received %d", \