From 579a30ef3f8a6656c4db38d43c34f4dc3403af33 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 5 Apr 2020 19:06:54 -0700 Subject: 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. --- stream.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'stream.c') 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)); -- cgit v1.2.3