From 858ce927fc30d080793fffe42b0ce6fcddfbb3c5 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 5 Apr 2020 19:31:04 -0700 Subject: warning cleanup: remove unused parameters. This is the second round of an effort to enable GCC's -Wextra option. All function parameters that are unused and are removable are removed. They are eliminated from the function defintions, declarations, callers, and any related function pointer variables or structure members. * arith.c (nary_simple_op): Remove unused self parameter. See lib.c: maxv, minv. * chksum.c (crc32_buf, crc32_str): Remove unused self parameter. (crc32): Don't pass self to the above functions. * eval.c (copy_env_handler, copy_bh_env_handler): Remove unused parent parameter. See unwind.c. (supplement_op_syms): Remove unused max parameter. (me_op): Don't pass max to supplement_op_syms. * lib.c (seq_iter_rewind): Remove unused self parameter. (lazy_flatten_func): Remove unused env parameter. (lazy_flatten): Use func_n1 to create non-environment-carrying funtion out of lazy_flatten_func. (maxv, minv): Don't pass self parameter to nary_simple_op. (middle_pivot): Remove unused lessfun param. (quicksort): Don't pass lessfun to middle_pivot. (diff, isec): Don't pass self to seq_iter_rewind. * lib.h (seq_iter_rewind, nary_simple_op): Declarations updated. * struct.c (get_super_slots): Remove unused self parameteer. (make_struct_type): Don't pass self to get_super_slots. * sysif.c (flock_unpack): Remove unused self parameter. (fcntl_wrap): Don't pass self to flock_unpack. * unwind.c (uw_push_cont_copy): Remove parent parameter from function pointer parameter. See eval.c: copy_env_handler. (call_copy_handlers): Remove parent parameter and don't pass that argument to the indirect call via pointer to the copy handler function. (revive_cont, capture_cont): Don't pass 0 value to removed parent parameter of call_copy_handlers. * unwind.h (struct uw_cont_copy): Function pointer member copy loses parent parameter. (uw_push_cont_copy): Declaration updated. --- struct.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'struct.c') diff --git a/struct.c b/struct.c index 8446ba00..a00345fa 100644 --- a/struct.c +++ b/struct.c @@ -319,7 +319,7 @@ static cnum count_super_stslots(cnum nsupers, struct struct_type **sus, return c; } -static val get_super_slots(cnum nsupers, struct struct_type **sus, val self) +static val get_super_slots(cnum nsupers, struct struct_type **sus) { cnum i; val slots = nil; @@ -389,7 +389,7 @@ val make_struct_type(val name, val supers, cnum nsupers = c_num(length(supers)); struct struct_type **sus = get_struct_handles(nsupers, supers, self); val id = num_fast(coerce(ucnum, st) / (uptopow2(sizeof *st) / 2)); - val super_slots = get_super_slots(nsupers, sus, self); + val super_slots = get_super_slots(nsupers, sus); val all_slots = uniq(append2(super_slots, append2(static_slots, slots))); cnum stsl_upb = c_num(plus(length(static_slots), num(count_super_stslots(nsupers, sus, self)))); -- cgit v1.2.3