summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-04-05 19:06:54 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-04-05 19:06:54 -0700
commit579a30ef3f8a6656c4db38d43c34f4dc3403af33 (patch)
tree17b0056cc5ea355414027880451c66279a2d003c
parentaaf349ac030e98892b5e8a7f4feee4ec644f342f (diff)
downloadtxr-579a30ef3f8a6656c4db38d43c34f4dc3403af33.tar.gz
txr-579a30ef3f8a6656c4db38d43c34f4dc3403af33.tar.bz2
txr-579a30ef3f8a6656c4db38d43c34f4dc3403af33.zip
warning cleanup: add casts for unused parameters.
This is the first round of an effort to enable GCC's -Wextra option. All function parameters that are unused an that we cannot eliminate are treated with a cast to void in the function body. * args.c (args_key_check_store): Cast unused param to void. * combi.c (perm_list_gen_fill): Likewise. * eval.c (op_error, op_meta_error, op_quote op_qquote_error, op_unquote_error, op_load_time_lit, me_each, me_for, me_quasilist, me_flet_labels, hash_min_max, me_ignerr, me_whilet, me_iflet_whenlet, me_dotimes, me_mlet, me_load_time, me_load_for): Likewise. * ffi.c (ffi_void_put, ffi_fixed_dynsize, *ffi_fixed_alloc, ffi_noop_free, ffi_void_get, ffi_simple_release, ffi_i8_put, ffi_i8_get, ffi_u8_put, ffi_u8_get, ffi_i16_put, ffi_i16_get, ffi_u16_put, ffi_u16_get, ffi_i32_put, ffi_i32_get, ffi_u32_put, ffi_u32_get, ffi_i64_put, ffi_i64_get, ffi_u64_put, ffi_u64_get, ffi_char_put, ffi_char_get, ffi_uchar_put, ffi_uchar_get, ffi_bchar_get, ffi_short_put, ffi_short_get, ffi_ushort_put, ffi_ushort_get, ffi_int_put, ffi_int_get, ffi_uint_put, ffi_uint_get, ffi_long_put, ffi_long_get, ffi_ulong_put, ffi_ulong_get, ffi_float_put, ffi_float_get, ffi_double_put, ffi_double_get, ffi_val_put, ffi_val_get, ffi_be_i16_put, ffi_be_i16_get, ffi_be_u16_put, ffi_be_u16_get, ffi_le_i16_put, ffi_le_i16_get, ffi_le_u16_put, ffi_le_u16_get, ffi_be_i32_put, ffi_be_i32_get, ffi_be_u32_put, ffi_be_u32_get, ffi_le_i32_put, ffi_le_i32_get, ffi_le_u32_put, ffi_le_u32_get, ffi_be_i64_put, ffi_be_i64_get, ffi_be_u64_put, ffi_be_u64_get, ffi_le_i64_put, ffi_le_i64_get, ffi_le_u64_put, ffi_le_u64_get, ffi_wchar_put, ffi_wchar_get, ffi_sbit_get, ffi_ubit_get, ffi_cptr_get, ffi_str_in, ffi_str_put, ffi_str_get, ffi_str_d_get, ffi_wstr_in, ffi_wstr_get, ffi_wstr_put, ffi_wstr_d_get, ffi_bstr_in, ffi_bstr_put, ffi_bstr_get, ffi_bstr_d_get, ffi_buf_in, ffi_buf_put, ffi_buf_get, ffi_buf_d_in, ffi_buf_d_put, ffi_buf_d_get, ffi_closure_put, ffi_ptr_in_in, ffi_ptr_in_d_in, ffi_ptr_in_out, ffi_ptr_out_in, ffi_ptr_out_out, ffi_ptr_out_null_put, ffi_ptr_out_s_in, ffi_flex_struct_in, ffi_carray_get, ffi_union_get, make_ffi_type_builtin, make_ffi_type_array, ffi_closure_dispatch, ffi_closure_dispatch_safe): Likewise. * gc.c (cobj_destroy_stub_op, cobj_destroy_free_op, cobj_mark_op): Likewise. * lib.c (seq_iter_get_nil, seq_iter_peek_nil): Likewise. * linenoise/linenoise.c (sigwinch_handler): Likewise. * parser.c (repl_intr, read_eval_ret_last, repl_warning, is_balanced_line): Likewise. * parser.y (yydebug_onoff): Likewise. * socket.c (dgram_close): Likewise. * stream.c (unimpl_put_string, unimpl_put_char, unimpl_put_byte, unimpl_unget_char, unimpl_unget_byte, unimpl_put_buf, unimpl_fill_buf, unimpl_seek, unimpl_truncate, unimpl_set_sock_peer, null_put_string, null_put_char, null_put_byte, null_get_line, null_get_char, null_get_byte, null_close, null_flush, null_seek, null_set_prop, null_get_error, null_get_error_str, null_clear_error, null_get_fd, dir_close): Likewise. * struct.c (struct_type_print): Likewise. * unwind.c (me_defex): Likewise.
-rw-r--r--args.c2
-rw-r--r--combi.c1
-rw-r--r--eval.c28
-rw-r--r--ffi.c196
-rw-r--r--gc.c2
-rw-r--r--lib.c4
-rw-r--r--linenoise/linenoise.c2
-rw-r--r--parser.c8
-rw-r--r--parser.y2
-rw-r--r--socket.c3
-rw-r--r--stream.c36
-rw-r--r--struct.c1
-rw-r--r--unwind.c2
13 files changed, 283 insertions, 4 deletions
diff --git a/args.c b/args.c
index cb8c062b..92b65a94 100644
--- a/args.c
+++ b/args.c
@@ -177,6 +177,8 @@ static int args_key_check_store(val arg, int ix, mem_t *ctx)
struct args_bool_ctx *acx = coerce(struct args_bool_ctx *, ctx);
int i, n = acx->n;
+ (void) ix;
+
if (acx->next_arg_store != 0) {
*acx->next_arg_store = arg;
acx->next_arg_store = 0;
diff --git a/combi.c b/combi.c
index 75a98956..3795fc76 100644
--- a/combi.c
+++ b/combi.c
@@ -149,6 +149,7 @@ static void perm_list_gen_fill(val out, cnum i, val v)
{
val tail = cdr(out);
val nc = cons(v, nil);
+ (void) i;
if (tail)
rplacd(tail, nc);
else
diff --git a/eval.c b/eval.c
index d9dd0b3d..36ec85b3 100644
--- a/eval.c
+++ b/eval.c
@@ -1644,18 +1644,21 @@ static val eval_prog1(val forms, val env, val ctx)
static val op_error(val form, val env)
{
+ (void) env;
eval_error(form, lit("unexpanded ~s encountered"), car(form), nao);
abort();
}
static val op_meta_error(val form, val env)
{
+ (void) env;
eval_error(form, lit("meta with no meaning: ~s"), form, nao);
}
static val op_quote(val form, val env)
{
val d = cdr(form);
+ (void) env;
if (!consp(d) || cdr(d))
eval_error(form, lit("bad quote syntax: ~s"), form, nao);
@@ -1664,14 +1667,14 @@ static val op_quote(val form, val env)
static val op_qquote_error(val form, val env)
{
+ (void) env;
eval_error(form, lit("unexpanded quasiquote encountered"), nao);
- return second(form);
}
static val op_unquote_error(val form, val env)
{
+ (void) env;
eval_error(form, lit("unquote/splice without matching quote"), nao);
- return second(form);
}
struct bindings_helper_vars {
@@ -2992,6 +2995,7 @@ static val op_upenv(val form, val env)
static val op_load_time_lit(val form, val env)
{
+ (void) env;
val args = cdr(form);
if (car(args)) {
return cadr(args);
@@ -3065,7 +3069,7 @@ static val me_each(val form, val menv)
val append = or2(eq(each, append_each_s), eq(each, append_each_star_s));
val eff_each = if3(collect, collect_each_s,
if3(append, append_each_s, each_s));
-
+ (void) menv;
return list(if3(star, let_star_s, let_s), vars,
cons(each_op_s, cons(eff_each,
cons(if2(star || specials_occur, var_syms),
@@ -3081,6 +3085,7 @@ static val me_for(val form, val menv)
int oldscope = opt_compat && opt_compat <= 123;
val basic = list(if3(forsym == for_star_s, let_star_s, let_s),
vars, cons(for_op_s, cons(nil, body)), nao);
+ (void) menv;
return if3(oldscope,
basic,
list(block_s, nil, basic, nao));
@@ -3184,6 +3189,7 @@ static val me_while_until_star(val form, val menv)
static val me_quasilist(val form, val menv)
{
+ (void) menv;
return cons(list_s, cdr(form));
}
@@ -3917,6 +3923,8 @@ static val me_flet_labels(val form, val menv)
val funcs = pop(&body);
list_collect_decl (lambdas, ptail);
+ (void) menv;
+
for (; funcs; funcs = cdr(funcs)) {
val func = car(funcs);
val name = pop(&func);
@@ -3938,6 +3946,7 @@ static val compares_with_eq(val obj)
static val hash_min_max(val env, val key, val value)
{
cons_bind (minkey, maxkey, env);
+ (void) value;
if (!minkey || lt(key, minkey))
minkey = key;
if (!maxkey || gt(key, maxkey))
@@ -3971,6 +3980,8 @@ static val me_case(val form, val menv)
list_collect_decl (condpairs, ptail);
list_collect_decl (hashforms, qtail);
+ (void) menv;
+
if (atom(cdr(form_orig)))
eval_error(form_orig, lit("~s: missing test form"), casesym, nao);
@@ -4160,6 +4171,7 @@ static val me_tc(val form, val menv)
static val me_ignerr(val form, val menv)
{
+ (void) menv;
return list(catch_s, cons(progn_s, rest(form)),
list(error_s, error_s, nao), nao);
}
@@ -4173,6 +4185,8 @@ static val me_whilet(val form, val env)
val lastlet = car(lastlet_cons);
val not_done = gensym(lit("not-done"));
+ (void) env;
+
if (nilp(lastlet_cons))
eval_error(form, lit("~s: empty binding list"), sym, nao);
@@ -4199,6 +4213,8 @@ static val me_iflet_whenlet(val form, val env)
val sym = pop(&args);
val lets = pop(&args);
+ (void) env;
+
if (atom(lets)) {
return apply_frob_args(list(if3(sym == iflet_s, if_s, when_s),
lets, args, nao));
@@ -4246,6 +4262,7 @@ static val me_dotimes(val form, val env)
list(list(lt, counter, count, nao), result, nao),
list(list(inc_s, counter, nao), nao),
body, nao);
+ (void) env;
return apply_frob_args(raw);
}
@@ -4281,6 +4298,8 @@ static val me_mlet(val form, val menv)
list_collect_decl (smacs, ptail_smacs);
list_collect_decl (sets, ptail_sets);
+ (void) menv;
+
for (; consp(bindings); bindings = cdr(bindings)) {
val binding = car(bindings);
@@ -4324,6 +4343,7 @@ static val me_mlet(val form, val menv)
static val me_load_time(val form, val menv)
{
val expr = cadr(form);
+ (void) menv;
return list(load_time_lit_s, nil, expr, nao);
}
@@ -4335,6 +4355,8 @@ static val me_load_for(val form, val menv)
list_collect_decl (out, ptail);
val iter;
+ (void) menv;
+
for (iter = args; iter; iter = cdr(iter)) {
val arg = car(iter);
diff --git a/ffi.c b/ffi.c
index 5b59e281..02b82372 100644
--- a/ffi.c
+++ b/ffi.c
@@ -397,15 +397,25 @@ static struct cobj_ops ffi_closure_ops =
static void ffi_void_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
+ (void) tft;
+ (void) n;
+ (void) dst;
+ (void) self;
}
static cnum ffi_fixed_dynsize(struct txr_ffi_type *tft, val obj, val self)
{
+ (void) tft;
+ (void) obj;
+ (void) self;
return tft->size;
}
static mem_t *ffi_fixed_alloc(struct txr_ffi_type *tft, val obj, val self)
{
+ (void) tft;
+ (void) obj;
+ (void) self;
return chk_calloc(1, tft->size);
}
@@ -461,15 +471,21 @@ static mem_t *ffi_flex_alloc(struct txr_ffi_type *tft, val obj, val self)
static void ffi_noop_free(void *ptr)
{
+ (void) ptr;
}
static val ffi_void_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ (void) tft;
+ (void) src;
+ (void) self;
return nil;
}
static void ffi_simple_release(struct txr_ffi_type *tft, val obj, mem_t *dst)
{
+ (void) tft;
+ (void) obj;
mem_t **loc = coerce(mem_t **, dst);
free(*loc);
*loc = 0;
@@ -504,23 +520,29 @@ static void ffi_simple_release(struct txr_ffi_type *tft, val obj, mem_t *dst)
#if HAVE_I8
static void ffi_i8_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
+ (void) tft;
i8_t v = c_i8(n, self);
*coerce(i8_t *, dst) = v;
}
static val ffi_i8_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ (void) tft;
+ (void) self;
return num_fast(*src);
}
static void ffi_u8_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
+ (void) tft;
u8_t v = c_u8(n, self);
*coerce(u8_t *, dst) = v;
}
static val ffi_u8_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ (void) tft;
+ (void) self;
return num_fast(*coerce(u8_t *, src));
}
@@ -530,6 +552,7 @@ static val ffi_u8_get(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_i16_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
i16_t v = c_i16(n, self);
+ (void) tft;
align_sw_put(i16_t, dst, *coerce(i16_t *, dst) = v);
}
@@ -537,6 +560,8 @@ static val ffi_i16_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(i16_t, src);
i16_t n = *coerce(i16_t *, src);
+ (void) tft;
+ (void) self;
return num_fast(n);
align_sw_end;
}
@@ -544,6 +569,7 @@ static val ffi_i16_get(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_u16_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
u16_t v = c_u16(n, self);
+ (void) tft;
align_sw_put(u16_t, dst, *coerce(u16_t *, dst) = v);
}
@@ -551,6 +577,8 @@ static val ffi_u16_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(u16_t, src);
u16_t n = *coerce(u16_t *, src);
+ (void) tft;
+ (void) self;
return num_fast(n);
align_sw_end;
}
@@ -560,6 +588,7 @@ static val ffi_u16_get(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_i32_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
i32_t v = c_i32(n, self);
+ (void) tft;
align_sw_put(i32_t, dst, *coerce(i32_t *, dst) = v);
}
@@ -567,6 +596,8 @@ static val ffi_i32_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(i32_t, src);
i32_t n = *coerce(i32_t *, src);
+ (void) tft;
+ (void) self;
return num(n);
align_sw_end;
}
@@ -574,6 +605,7 @@ static val ffi_i32_get(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_u32_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
u32_t v = c_u32(n, self);
+ (void) tft;
align_sw_put(u32_t, dst, *coerce(u32_t *, dst) = v);
}
@@ -581,6 +613,8 @@ static val ffi_u32_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(u32_t, src);
u32_t n = *coerce(u32_t *, src);
+ (void) tft;
+ (void) self;
return unum(n);
align_sw_end;
}
@@ -590,6 +624,7 @@ static val ffi_u32_get(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_i64_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
i64_t v = c_i64(n, self);
+ (void) tft;
align_sw_put(i64_t, dst, *coerce(i64_t *, dst) = v);
}
@@ -598,6 +633,9 @@ static val ffi_i64_get(struct txr_ffi_type *tft, mem_t *src, val self)
align_sw_get(i64_t, src);
i64_t n = *coerce(i64_t *, src);
+ (void) tft;
+ (void) self;
+
if (sizeof (i64_t) <= sizeof (cnum)) {
return num(n);
} else {
@@ -611,6 +649,7 @@ static val ffi_i64_get(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_u64_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
u64_t v = c_u64(n, self);
+ (void) tft;
align_sw_put(u64_t, dst, *coerce(u64_t *, dst) = v);
}
@@ -619,6 +658,9 @@ static val ffi_u64_get(struct txr_ffi_type *tft, mem_t *src, val self)
align_sw_get(u64_t, src);
u64_t n = *coerce(u64_t *, src);
+ (void) tft;
+ (void) self;
+
if (sizeof (u64_t) <= sizeof (uint_ptr_t)) {
return unum(n);
} else {
@@ -634,28 +676,36 @@ static val ffi_u64_get(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_char_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
char v = c_char(n, self);
+ (void) tft;
*coerce(char *, dst) = v;
}
static val ffi_char_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ (void) tft;
+ (void) self;
return chr(*coerce(char *, src));
}
static void ffi_uchar_put(struct txr_ffi_type *tft, val n, mem_t *dst,
val self)
{
+ (void) tft;
unsigned char v = c_uchar(n, self);
*coerce(unsigned char *, dst) = v;
}
static val ffi_uchar_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ (void) tft;
+ (void) self;
return num_fast(*src);
}
static val ffi_bchar_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ (void) tft;
+ (void) self;
return chr(*src);
}
@@ -663,6 +713,7 @@ static void ffi_short_put(struct txr_ffi_type *tft, val n, mem_t *dst,
val self)
{
short v = c_short(n, self);
+ (void) tft;
align_sw_put(short, dst, *coerce(short *, dst) = v);
}
@@ -670,6 +721,8 @@ static val ffi_short_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(short, src);
short n = *coerce(short *, src);
+ (void) tft;
+ (void) self;
return num_fast(n);
align_sw_end;
}
@@ -678,18 +731,22 @@ static void ffi_ushort_put(struct txr_ffi_type *tft, val n, mem_t *dst,
val self)
{
unsigned short v = c_ushort(n, self);
+ (void) tft;
align_sw_put(unsigned, dst, *coerce(unsigned short *, dst) = v);
}
static val ffi_ushort_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
unsigned short n = *coerce(unsigned short *, src);
+ (void) tft;
+ (void) self;
return num_fast(n);
}
static void ffi_int_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
int v = c_int(n, self);
+ (void) tft;
align_sw_put(int, dst, *coerce(int *, dst) = v);
}
@@ -697,6 +754,8 @@ static val ffi_int_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(int, src);
int n = *coerce(int *, src);
+ (void) tft;
+ (void) self;
return num(n);
align_sw_end;
}
@@ -704,6 +763,7 @@ static val ffi_int_get(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_uint_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
unsigned v = c_uint(n, self);
+ (void) tft;
align_sw_put(unsigned, dst, *coerce(unsigned *, dst) = v);
}
@@ -711,6 +771,8 @@ static val ffi_uint_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(unsigned, src);
unsigned n = *coerce(unsigned *, src);
+ (void) tft;
+ (void) self;
return unum(n);
align_sw_end;
}
@@ -718,6 +780,7 @@ static val ffi_uint_get(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_long_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
long v = c_long(n, self);
+ (void) tft;
align_sw_put(long, dst, *coerce(long *, dst) = v);
}
@@ -725,6 +788,8 @@ static val ffi_long_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(long, src);
long n = *coerce(long *, src);
+ (void) tft;
+ (void) self;
return num(n);
align_sw_end;
}
@@ -732,6 +797,7 @@ static val ffi_long_get(struct txr_ffi_type *tft, mem_t *src, val self)
static void ffi_ulong_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
unsigned long v = c_ulong(n, self);
+ (void) tft;
align_sw_put(unsigned long, dst, *coerce(unsigned long *, dst) = v);
}
@@ -739,6 +805,8 @@ static val ffi_ulong_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(unsigned long, src);
unsigned long n = *coerce(unsigned long *, src);
+ (void) tft;
+ (void) self;
return unum(n);
align_sw_end;
}
@@ -747,6 +815,8 @@ static void ffi_float_put(struct txr_ffi_type *tft, val n, mem_t *dst, val self)
{
double v;
+ (void) tft;
+
switch (type(n)) {
case NUM:
case CHR:
@@ -773,6 +843,8 @@ static val ffi_float_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(float, src);
float n = *coerce(float *, src);
+ (void) tft;
+ (void) self;
return flo(n);
align_sw_end;
}
@@ -782,6 +854,8 @@ static void ffi_double_put(struct txr_ffi_type *tft, val n, mem_t *dst,
{
double v;
+ (void) tft;
+
switch (type(n)) {
case NUM:
case CHR:
@@ -802,12 +876,16 @@ static val ffi_double_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(double, src);
double n = *coerce(double *, src);
+ (void) tft;
+ (void) self;
return flo(n);
align_sw_end;
}
static void ffi_val_put(struct txr_ffi_type *tft, val v, mem_t *dst, val self)
{
+ (void) tft;
+ (void) self;
align_sw_put(val *, dst, *coerce(val *, dst) = v);
}
@@ -815,6 +893,7 @@ static val ffi_val_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(val, src);
val v = *coerce(val *, src);
+ (void) tft;
if (!valid_object_p(v))
uw_throwf(error_s, lit("~a: bit pattern ~0,0*x isn't a valid Lisp object"),
self, num_fast(sizeof (v) * 2), bits(v), nao);
@@ -827,6 +906,8 @@ static void ffi_be_i16_put(struct txr_ffi_type *tft, val n,
{
cnum v = c_num(n);
+ (void) tft;
+
if (v < -32768 || v > 32767)
uw_throwf(error_s, lit("~a: value ~s is out of signed 16 bit range"),
self, n, nao);
@@ -838,6 +919,8 @@ static void ffi_be_i16_put(struct txr_ffi_type *tft, val n,
static val ffi_be_i16_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
cnum n = (src[0] << 8) | src[1];
+ (void) tft;
+ (void) self;
if ((n & 0x8000) != 0)
n = -((n ^ 0xFFFF) + 1);
return num(n);
@@ -848,6 +931,8 @@ static void ffi_be_u16_put(struct txr_ffi_type *tft, val n,
{
cnum v = c_num(n);
+ (void) tft;
+
if (v < -32768 || v > 32767)
uw_throwf(error_s, lit("~a: value ~s is out of signed 16 bit range"),
self, n, nao);
@@ -859,6 +944,8 @@ static void ffi_be_u16_put(struct txr_ffi_type *tft, val n,
static val ffi_be_u16_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
cnum n = (src[0] << 8) | src[1];
+ (void) tft;
+ (void) self;
return num(n);
}
@@ -867,6 +954,8 @@ static void ffi_le_i16_put(struct txr_ffi_type *tft, val n,
{
cnum v = c_num(n);
+ (void) tft;
+
if (v < -32768 || v > 32767)
uw_throwf(error_s, lit("~a: value ~s is out of signed 16 bit range"),
self, n, nao);
@@ -878,6 +967,8 @@ static void ffi_le_i16_put(struct txr_ffi_type *tft, val n,
static val ffi_le_i16_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
cnum n = (src[1] << 8) | src[0];
+ (void) tft;
+ (void) self;
if ((n & 0x8000) != 0)
n = -((n ^ 0xFFFF) + 1);
return num(n);
@@ -888,6 +979,8 @@ static void ffi_le_u16_put(struct txr_ffi_type *tft, val n,
{
cnum v = c_num(n);
+ (void) tft;
+
if (v < 0|| v > 65535)
uw_throwf(error_s, lit("~a: value ~s is out of unsigned 16 bit range"),
self, n, nao);
@@ -899,6 +992,8 @@ static void ffi_le_u16_put(struct txr_ffi_type *tft, val n,
static val ffi_le_u16_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
cnum n = (src[1] << 8) | src[0];
+ (void) tft;
+ (void) self;
return num(n);
}
@@ -907,6 +1002,8 @@ static void ffi_be_i32_put(struct txr_ffi_type *tft, val n,
{
cnum v = c_num(n);
+ (void) tft;
+
if (v < -convert(cnum, 0x7FFFFFFF) - 1 || v > 0x7FFFFFFF)
uw_throwf(error_s, lit("~a: value ~s is out of signed 32 bit range"),
self, n, nao);
@@ -921,6 +1018,8 @@ static val ffi_be_i32_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
cnum n = (convert(cnum, src[0]) << 24 | convert(cnum, src[1]) << 16 |
convert(cnum, src[2]) << 8 | src[3]);
+ (void) tft;
+ (void) self;
if ((n & 0x80000000) != 0)
n = -((n ^ 0xFFFFFFFF) + 1);
return num(n);
@@ -931,6 +1030,8 @@ static void ffi_be_u32_put(struct txr_ffi_type *tft, val n,
{
ucnum v = c_unum(n);
+ (void) tft;
+
if (v > 0xFFFFFFFF)
uw_throwf(error_s, lit("~a: value ~s is out of unsigned 32 bit range"),
self, n, nao);
@@ -945,6 +1046,8 @@ static val ffi_be_u32_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
ucnum n = (convert(ucnum, src[0]) << 24 | convert(ucnum, src[1]) << 16 |
convert(ucnum, src[2]) << 8 | src[3]);
+ (void) tft;
+ (void) self;
return unum(n);
}
@@ -953,6 +1056,8 @@ static void ffi_le_i32_put(struct txr_ffi_type *tft, val n,
{
cnum v = c_num(n);
+ (void) tft;
+
if (v < - convert(cnum, 0x7fffffff) - 1 || v > 0x7FFFFFFF)
uw_throwf(error_s, lit("~a: value ~s is out of signed 32 bit range"),
self, n, nao);
@@ -967,6 +1072,8 @@ static val ffi_le_i32_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
cnum n = (convert(cnum, src[3]) << 24 | convert(cnum, src[2]) << 16 |
convert(cnum, src[1]) << 8 | src[0]);
+ (void) tft;
+ (void) self;
if ((n & 0x80000000) != 0)
n = -((n ^ 0xFFFFFFFF) + 1);
return num(n);
@@ -977,6 +1084,8 @@ static void ffi_le_u32_put(struct txr_ffi_type *tft, val n,
{
ucnum v = c_unum(n);
+ (void) tft;
+
if (v > 0xFFFFFFFF)
uw_throwf(error_s, lit("~a: value ~s is out of unsigned 32 bit range"),
self, n, nao);
@@ -991,6 +1100,8 @@ static val ffi_le_u32_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
ucnum n = (convert(ucnum, src[3]) << 24 | convert(ucnum, src[2]) << 16 |
convert(ucnum, src[1]) << 8 | src[0]);
+ (void) tft;
+ (void) self;
return unum(n);
}
@@ -999,6 +1110,8 @@ static void ffi_be_i64_put(struct txr_ffi_type *tft, val n,
{
i64_t v = c_i64(n, self);
+ (void) tft;
+
dst[0] = (v >> 56) & 0xff;
dst[1] = (v >> 48) & 0xff;
dst[2] = (v >> 40) & 0xff;
@@ -1015,6 +1128,8 @@ static val ffi_be_i64_get(struct txr_ffi_type *tft, mem_t *src, val self)
convert(i64_t, src[2]) << 40 | convert(i64_t, src[3]) << 32 |
convert(i64_t, src[4]) << 24 | convert(i64_t, src[5]) << 16 |
convert(i64_t, src[6]) << 8 | src[7]);
+ (void) tft;
+ (void) self;
return num_64(n);
}
@@ -1023,6 +1138,8 @@ static void ffi_be_u64_put(struct txr_ffi_type *tft, val n,
{
u64_t v = c_u64(n, self);
+ (void) tft;
+
dst[0] = (v >> 56) & 0xff;
dst[1] = (v >> 48) & 0xff;
dst[2] = (v >> 40) & 0xff;
@@ -1040,6 +1157,8 @@ static val ffi_be_u64_get(struct txr_ffi_type *tft, mem_t *src, val self)
convert(u64_t, src[2]) << 40 | convert(u64_t, src[3]) << 32 |
convert(u64_t, src[4]) << 24 | convert(u64_t, src[5]) << 16 |
convert(u64_t, src[6]) << 8 | src[7]);
+ (void) tft;
+ (void) self;
return unum_64(n);
}
@@ -1048,6 +1167,8 @@ static void ffi_le_i64_put(struct txr_ffi_type *tft, val n,
{
i64_t v = c_i64(n, self);
+ (void) tft;
+
dst[7] = (v >> 56) & 0xff;
dst[6] = (v >> 48) & 0xff;
dst[5] = (v >> 40) & 0xff;
@@ -1064,6 +1185,8 @@ static val ffi_le_i64_get(struct txr_ffi_type *tft, mem_t *src, val self)
convert(u64_t, src[5]) << 40 | convert(u64_t, src[4]) << 32 |
convert(u64_t, src[3]) << 24 | convert(u64_t, src[2]) << 16 |
convert(u64_t, src[1]) << 8 | src[0]);
+ (void) tft;
+ (void) self;
return num_64(n);
}
@@ -1072,6 +1195,8 @@ static void ffi_le_u64_put(struct txr_ffi_type *tft, val n,
{
u64_t v = c_u64(n, self);
+ (void) tft;
+
dst[7] = (v >> 56) & 0xff;
dst[6] = (v >> 48) & 0xff;
dst[5] = (v >> 40) & 0xff;
@@ -1088,6 +1213,8 @@ static val ffi_le_u64_get(struct txr_ffi_type *tft, mem_t *src, val self)
convert(u64_t, src[5]) << 40 | convert(u64_t, src[4]) << 32 |
convert(u64_t, src[3]) << 24 | convert(u64_t, src[2]) << 16 |
convert(u64_t, src[1]) << 8 | src[0]);
+ (void) tft;
+ (void) self;
return unum_64(n);
}
@@ -1252,6 +1379,8 @@ static void ffi_wchar_put(struct txr_ffi_type *tft, val ch, mem_t *dst,
val self)
{
wchar_t c = c_chr(ch);
+ (void) tft;
+ (void) self;
align_sw_put(wchar_t, dst, *coerce(wchar_t *, dst) = c);
}
@@ -1259,6 +1388,8 @@ static val ffi_wchar_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
align_sw_get(wchar_t, src);
wchar_t c = *coerce(wchar_t *, src);
+ (void) tft;
+ (void) self;
return chr(c);
align_sw_end;
}
@@ -1308,6 +1439,8 @@ static val ffi_sbit_get(struct txr_ffi_type *tft, mem_t *src, val self)
int shift = tft->shift;
unsigned uget = *coerce(unsigned *, src) & mask;
+ (void) self;
+
if (uget & sbmask)
return num(-convert(int, ((uget ^ mask) >> shift) + 1));
return unum(uget >> shift);
@@ -1352,6 +1485,7 @@ static val ffi_ubit_get(struct txr_ffi_type *tft, mem_t *src, val self)
unsigned mask = tft->mask;
int shift = tft->shift;
unsigned uget = *coerce(unsigned *, src) & mask;
+ (void) self;
return unum(uget >> shift);
align_sw_end;
}
@@ -1719,6 +1853,7 @@ static void ffi_cptr_put(struct txr_ffi_type *tft, val n, mem_t *dst,
static val ffi_cptr_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
mem_t *p = *coerce(mem_t **, src);
+ (void) self;
return cptr_typed(p, tft->tag, 0);
}
@@ -1731,6 +1866,8 @@ static val ffi_str_in(struct txr_ffi_type *tft, int copy,
mem_t *src, val obj, val self)
{
char **loc = coerce(char **, src);
+ (void) tft;
+ (void) self;
if (copy)
obj = if2(*loc, string_utf8(*loc));
free(*loc);
@@ -1741,6 +1878,8 @@ static val ffi_str_in(struct txr_ffi_type *tft, int copy,
static void ffi_str_put(struct txr_ffi_type *tft, val s, mem_t *dst,
val self)
{
+ (void) tft;
+ (void) self;
if (s == nil) {
*coerce(const char **, dst) = 0;
} else {
@@ -1753,6 +1892,8 @@ static void ffi_str_put(struct txr_ffi_type *tft, val s, mem_t *dst,
static val ffi_str_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
const char *p = *coerce(const char **, src);
+ (void) tft;
+ (void) self;
return p ? string_utf8(p) : nil;
}
@@ -1760,6 +1901,8 @@ static val ffi_str_d_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
char **loc = coerce(char **, src);
val ret = *loc ? string_utf8(*loc) : nil;
+ (void) tft;
+ (void) self;
free(*loc);
*loc = 0;
return ret;
@@ -1769,6 +1912,8 @@ static val ffi_wstr_in(struct txr_ffi_type *tft, int copy,
mem_t *src, val obj, val self)
{
wchar_t **loc = coerce(wchar_t **, src);
+ (void) tft;
+ (void) self;
if (copy)
obj = if2(*loc, string(*loc));
free(*loc);
@@ -1779,12 +1924,16 @@ static val ffi_wstr_in(struct txr_ffi_type *tft, int copy,
static val ffi_wstr_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
const wchar_t *p = *coerce(wchar_t **, src);
+ (void) tft;
+ (void) self;
return p ? string(p) : 0;
}
static void ffi_wstr_put(struct txr_ffi_type *tft, val s, mem_t *dst,
- val self)
+ val self)
{
+ (void) tft;
+ (void) self;
if (s == nil) {
*coerce(const wchar_t **, dst) = 0;
} else {
@@ -1797,6 +1946,8 @@ static val ffi_wstr_d_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
wchar_t **loc = coerce(wchar_t **, src);
val ret = *loc ? string_own(*loc) : nil;
+ (void) tft;
+ (void) self;
*loc = 0;
return ret;
}
@@ -1805,6 +1956,8 @@ static val ffi_bstr_in(struct txr_ffi_type *tft, int copy,
mem_t *src, val obj, val self)
{
unsigned char **loc = coerce(unsigned char **, src);
+ (void) tft;
+ (void) self;
if (copy)
obj = if2(*loc, string_8bit(*loc));
free(*loc);
@@ -1815,6 +1968,8 @@ static val ffi_bstr_in(struct txr_ffi_type *tft, int copy,
static void ffi_bstr_put(struct txr_ffi_type *tft, val s, mem_t *dst,
val self)
{
+ (void) tft;
+ (void) self;
if (s == nil) {
*coerce(unsigned char **, dst) = 0;
} else {
@@ -1827,6 +1982,8 @@ static void ffi_bstr_put(struct txr_ffi_type *tft, val s, mem_t *dst,
static val ffi_bstr_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
unsigned char *p = *coerce(unsigned char **, src);
+ (void) tft;
+ (void) self;
return p ? string_8bit(p) : nil;
}
@@ -1834,6 +1991,8 @@ static val ffi_bstr_d_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
unsigned char **loc = coerce(unsigned char **, src);
val ret = *loc ? string_8bit(*loc) : nil;
+ (void) tft;
+ (void) self;
free(*loc);
*loc = 0;
return ret;
@@ -1845,6 +2004,8 @@ static val ffi_buf_in(struct txr_ffi_type *tft, int copy, mem_t *src,
mem_t **loc = coerce(mem_t **, src);
mem_t *origptr = if3(obj, buf_get(obj, self), 0);
+ (void) tft;
+
if (copy && *loc != origptr)
obj = if2(*loc, make_duplicate_buf(length_buf(obj), *loc));
@@ -1854,6 +2015,8 @@ static val ffi_buf_in(struct txr_ffi_type *tft, int copy, mem_t *src,
static void ffi_buf_put(struct txr_ffi_type *tft, val buf, mem_t *dst,
val self)
{
+ (void) tft;
+
if (buf == nil) {
*coerce(const mem_t **, dst) = 0;
} else {
@@ -1865,6 +2028,7 @@ static void ffi_buf_put(struct txr_ffi_type *tft, val buf, mem_t *dst,
static val ffi_buf_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
mem_t *p = *coerce(mem_t **, src);
+ (void) self;
return p ? make_duplicate_buf(num(tft->nelem), p) : nil;
}
@@ -1873,6 +2037,8 @@ static val ffi_buf_d_in(struct txr_ffi_type *tft, int copy, mem_t *src,
{
mem_t **loc = coerce(mem_t **, src);
+ (void) self;
+
if (copy) {
obj = if2(*loc, make_borrowed_buf(num(tft->nelem), *loc));
*loc = 0;
@@ -1884,6 +2050,9 @@ static val ffi_buf_d_in(struct txr_ffi_type *tft, int copy, mem_t *src,
static void ffi_buf_d_put(struct txr_ffi_type *tft, val buf, mem_t *dst,
val self)
{
+ (void) tft;
+ (void) self;
+
if (buf == nil) {
*coerce(const mem_t **, dst) = 0;
} else {
@@ -1896,6 +2065,7 @@ static val ffi_buf_d_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
mem_t **loc = coerce(mem_t **, src);
val ret = *loc ? make_borrowed_buf(num(tft->nelem), *loc) : nil;
+ (void) self;
*loc = 0;
return ret;
}
@@ -1907,6 +2077,8 @@ static void ffi_closure_put(struct txr_ffi_type *tft, val ptr, mem_t *dst,
val type = typeof(ptr);
mem_t *p = 0;
+ (void) tft;
+
if (type == cptr_s) {
p = ptr->co.handle;
} else if (type == ffi_closure_s) {
@@ -1927,6 +2099,7 @@ static val ffi_ptr_in_in(struct txr_ffi_type *tft, int copy, mem_t *src,
val tgttype = tft->eltype;
struct txr_ffi_type *tgtft = ffi_type_struct(tgttype);
mem_t **loc = coerce(mem_t **, src);
+ (void) copy;
if (!*loc)
return nil;
if (tgtft->in != 0 && tgtft->by_value_in)
@@ -1942,6 +2115,7 @@ static val ffi_ptr_in_d_in(struct txr_ffi_type *tft, int copy, mem_t *src,
val tgttype = tft->eltype;
struct txr_ffi_type *tgtft = ffi_type_struct(tgttype);
mem_t **loc = coerce(mem_t **, src);
+ (void) copy;
if (!*loc)
return nil;
if (tgtft->in != 0 && tgtft->by_value_in)
@@ -1954,6 +2128,7 @@ static void ffi_ptr_in_out(struct txr_ffi_type *tft, int copy, val s,
{
val tgttype = tft->eltype;
struct txr_ffi_type *tgtft = ffi_type_struct(tgttype);
+ (void) copy;
if (tgtft->out != 0) {
mem_t *buf = *coerce(mem_t **, dst);
tgtft->out(tgtft, 0, s, buf, self);
@@ -1966,6 +2141,7 @@ static val ffi_ptr_out_in(struct txr_ffi_type *tft, int copy, mem_t *src,
val tgttype = tft->eltype;
struct txr_ffi_type *tgtft = ffi_type_struct(tgttype);
mem_t **loc = coerce(mem_t **, src);
+ (void) copy;
if (!*loc)
return nil;
if (tgtft->in != 0)
@@ -1996,6 +2172,7 @@ static void ffi_ptr_out_out(struct txr_ffi_type *tft, int copy, val s,
val tgttype = tft->eltype;
struct txr_ffi_type *tgtft = ffi_type_struct(tgttype);
mem_t *buf = *coerce(mem_t **, dst);
+ (void) copy;
if (tgtft->out != 0)
tgtft->out(tgtft, 1, s, buf, self);
else
@@ -2038,6 +2215,9 @@ static void ffi_ptr_in_put(struct txr_ffi_type *tft, val s, mem_t *dst,
static void ffi_ptr_out_null_put(struct txr_ffi_type *tft, val s, mem_t *dst,
val self)
{
+ (void) tft;
+ (void) s;
+ (void) self;
*coerce(mem_t **, dst) = 0;
}
@@ -2047,6 +2227,7 @@ static val ffi_ptr_out_s_in(struct txr_ffi_type *tft, int copy,
val tgttype = tft->eltype;
struct txr_ffi_type *tgtft = ffi_type_struct(tgttype);
mem_t **loc = coerce(mem_t **, src);
+ (void) copy;
if (!*loc)
return nil;
if (tgtft->in != 0)
@@ -2072,6 +2253,8 @@ static val ffi_flex_struct_in(struct txr_ffi_type *tft, val strct, val self)
struct smemb *lastm = &tft->memb[tft->nelem - 1];
val length_meth = get_special_slot(strct, length_m);
+ (void) self;
+
if (length_meth) {
val len = funcall1(length_meth, strct);
val memb = slot(strct, lastm->mname);
@@ -2721,6 +2904,7 @@ static void ffi_varray_release(struct txr_ffi_type *tft, val vec, mem_t *dst)
static val ffi_carray_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
mem_t *p = *coerce(mem_t **, src);
+ (void) self;
return make_carray(tft->eltype, p, -1, nil, 0);
}
@@ -2822,6 +3006,7 @@ static void ffi_union_put(struct txr_ffi_type *tft, val uni,
static val ffi_union_get(struct txr_ffi_type *tft, mem_t *src, val self)
{
+ (void) self;
return make_union_tft(src, tft);
}
@@ -2863,6 +3048,9 @@ static val make_ffi_type_builtin(val syntax, val lisp_type, ffi_kind_t kind,
#if !HAVE_LITTLE_ENDIAN
tft->rput = (rput ? rput : put);
tft->rget = (rget ? rget : get);
+#else
+ (void) rput;
+ (void) rget;
#endif
return obj;
@@ -3274,6 +3462,8 @@ static val make_ffi_type_array(val syntax, val lisp_type,
struct txr_ffi_type *etft = ffi_type_struct(eltype);
+ (void) self;
+
tft->self = obj;
tft->kind = FFI_KIND_ARRAY;
tft->ft = ft;
@@ -4578,6 +4768,8 @@ static void ffi_closure_dispatch(ffi_cif *cif, void *cret,
args_decl(args, nargs);
args_decl(args_cp, nargs);
+ (void) cif;
+
for (i = 0; i < nargs; i++) {
val type = pop(&types);
struct txr_ffi_type *mtft = ffi_type_struct(type);
@@ -4620,6 +4812,8 @@ static void ffi_closure_dispatch_safe(ffi_cif *cif, void *cret,
size_t rsize = pad_retval(rtft->size);
uw_frame_t cont_guard;
+ (void) cif;
+
if (rtft->release != 0)
memset(cret, 0, rsize);
diff --git a/gc.c b/gc.c
index a945f7fd..dc1a1939 100644
--- a/gc.c
+++ b/gc.c
@@ -316,6 +316,7 @@ static void finalize(val obj)
void cobj_destroy_stub_op(val obj)
{
+ (void) obj;
}
void cobj_destroy_free_op(val obj)
@@ -454,6 +455,7 @@ tail_call:
void cobj_mark_op(val obj)
{
+ (void) obj;
}
static int in_heap(val ptr)
diff --git a/lib.c b/lib.c
index acf66f36..bcfb9638 100644
--- a/lib.c
+++ b/lib.c
@@ -330,11 +330,15 @@ static void noreturn unsup_obj(val self, val obj)
static int seq_iter_get_nil(seq_iter_t *it, val *pval)
{
+ (void) it;
+ (void) pval;
return 0;
}
static int seq_iter_peek_nil(seq_iter_t *it, val *pval)
{
+ (void) it;
+ (void) pval;
return 0;
}
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c
index 78a3446f..998314cf 100644
--- a/linenoise/linenoise.c
+++ b/linenoise/linenoise.c
@@ -2507,6 +2507,8 @@ static void sigwinch_handler(int sig)
{
lino_t *li;
+ (void) sig;
+
if (lino_list_busy)
return;
diff --git a/parser.c b/parser.c
index 4979ad0d..7e7b0ddb 100644
--- a/parser.c
+++ b/parser.c
@@ -1093,6 +1093,8 @@ static wchar_t *provide_atom(lino_t *l, const wchar_t *str, int n, void *ctx)
static val repl_intr(val signo, val async_p)
{
+ (void) signo;
+ (void) async_p;
uw_throw(intr_s, lit("intr"));
}
@@ -1107,6 +1109,8 @@ static val read_eval_ret_last(val env, val counter,
val saved_dyn_env = set_dyn_env(make_env(nil, nil, dyn_env));
env_vbind(dyn_env, load_recursive_s, t);
+ (void) env;
+
for (;; lineno = succ(lineno)) {
val form = lisp_parse(in_stream, out_stream, error_val, name, lineno);
val parser = get_parser(in_stream);
@@ -1149,6 +1153,8 @@ static val repl_warning(val out_stream, val exc, struct args *rest)
{
val args = args_get_list(rest);
+ (void) exc;
+
if (cdr(args))
uw_defer_warning(args);
else
@@ -1170,6 +1176,8 @@ static int is_balanced_line(const wchar_t *line, void *ctx)
state[sp] = ST_START;
wchar_t ch;
+ (void) ctx;
+
while ((ch = *line++) != 0) {
again:
if (sp >= 30)
diff --git a/parser.y b/parser.y
index 81e7dd0a..1e800be0 100644
--- a/parser.y
+++ b/parser.y
@@ -1350,6 +1350,8 @@ void yydebug_onoff(int val)
{
#if YYDEBUG
yydebug = val;
+#else
+ (void) val;
#endif
}
diff --git a/socket.c b/socket.c
index c9da9a19..25477de4 100644
--- a/socket.c
+++ b/socket.c
@@ -533,6 +533,9 @@ static val dgram_flush(val stream)
static val dgram_close(val stream, val throw_on_error)
{
struct dgram_stream *d = coerce(struct dgram_stream *, stream->co.handle);
+
+ (void) throw_on_error;
+
if (d->fd != -1) {
dgram_flush(stream);
close(d->fd);
diff --git a/stream.c b/stream.c
index 915ed7e5..662ba359 100644
--- a/stream.c
+++ b/stream.c
@@ -149,16 +149,19 @@ static noreturn void unimpl(val stream, val op)
static noreturn val unimpl_put_string(val stream, val str)
{
+ (void) str;
unimpl(stream, lit("put-string"));
}
static noreturn val unimpl_put_char(val stream, val ch)
{
+ (void) ch;
unimpl(stream, lit("put-char"));
}
static noreturn val unimpl_put_byte(val stream, int byte)
{
+ (void) byte;
unimpl(stream, lit("put-byte"));
}
@@ -179,31 +182,40 @@ static noreturn val unimpl_get_byte(val stream)
static noreturn val unimpl_unget_char(val stream, val ch)
{
+ (void) ch;
unimpl(stream, lit("unget-char"));
}
static noreturn val unimpl_unget_byte(val stream, int byte)
{
+ (void) byte;
unimpl(stream, lit("unget-byte"));
}
static noreturn val unimpl_put_buf(val stream, val buf, cnum pos)
{
+ (void) buf;
+ (void) pos;
unimpl(stream, lit("put-buf"));
}
static noreturn val unimpl_fill_buf(val stream, val buf, cnum pos)
{
+ (void) buf;
+ (void) pos;
unimpl(stream, lit("fill-buf"));
}
static noreturn val unimpl_seek(val stream, val off, enum strm_whence whence)
{
+ (void) off;
+ (void) whence;
unimpl(stream, lit("seek-stream"));
}
static noreturn val unimpl_truncate(val stream, val len)
{
+ (void) len;
unimpl(stream, lit("truncate-stream"));
}
@@ -229,51 +241,67 @@ static noreturn val unimpl_get_sock_peer(val stream)
static noreturn val unimpl_set_sock_peer(val stream, val peer)
{
+ (void) peer;
unimpl(stream, lit("sock-set-peer"));
}
static val null_put_string(val stream, val str)
{
+ (void) stream;
+ (void) str;
return nil;
}
static val null_put_char(val stream, val ch)
{
+ (void) stream;
+ (void) ch;
return nil;
}
static val null_put_byte(val stream, int byte)
{
+ (void) stream;
+ (void) byte;
return nil;
}
static val null_get_line(val stream)
{
+ (void) stream;
return nil;
}
static val null_get_char(val stream)
{
+ (void) stream;
return nil;
}
static val null_get_byte(val stream)
{
+ (void) stream;
return nil;
}
static val null_close(val stream, val throw_on_error)
{
+ (void) stream;
+ (void) throw_on_error;
return nil;
}
static val null_flush(val stream)
{
+ (void) stream;
return nil;
}
static val null_seek(val stream, val off, enum strm_whence whence)
{
+ (void) stream;
+ (void) off;
+ (void) whence;
return nil;
}
@@ -289,26 +317,33 @@ static val null_get_prop(val stream, val ind)
static val null_set_prop(val stream, val ind, val value)
{
+ (void) stream;
+ (void) ind;
+ (void) value;
return nil;
}
static val null_get_error(val stream)
{
+ (void) stream;
return nil;
}
static val null_get_error_str(val stream)
{
+ (void) stream;
return nil;
}
static val null_clear_error(val stream)
{
+ (void) stream;
return nil;
}
static val null_get_fd(val stream)
{
+ (void) stream;
return nil;
}
@@ -1739,6 +1774,7 @@ static val dir_get_line(val stream)
static val dir_close(val stream, val throw_on_error)
{
struct dir_handle *h = coerce(struct dir_handle *, stream->co.handle);
+ (void) throw_on_error;
if (h->d != 0) {
closedir(coerce(DIR *, h->d));
diff --git a/struct.c b/struct.c
index b00b7d9e..8446ba00 100644
--- a/struct.c
+++ b/struct.c
@@ -566,6 +566,7 @@ val super(val type, val idx)
static void struct_type_print(val obj, val out, val pretty, struct strm_ctx *c)
{
struct struct_type *st = coerce(struct struct_type *, obj->co.handle);
+ (void) pretty;
(void) c;
format(out, lit("#<struct-type ~s>"), st->name, nao);
}
diff --git a/unwind.c b/unwind.c
index 0f9ffe63..f7f3dcec 100644
--- a/unwind.c
+++ b/unwind.c
@@ -951,6 +951,8 @@ static val me_defex(val form, val menv)
{
val types = cdr(form);
+ (void) menv;
+
if (!all_satisfy(types, func_n1(symbolp), nil))
eval_error(form, lit("defex: arguments must all be symbols"), nao);