diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-01-20 23:51:50 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-01-20 23:51:50 -0800 |
commit | 366a7fba840293f54ae49108f4bc5d3d94c848c4 (patch) | |
tree | fcb82613411d437840bebbb08b9de778d562d234 | |
parent | c6d7e940e105958e4303eba504cf147b7f428cdf (diff) | |
download | txr-366a7fba840293f54ae49108f4bc5d3d94c848c4.tar.gz txr-366a7fba840293f54ae49108f4bc5d3d94c848c4.tar.bz2 txr-366a7fba840293f54ae49108f4bc5d3d94c848c4.zip |
fix --no-gen-gc configuration.
This fixes only the build. I'm getting a crash in
one test case, namely tests/010/json.tl.
* lib.h (mut): Remove stray semicolon from definition.
This semicolon compensates for the lack of a semicolon
in txr.c, which becomes a syntax errror under no-gen-gc,
when the other definition of mut is active.
(mkloc, setcheck): Let's add casts of the object argument
to void. This gets rid of a number of unused parameter
errors in various functions that take an object parameter
that is only used in the case of generational GC.
* txr.c (txr_main): Add missing semicolon after mut call.
* gc.c (gc_wrap): In the no CONFIG_GEN_GC case, cast
argument full to void, since it is unused.
-rw-r--r-- | gc.c | 2 | ||||
-rw-r--r-- | lib.h | 6 | ||||
-rw-r--r-- | txr.c | 2 |
3 files changed, 6 insertions, 4 deletions
@@ -1053,6 +1053,8 @@ static val gc_wrap(val full) #if CONFIG_GEN_GC if (!null_or_missing_p(full)) full_gc = 1; +#else + (void) full; #endif gc(); return t; @@ -411,18 +411,18 @@ INLINE loc mkloc_fun(val *ptr, val obj) #define valptr(lo) ((lo).ptr) #define set(lo, val) (gc_set(lo, val)) #define setcheck(tgt, src) (gc_assign_check(tgt, src)) -#define mut(obj) (gc_mutated(obj)); +#define mut(obj) (gc_mutated(obj)) #define mpush(val, lo) (gc_push(val, lo)) #else typedef val *loc; -#define mkloc(expr, obj) (&(expr)) +#define mkloc(expr, obj) ((void) (obj), &(expr)) #define mkcloc(expr) (&(expr)) #define nulloc ((loc) 0) #define nullocp(lo) (!(lo)) #define deref(lo) (*(lo)) #define valptr(lo) (lo) #define set(lo, val) (*(lo) = (val)) -#define setcheck(tgt, src) ((void) 0) +#define setcheck(tgt, src) ((void) (tgt)) #define mut(obj) ((void) (obj)) #define mpush(val, lo) (push(val, lo)) #endif @@ -1208,7 +1208,7 @@ int txr_main(int argc, char **argv) val parser_obj = ensure_parser(parse_stream, spec_file_str); parser_t *parser = parser_get_impl(prog_string, parser_obj); parse_once_noerr(parse_stream, spec_file_str); - mut(parser_obj) + mut(parser_obj); gc_state(gc); close_stream(parse_stream, nil); |