summaryrefslogtreecommitdiffstats
path: root/eval.c
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 /eval.c
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.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c28
1 files changed, 25 insertions, 3 deletions
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);