From 91a9c2923f2ac11c33d652953a43ab339cadfcb9 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Wed, 21 Feb 2018 16:06:07 +0100 Subject: [PATCH] Mark intentionally unused parameters as such (with "UNUSED") --- bitcoin/signature.c | 10 +++++----- bitcoin/tx.c | 2 +- channeld/channel.c | 6 +++--- channeld/test/run-full_channel.c | 2 +- cli/lightning-cli.c | 2 +- cli/test/run-large-input.c | 12 ++++++------ common/memleak.c | 2 +- common/read_peer_msg.c | 4 ++-- common/status.c | 2 +- common/subdaemon.c | 2 +- common/test/run-bolt11.c | 2 +- common/version.c | 2 +- devtools/decodemsg.c | 2 +- gossipd/gossip.c | 4 ++-- gossipd/test/run-bench-find_route.c | 2 +- gossipd/test/run-find_route.c | 2 +- gossipd/test/run-initiator-success.c | 6 +++--- gossipd/test/run-responder-success.c | 8 ++++---- hsmd/hsm.c | 4 ++-- lightningd/bitcoind.c | 4 ++-- lightningd/chaintopology.c | 6 +++--- lightningd/dev_ping.c | 2 +- lightningd/gossip_control.c | 10 +++++----- lightningd/jsonrpc.c | 8 ++++---- lightningd/log.c | 2 +- lightningd/memdump.c | 2 +- lightningd/netaddress.c | 2 +- lightningd/payalgo.c | 4 ++-- lightningd/peer_control.c | 14 +++++++------- lightningd/peer_htlcs.c | 4 ++-- lightningd/subd.c | 8 ++++---- lightningd/test/run-cryptomsg.c | 10 +++++----- lightningd/test/run-find_my_path.c | 6 +++--- test/test_protocol.c | 2 +- wallet/db.c | 4 ++-- wallet/invoices.c | 2 +- wallet/test/run-db.c | 2 +- wallet/test/run-wallet.c | 2 +- 38 files changed, 85 insertions(+), 85 deletions(-) diff --git a/bitcoin/signature.c b/bitcoin/signature.c index 4464796a5..4de412dea 100644 --- a/bitcoin/signature.c +++ b/bitcoin/signature.c @@ -65,11 +65,11 @@ static void dump_tx(const char *msg, } } #else -static void dump_tx(const char *msg, - const struct bitcoin_tx *tx, size_t inputnum, - const u8 *script, - const struct pubkey *key, - const struct sha256_double *h) +static void dump_tx(const char *msg UNUSED, + const struct bitcoin_tx *tx UNUSED, size_t inputnum UNUSED, + const u8 *script UNUSED, + const struct pubkey *key UNUSED, + const struct sha256_double *h UNUSED) { } #endif diff --git a/bitcoin/tx.c b/bitcoin/tx.c index a40d0f719..8379d3574 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -255,7 +255,7 @@ u8 *linearize_tx(const tal_t *ctx, const struct bitcoin_tx *tx) return arr; } -static void push_measure(const void *data, size_t len, void *lenp) +static void push_measure(const void *data UNUSED, size_t len, void *lenp) { *(size_t *)lenp += len; } diff --git a/channeld/channel.c b/channeld/channel.c index 81d18b502..471af118c 100644 --- a/channeld/channel.c +++ b/channeld/channel.c @@ -1743,9 +1743,9 @@ static void channeld_io_error(struct peer *peer) peer_conn_broken(peer); } -static bool channeld_send_reply(struct crypto_state *cs, - int peer_fd, - const u8 *msg, +static bool channeld_send_reply(struct crypto_state *cs UNUSED, + int peer_fd UNUSED, + const u8 *msg UNUSED, struct peer *peer) { enqueue_peer_msg(peer, msg); diff --git a/channeld/test/run-full_channel.c b/channeld/test/run-full_channel.c index 576be72ac..1e1dd1315 100644 --- a/channeld/test/run-full_channel.c +++ b/channeld/test/run-full_channel.c @@ -14,7 +14,7 @@ #include #include -void status_fmt(enum log_level level, const char *fmt, ...) +void status_fmt(enum log_level level UNUSED, const char *fmt, ...) { va_list ap; diff --git a/cli/lightning-cli.c b/cli/lightning-cli.c index cf568da3b..406639885 100644 --- a/cli/lightning-cli.c +++ b/cli/lightning-cli.c @@ -42,7 +42,7 @@ static void tal_freefn(void *ptr) struct netaddr; char *netaddr_name(const tal_t *ctx, const struct netaddr *a); -char *netaddr_name(const tal_t *ctx, const struct netaddr *a) +char *netaddr_name(const tal_t *ctx UNUSED, const struct netaddr *a UNUSED) { return NULL; } diff --git a/cli/test/run-large-input.c b/cli/test/run-large-input.c index a9d81810f..7e6fd9b20 100644 --- a/cli/test/run-large-input.c +++ b/cli/test/run-large-input.c @@ -30,14 +30,14 @@ char *version_and_exit(const void *unused UNNEEDED) { fprintf(stderr, "version_and_exit called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ -int test_socket(int domain, int type, int protocol) +int test_socket(int domain UNUSED, int type UNUSED, int protocol UNUSED) { /* We give a real fd, as it writes to it */ return open("/dev/null", O_WRONLY); } -int test_connect(int sockfd, const struct sockaddr *addr, - socklen_t addrlen) +int test_connect(int sockfd UNUSED, const struct sockaddr *addr UNUSED, + socklen_t addrlen UNUSED) { return 0; } @@ -47,7 +47,7 @@ int test_getpid(void) return 9999; } -int test_printf(const char *fmt, ...) +int test_printf(const char *fmt UNUSED, ...) { return 0; } @@ -55,7 +55,7 @@ int test_printf(const char *fmt, ...) static char *response; static size_t response_off, max_read_return; -ssize_t test_read(int fd, void *buf, size_t len) +ssize_t test_read(int fd UNUSED, void *buf, size_t len) { if (len > max_read_return) len = max_read_return; @@ -82,7 +82,7 @@ ssize_t test_read(int fd, void *buf, size_t len) " {\"type\": \"DEBUG\", \"time\": \"241693.051558854\", \"source\": \"lightning_gossipd(14581):\", \"log\": \"TRACE: nonlocal_gossip_broadcast_done\"},\n" #define TAILER "] } }" -int main(int argc, char *argv[]) +int main(int argc UNUSED, char *argv[]) { char *fake_argv[] = { argv[0], "--lightning-dir=/tmp/", "test", NULL }; diff --git a/common/memleak.c b/common/memleak.c index cbfa8d1b5..3bd64628b 100644 --- a/common/memleak.c +++ b/common/memleak.c @@ -218,7 +218,7 @@ static int append_bt(void *data, uintptr_t pc) return 0; } -static void add_backtrace(tal_t *parent, enum tal_notify_type type UNNEEDED, +static void add_backtrace(tal_t *parent UNUSED, enum tal_notify_type type UNNEEDED, void *child) { uintptr_t *bt = tal_alloc_arr_(child, sizeof(uintptr_t), 32, true, true, diff --git a/common/read_peer_msg.c b/common/read_peer_msg.c index 3a3171f0f..0e0e54f05 100644 --- a/common/read_peer_msg.c +++ b/common/read_peer_msg.c @@ -112,13 +112,13 @@ u8 *read_peer_msg_(const tal_t *ctx, /* Helper: sync_crypto_write, with extra args it ignores */ bool sync_crypto_write_arg(struct crypto_state *cs, int fd, const u8 *msg, - void *unused) + void *unused UNUSED) { return sync_crypto_write(cs, fd, msg); } /* Helper: calls peer_failed_connection_lost. */ -void status_fail_io(void *unused) +void status_fail_io(void *unused UNUSED) { peer_failed_connection_lost(); } diff --git a/common/status.c b/common/status.c index 10adc6767..f0e1f1180 100644 --- a/common/status.c +++ b/common/status.c @@ -21,7 +21,7 @@ static struct daemon_conn *status_conn; const void *trc; volatile bool logging_io = false; -static void got_sigusr1(int signal) +static void got_sigusr1(int signal UNUSED) { logging_io = !logging_io; } diff --git a/common/subdaemon.c b/common/subdaemon.c index a33c118be..3e51b2f1a 100644 --- a/common/subdaemon.c +++ b/common/subdaemon.c @@ -14,7 +14,7 @@ static struct backtrace_state *backtrace_state; -static int backtrace_status(void *unused, uintptr_t pc, +static int backtrace_status(void *unused UNUSED, uintptr_t pc, const char *filename, int lineno, const char *function) { diff --git a/common/test/run-bolt11.c b/common/test/run-bolt11.c index c6217119f..88f18155f 100644 --- a/common/test/run-bolt11.c +++ b/common/test/run-bolt11.c @@ -40,7 +40,7 @@ static struct privkey privkey; static bool test_sign(const u5 *u5bytes, const u8 *hrpu8, secp256k1_ecdsa_recoverable_signature *rsig, - void *unused) + void *unused UNUSED) { struct hash_u5 hu5; char *hrp; diff --git a/common/version.c b/common/version.c index 2030fe454..d9fcad064 100644 --- a/common/version.c +++ b/common/version.c @@ -7,7 +7,7 @@ const char *version(void) return VERSION; } -char *version_and_exit(const void *unused) +char *version_and_exit(const void *unused UNUSED) { printf("%s\n" "aka. %s\n" diff --git a/devtools/decodemsg.c b/devtools/decodemsg.c index 79697b374..1e5a9c7c7 100644 --- a/devtools/decodemsg.c +++ b/devtools/decodemsg.c @@ -1,7 +1,7 @@ #include #include -int main(int argc, char *argv[]) +int main(int argc UNUSED, char *argv[]) { u8 *m = tal_hexdata(NULL, argv[1], strlen(argv[1])); print_message(m); diff --git a/gossipd/gossip.c b/gossipd/gossip.c index 9e1d4a5c7..2f3908986 100644 --- a/gossipd/gossip.c +++ b/gossipd/gossip.c @@ -839,7 +839,7 @@ static struct io_plan *owner_msg_in(struct io_conn *conn, return daemon_conn_read_next(conn, dc); } -static void forget_peer(struct io_conn *conn, struct daemon_conn *dc) +static void forget_peer(struct io_conn *conn UNUSED, struct daemon_conn *dc) { struct peer *peer = dc->ctx; @@ -2011,7 +2011,7 @@ static struct io_plan *recv_req(struct io_conn *conn, struct daemon_conn *master } #ifndef TESTING -static void master_gone(struct io_conn *unused, struct daemon_conn *dc) +static void master_gone(struct io_conn *unused UNUSED, struct daemon_conn *dc UNUSED) { /* Can't tell master, it's gone. */ exit(2); diff --git a/gossipd/test/run-bench-find_route.c b/gossipd/test/run-bench-find_route.c index 2714d194a..376f4e9fa 100644 --- a/gossipd/test/run-bench-find_route.c +++ b/gossipd/test/run-bench-find_route.c @@ -12,7 +12,7 @@ #include #include -void status_fmt(enum log_level level, const char *fmt, ...) +void status_fmt(enum log_level level UNUSED, const char *fmt, ...) { va_list ap; diff --git a/gossipd/test/run-find_route.c b/gossipd/test/run-find_route.c index 52d2534ee..6a83fb158 100644 --- a/gossipd/test/run-find_route.c +++ b/gossipd/test/run-find_route.c @@ -6,7 +6,7 @@ struct broadcast_state *new_broadcast_state(tal_t *ctx UNNEEDED) return NULL; } -void status_fmt(enum log_level level, const char *fmt, ...) +void status_fmt(enum log_level level UNUSED, const char *fmt, ...) { va_list ap; diff --git a/gossipd/test/run-initiator-success.c b/gossipd/test/run-initiator-success.c index 09df4e5c4..e07235ed6 100644 --- a/gossipd/test/run-initiator-success.c +++ b/gossipd/test/run-initiator-success.c @@ -32,7 +32,7 @@ static struct io_plan *test_read(struct io_conn *conn, struct handshake *h); #define SUPERVERBOSE status_trace -void status_fmt(enum log_level level, const char *fmt, ...) +void status_fmt(enum log_level level UNUSED, const char *fmt, ...) { va_list ap; @@ -174,9 +174,9 @@ static struct io_plan *test_read(struct io_conn *conn, return next(conn, h); } -static struct io_plan *success(struct io_conn *conn, +static struct io_plan *success(struct io_conn *conn UNUSED, const struct pubkey *them, - const struct wireaddr *addr, + const struct wireaddr *addr UNUSED, const struct crypto_state *cs, void *ctx) { diff --git a/gossipd/test/run-responder-success.c b/gossipd/test/run-responder-success.c index 4a74836ca..bf4817509 100644 --- a/gossipd/test/run-responder-success.c +++ b/gossipd/test/run-responder-success.c @@ -32,7 +32,7 @@ static struct io_plan *test_read(struct io_conn *conn, struct handshake *h); #define SUPERVERBOSE status_debug -void status_fmt(enum log_level level, const char *fmt, ...) +void status_fmt(enum log_level level UNUSED, const char *fmt, ...) { va_list ap; @@ -174,9 +174,9 @@ static struct io_plan *test_read(struct io_conn *conn, return next(conn, h); } -static struct io_plan *success(struct io_conn *conn, - const struct pubkey *them, - const struct wireaddr *addr, +static struct io_plan *success(struct io_conn *conn UNUSED, + const struct pubkey *them UNUSED, + const struct wireaddr *addr UNUSED, const struct crypto_state *cs, void *ctx) { diff --git a/hsmd/hsm.c b/hsmd/hsm.c index 8f1a8ed57..40d7b711d 100644 --- a/hsmd/hsm.c +++ b/hsmd/hsm.c @@ -823,11 +823,11 @@ static void sign_node_announcement(struct daemon_conn *master, const u8 *msg) #ifndef TESTING /* FIXME: This is used by debug.c, but doesn't apply to us. */ extern void dev_disconnect_init(int fd); -void dev_disconnect_init(int fd) +void dev_disconnect_init(int fd UNUSED) { } -static void master_gone(struct io_conn *unused, struct daemon_conn *dc) +static void master_gone(struct io_conn *unused UNUSED, struct daemon_conn *dc UNUSED) { /* Can't tell master, it's gone. */ exit(2); diff --git a/lightningd/bitcoind.c b/lightningd/bitcoind.c index 9380fc963..39ad7c715 100644 --- a/lightningd/bitcoind.c +++ b/lightningd/bitcoind.c @@ -115,7 +115,7 @@ static char *bcli_args(struct bitcoin_cli *bcli) return ret; } -static void bcli_finished(struct io_conn *conn, struct bitcoin_cli *bcli) +static void bcli_finished(struct io_conn *conn UNUSED, struct bitcoin_cli *bcli) { int ret, status; struct bitcoind *bitcoind = bcli->bitcoind; @@ -202,7 +202,7 @@ static void next_bcli(struct bitcoind *bitcoind) io_set_finish(conn, bcli_finished, bcli); } -static void process_donothing(struct bitcoin_cli *bcli) +static void process_donothing(struct bitcoin_cli *bcli UNUSED) { } diff --git a/lightningd/chaintopology.c b/lightningd/chaintopology.c index 10f604286..6b1591879 100644 --- a/lightningd/chaintopology.c +++ b/lightningd/chaintopology.c @@ -417,7 +417,7 @@ static void remove_tip(struct chain_topology *topo) tal_free(b); } -static void have_new_block(struct bitcoind *bitcoind, +static void have_new_block(struct bitcoind *bitcoind UNUSED, struct bitcoin_block *blk, struct chain_topology *topo) { @@ -449,7 +449,7 @@ static void try_extend_tip(struct chain_topology *topo) get_new_block, topo); } -static void init_topo(struct bitcoind *bitcoind, +static void init_topo(struct bitcoind *bitcoind UNUSED, struct bitcoin_block *blk, struct chain_topology *topo) { @@ -584,7 +584,7 @@ void json_dev_broadcast(struct command *cmd, } static void json_dev_blockheight(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer UNUSED, const jsmntok_t *params UNUSED) { struct chain_topology *topo = cmd->ld->topology; struct json_result *response; diff --git a/lightningd/dev_ping.c b/lightningd/dev_ping.c index 8bb31b3bf..24b0cdfce 100644 --- a/lightningd/dev_ping.c +++ b/lightningd/dev_ping.c @@ -9,7 +9,7 @@ #include #include -static void ping_reply(struct subd *subd, const u8 *msg, const int *fds, +static void ping_reply(struct subd *subd, const u8 *msg, const int *fds UNUSED, struct command *cmd) { u16 totlen; diff --git a/lightningd/gossip_control.c b/lightningd/gossip_control.c index aa5162bb2..a38c78eca 100644 --- a/lightningd/gossip_control.c +++ b/lightningd/gossip_control.c @@ -188,8 +188,8 @@ void gossip_init(struct lightningd *ld) tal_free(tmpctx); } -static void json_getnodes_reply(struct subd *gossip, const u8 *reply, - const int *fds, +static void json_getnodes_reply(struct subd *gossip UNUSED, const u8 *reply, + const int *fds UNUSED, struct command *cmd) { struct gossip_getnodes_entry **nodes; @@ -263,7 +263,7 @@ static const struct json_command listnodes_command = { }; AUTODATA(json_command, &listnodes_command); -static void json_getroute_reply(struct subd *gossip, const u8 *reply, const int *fds, +static void json_getroute_reply(struct subd *gossip UNUSED, const u8 *reply, const int *fds UNUSED, struct command *cmd) { struct json_result *response; @@ -355,8 +355,8 @@ static const struct json_command getroute_command = { AUTODATA(json_command, &getroute_command); /* Called upon receiving a getchannels_reply from `gossipd` */ -static void json_listchannels_reply(struct subd *gossip, const u8 *reply, - const int *fds, struct command *cmd) +static void json_listchannels_reply(struct subd *gossip UNUSED, const u8 *reply, + const int *fds UNUSED, struct command *cmd) { size_t i; struct gossip_getchannels_entry *entries; diff --git a/lightningd/jsonrpc.c b/lightningd/jsonrpc.c index 6344e2fb3..d27f8d8d0 100644 --- a/lightningd/jsonrpc.c +++ b/lightningd/jsonrpc.c @@ -67,7 +67,7 @@ static const struct json_command help_command = { AUTODATA(json_command, &help_command); static void json_stop(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer UNUSED, const jsmntok_t *params UNUSED) { struct json_result *response = new_json_result(cmd); @@ -122,8 +122,8 @@ static const struct json_command dev_rhash_command = { }; AUTODATA(json_command, &dev_rhash_command); -static void json_crash(struct command *cmd, - const char *buffer, const jsmntok_t *params) +static void json_crash(struct command *cmd UNUSED, + const char *buffer UNUSED, const jsmntok_t *params UNUSED) { fatal("Crash at user request"); } @@ -137,7 +137,7 @@ AUTODATA(json_command, &dev_crash_command); #endif /* DEVELOPER */ static void json_getinfo(struct command *cmd, - const char *buffer, const jsmntok_t *params) + const char *buffer UNUSED, const jsmntok_t *params UNUSED) { struct json_result *response = new_json_result(cmd); diff --git a/lightningd/log.c b/lightningd/log.c index 4c67b9539..d3218b1ed 100644 --- a/lightningd/log.c +++ b/lightningd/log.c @@ -534,7 +534,7 @@ static void log_crash(int sig) fprintf(stderr, "\n"); } -void crashlog_activate(const char *argv0, struct log *log) +void crashlog_activate(const char *argv0 UNUSED, struct log *log) { struct sigaction sa; crashlog = log; diff --git a/lightningd/memdump.c b/lightningd/memdump.c index 92ac85e82..3b68c8e61 100644 --- a/lightningd/memdump.c +++ b/lightningd/memdump.c @@ -66,7 +66,7 @@ static const struct json_command dev_memdump_command = { }; AUTODATA(json_command, &dev_memdump_command); -static int json_add_syminfo(void *data, uintptr_t pc, +static int json_add_syminfo(void *data, uintptr_t pc UNUSED, const char *filename, int lineno, const char *function) { diff --git a/lightningd/netaddress.c b/lightningd/netaddress.c index 35b85ad87..58845d1bd 100644 --- a/lightningd/netaddress.c +++ b/lightningd/netaddress.c @@ -138,7 +138,7 @@ static bool IsRFC4843(const struct wireaddr *addr) return IsIPv6(addr) && (GetByte(addr, 15) == 0x20 && GetByte(addr, 14) == 0x01 && GetByte(addr, 13) == 0x00 && (GetByte(addr, 12) & 0xF0) == 0x10); } -static bool IsTor(const struct wireaddr *addr) +static bool IsTor(const struct wireaddr *addr UNUSED) { /* FIXME */ return false; diff --git a/lightningd/payalgo.c b/lightningd/payalgo.c index 094ef72b2..852d5bf54 100644 --- a/lightningd/payalgo.c +++ b/lightningd/payalgo.c @@ -139,8 +139,8 @@ static void json_pay_sendpay_resolve(const struct sendpay_result *r, json_pay_try(pay); } -static void json_pay_getroute_reply(struct subd *gossip, - const u8 *reply, const int *fds, +static void json_pay_getroute_reply(struct subd *gossip UNUSED, + const u8 *reply, const int *fds UNUSED, struct pay *pay) { struct route_hop *route; diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 9753a8786..5b32ad4c5 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -51,7 +51,7 @@ static void destroy_peer(struct peer *peer) static void copy_to_parent_log(const char *prefix, enum log_level level, bool continued, - const struct timeabs *time, + const struct timeabs *time UNUSED, const char *str, const u8 *io, struct log *parent_log) @@ -220,7 +220,7 @@ void channel_errmsg(struct channel *channel, int peer_fd, int gossip_fd, const struct crypto_state *cs, u64 gossip_index, - const struct channel_id *channel_id, + const struct channel_id *channel_id UNUSED, const char *desc, const u8 *err_for_them) { @@ -478,7 +478,7 @@ send_error: } static enum watch_result funding_announce_cb(struct channel *channel, - const struct bitcoin_tx *tx, + const struct bitcoin_tx *tx UNUSED, unsigned int depth) { if (depth < ANNOUNCE_MIN_DEPTH) { @@ -584,7 +584,7 @@ struct getpeers_args { }; static void gossipd_getpeers_complete(struct subd *gossip, const u8 *msg, - const int *fds, + const int *fds UNUSED, struct getpeers_args *gpa) { /* This is a little sneaky... */ @@ -927,9 +927,9 @@ static const struct json_command dev_fail_command = { }; AUTODATA(json_command, &dev_fail_command); -static void dev_reenable_commit_finished(struct subd *channeld, - const u8 *resp, - const int *fds, +static void dev_reenable_commit_finished(struct subd *channeld UNUSED, + const u8 *resp UNUSED, + const int *fds UNUSED, struct command *cmd) { command_success(cmd, null_response(cmd)); diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 7c9e12ba2..7c3250e14 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -330,7 +330,7 @@ static void destroy_hout_subd_died(struct htlc_out *hout) /* This is where channeld gives us the HTLC id, and also reports if it * failed immediately. */ -static void rcvd_htlc_reply(struct subd *subd, const u8 *msg, const int *fds, +static void rcvd_htlc_reply(struct subd *subd, const u8 *msg, const int *fds UNUSED, struct htlc_out *hout) { u16 failure_code; @@ -515,7 +515,7 @@ struct gossip_resolve { /* We received a resolver reply, which gives us the node_ids of the * channel we want to forward over */ static void channel_resolve_reply(struct subd *gossip, const u8 *msg, - const int *fds, struct gossip_resolve *gr) + const int *fds UNUSED, struct gossip_resolve *gr) { struct pubkey *nodes, *peer_id; diff --git a/lightningd/subd.c b/lightningd/subd.c index a279926ef..05c73e20a 100644 --- a/lightningd/subd.c +++ b/lightningd/subd.c @@ -58,8 +58,8 @@ static void destroy_subd_req(struct subd_req *sr) } /* Called when the callback is disabled because caller was freed. */ -static void ignore_reply(struct subd *sd, const u8 *msg, const int *fds, - void *arg) +static void ignore_reply(struct subd *sd, const u8 *msg UNUSED, const int *fds, + void *arg UNUSED) { size_t i; @@ -68,7 +68,7 @@ static void ignore_reply(struct subd *sd, const u8 *msg, const int *fds, close(fds[i]); } -static void disable_cb(void *disabler, struct subd_req *sr) +static void disable_cb(void *disabler UNUSED, struct subd_req *sr) { sr->replycb = ignore_reply; sr->disabler = NULL; @@ -275,7 +275,7 @@ int subd_raw(struct lightningd *ld, const char *name) static struct io_plan *sd_msg_read(struct io_conn *conn, struct subd *sd); -static void mark_freed(struct subd *unused, bool *freed) +static void mark_freed(struct subd *unused UNUSED, bool *freed) { *freed = true; } diff --git a/lightningd/test/run-cryptomsg.c b/lightningd/test/run-cryptomsg.c index 833c094d1..8ed05e3cf 100644 --- a/lightningd/test/run-cryptomsg.c +++ b/lightningd/test/run-cryptomsg.c @@ -36,7 +36,7 @@ static void do_write(const void *buf, size_t len) #define io_write(conn, p, len, next, arg) \ (do_write((p), (len)), (next)((conn), (arg)), NULL) -void status_fmt(enum log_level level, const char *fmt, ...) +void status_fmt(enum log_level level UNUSED, const char *fmt, ...) { va_list ap; @@ -46,7 +46,7 @@ void status_fmt(enum log_level level, const char *fmt, ...) va_end(ap); } -void status_io(enum log_level dir, const u8 *msg) +void status_io(enum log_level dir UNUSED, const u8 *msg UNUSED) { } @@ -60,7 +60,7 @@ void dev_sabotage_fd(int fd UNNEEDED) { fprintf(stderr, "dev_sabotage_fd called!\n"); abort(); } /* AUTOGENERATED MOCKS END */ -enum dev_disconnect dev_disconnect(int pkt_type) +enum dev_disconnect dev_disconnect(int pkt_type UNUSED) { return DEV_DISCONNECT_NORMAL; } @@ -73,13 +73,13 @@ enum dev_disconnect dev_disconnect(int pkt_type) const void *trc; -static struct io_plan *check_msg_write(struct io_conn *conn, struct peer *peer) +static struct io_plan *check_msg_write(struct io_conn *conn UNUSED, struct peer *peer UNUSED) { assert(tal_count(write_buf) == 2 + 16 + 5 + 16); return NULL; } -static struct io_plan *check_msg_read(struct io_conn *conn, struct peer *peer, +static struct io_plan *check_msg_read(struct io_conn *conn UNUSED, struct peer *peer UNUSED, u8 *msg) { assert(tal_count(msg) == 5); diff --git a/lightningd/test/run-find_my_path.c b/lightningd/test/run-find_my_path.c index 9c545b690..1dc98c9fd 100644 --- a/lightningd/test/run-find_my_path.c +++ b/lightningd/test/run-find_my_path.c @@ -35,7 +35,7 @@ void free_htlcs(struct lightningd *ld UNNEEDED, const struct channel *channel UN void gossip_init(struct lightningd *ld UNNEEDED) { fprintf(stderr, "gossip_init called!\n"); abort(); } /* Generated stub for handle_opts */ -bool handle_opts(struct lightningd *ld UNNEEDED, int argc UNNEEDED, char *argv[]) +bool handle_opts(struct lightningd *ld UNNEEDED, int argc UNNEEDED, char *argv[] UNUSED) { fprintf(stderr, "handle_opts called!\n"); abort(); } /* Generated stub for hash_htlc_key */ size_t hash_htlc_key(const struct htlc_key *htlc_key UNNEEDED) @@ -78,7 +78,7 @@ void subd_shutdown(struct subd *subd UNNEEDED, unsigned int seconds UNNEEDED) void timer_expired(tal_t *ctx UNNEEDED, struct timer *timer UNNEEDED) { fprintf(stderr, "timer_expired called!\n"); abort(); } /* Generated stub for txfilter_add_derkey */ -void txfilter_add_derkey(struct txfilter *filter UNNEEDED, u8 derkey[PUBKEY_DER_LEN]) +void txfilter_add_derkey(struct txfilter *filter UNNEEDED, u8 derkey[PUBKEY_DER_LEN] UNUSED) { fprintf(stderr, "txfilter_add_derkey called!\n"); abort(); } /* Generated stub for txfilter_new */ struct txfilter *txfilter_new(const tal_t *ctx UNNEEDED) @@ -127,7 +127,7 @@ char *opt_subd_dev_disconnect(const char *optarg UNNEEDED, struct lightningd *ld #endif #undef main -int main(int argc, char *argv[]) +int main(int argc UNUSED, char *argv[] UNUSED) { char *tmpctx = tal_tmpctx(NULL); char *argv0; diff --git a/test/test_protocol.c b/test/test_protocol.c index c21188236..43883cafb 100644 --- a/test/test_protocol.c +++ b/test/test_protocol.c @@ -1222,7 +1222,7 @@ static void start_clients(int a_to_b[2], close(a_to_b[1]); } -static void do_nothing(int sig) +static void do_nothing(int sig UNUSED) { } diff --git a/wallet/db.c b/wallet/db.c index 8ea5c0b7e..0270ba129 100644 --- a/wallet/db.c +++ b/wallet/db.c @@ -254,7 +254,7 @@ static void PRINTF_FMT(3, 4) tal_free(cmd); } -bool db_exec_prepared_mayfail_(const char *caller, struct db *db, sqlite3_stmt *stmt) +bool db_exec_prepared_mayfail_(const char *caller UNUSED, struct db *db, sqlite3_stmt *stmt) { assert(db->in_transaction); @@ -270,7 +270,7 @@ fail: } sqlite3_stmt *PRINTF_FMT(3, 4) - db_query(const char *caller, struct db *db, const char *fmt, ...) + db_query(const char *caller UNUSED, struct db *db, const char *fmt, ...) { va_list ap; char *query; diff --git a/wallet/invoices.c b/wallet/invoices.c index 129230065..2e6da6bf8 100644 --- a/wallet/invoices.c +++ b/wallet/invoices.c @@ -500,7 +500,7 @@ void invoices_waitany(const tal_t *ctx, void invoices_waitone(const tal_t *ctx, - struct invoices *invoices, + struct invoices *invoices UNUSED, struct invoice const *cinvoice, void (*cb)(const struct invoice *, void*), void *cbarg) diff --git a/wallet/test/run-db.c b/wallet/test/run-db.c index 10e05f19a..99f619a27 100644 --- a/wallet/test/run-db.c +++ b/wallet/test/run-db.c @@ -3,7 +3,7 @@ static void db_fatal(const char *fmt, ...); #define fatal db_fatal -static void db_log_(struct log *log, enum log_level level, const char *fmt, ...) +static void db_log_(struct log *log UNUSED, enum log_level level UNUSED, const char *fmt UNUSED, ...) { } #define log_ db_log_ diff --git a/wallet/test/run-wallet.c b/wallet/test/run-wallet.c index b28a2131e..536e15ea4 100644 --- a/wallet/test/run-wallet.c +++ b/wallet/test/run-wallet.c @@ -4,7 +4,7 @@ static void wallet_fatal(const char *fmt, ...); #define fatal wallet_fatal #include "test_utils.h" -static void db_log_(struct log *log, enum log_level level, const char *fmt, ...) +static void db_log_(struct log *log UNUSED, enum log_level level UNUSED, const char *fmt UNUSED, ...) { } #define log_ db_log_