From 0da434d126ddaeef80a92acddf3e7d2fab28b642 Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine Date: Mon, 3 Oct 2011 15:25:26 +0900 Subject: [PATCH] Fix GCC warnings. --- src/bip.c | 8 -------- src/connection.c | 5 +++-- src/irc.c | 8 ++++---- src/lex.l | 1 + src/log.c | 2 -- 5 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/bip.c b/src/bip.c index e154b33..d46ee2b 100644 --- a/src/bip.c +++ b/src/bip.c @@ -1570,9 +1570,6 @@ void adm_list_users(struct link_client *ic) hash_iterator_t it; hash_iterator_t lit; char buf[RET_STR_LEN + 1]; - connection_t *c; - - c = CONN(ic); bip_notify(ic, "-- User list"); for (hash_it_init(&_bip->users, &it); hash_it_item(&it); @@ -1620,9 +1617,6 @@ void adm_list_networks(struct link_client *ic) { hash_iterator_t it; char buf[RET_STR_LEN + 1]; - connection_t *c; - - c = CONN(ic); bip_notify(ic, "-- Network list (* means SSL):"); for (hash_it_init(&_bip->networks, &it); hash_it_item(&it); @@ -1669,9 +1663,7 @@ noroom: void adm_list_connections(struct link_client *ic, struct bipuser *bu) { hash_iterator_t it; - connection_t *c; - c = CONN(ic); if (!bu) { bip_notify(ic, "-- Your connections:"); bu = LINK(ic)->user; diff --git a/src/connection.c b/src/connection.c index c793e18..f9cb51d 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1090,7 +1090,8 @@ static DH *dh_1024(void) } /* ripped from postfix's tls_dh.c */ -static DH *tmp_dh_cb(SSL *ssl_unused, int export, int keylength) +static DH *tmp_dh_cb(SSL *ssl_unused __attribute__((unused)), + int export, int keylength) { DH *ret; @@ -1351,7 +1352,7 @@ static int SSLize(connection_t *cn, int *nc) ERR_print_errors(errbio); if (err2 == SSL_ERROR_NONE) { - SSL_CIPHER *cipher; + const SSL_CIPHER *cipher; char buf[128]; int len; diff --git a/src/irc.c b/src/irc.c index edcb96e..f630940 100644 --- a/src/irc.c +++ b/src/irc.c @@ -308,7 +308,8 @@ static int irc_352(struct link_server *server, struct line *line) return OK_COPY_WHO; } -static int irc_315(struct link_server *server, struct line *l) +static int irc_315(struct link_server *server, + struct line *l __attribute__((unused))) { struct link *link = LINK(server); if (link->who_client) { @@ -325,7 +326,6 @@ static int irc_315(struct link_server *server, struct line *l) link->who_client, link->who_client->who_count); } } - l = NULL; /* keep gcc happy */ return OK_COPY_WHO; } @@ -1455,7 +1455,8 @@ static int irc_367(struct link_server *server, struct line *l) } /* same as irc_315 */ -static int irc_368(struct link_server *server, struct line *l) +static int irc_368(struct link_server *server, + struct line *l __attribute__((unused))) { struct link *link = LINK(server); if (link->who_client) { @@ -1473,7 +1474,6 @@ static int irc_368(struct link_server *server, struct line *l) link->who_client, link->who_client->who_count); } } - l = NULL; /* keep gcc happy */ return OK_COPY_WHO; } diff --git a/src/lex.l b/src/lex.l index fc3186b..3b662eb 100644 --- a/src/lex.l +++ b/src/lex.l @@ -1,3 +1,4 @@ +%option nounput noinput %{ /* * $Id: lex.l,v 1.23 2005/04/12 19:34:35 nohar Exp $ diff --git a/src/log.c b/src/log.c index 2d788f8..269c6cb 100644 --- a/src/log.c +++ b/src/log.c @@ -655,14 +655,12 @@ void log_ping_timeout(log_t *logdata) void log_connected(log_t *logdata) { - logstore_t *store; hash_iterator_t hi; snprintf(logdata->buffer, LOGLINE_MAXLEN, "%s -!- Connected to" " server...", timestamp()); for (hash_it_init(&logdata->logfgs, &hi); hash_it_item(&hi); hash_it_next(&hi)) { - store = hash_it_item(&hi); log_write(logdata, hash_it_key(&hi), logdata->buffer); } }