From 246a65025b51a3c5fb6900b2af4cbf22793d1416 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Mon, 23 Jan 2012 21:06:56 -0500 Subject: [PATCH] Delete local variables that are set but never read. gcc 4.6 complains about these with -Wall. --- ChangeLog | 18 ++++++++++++++++++ ircd/ircd_res.c | 4 +--- ircd/m_nick.c | 6 ------ ircd/m_ping.c | 3 +-- ircd/m_whois.c | 2 -- ircd/parse.c | 3 --- ircd/s_conf.c | 2 -- ircd/s_stats.c | 3 +-- 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index ff00129..2699fe6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2011-01-23 Michael Poole + + * ircd/ircd_res.c (proc_answer): Delete unread variable + query_class. + + * ircd/m_nick.c (m_nick): Delete unread variable client_name. + + * ircd/m_ping.c (m_ping): Delete unread variable origin. + + * ircd/m_whois.c (do_whois): Delete unread variable name. + + * ircd/parse.c (parse_client): Delete unread variable noprefix. + + * ircd/s_conf.c (killcomment): Delete unread variable tm. + + * ircd/s_stats.c (stats_configured_links): Delete unread variable + pass. + 2011-01-23 Michael Poole * ircd/gline.c (gline_modify): Notify opers using SNO_AUTO rather diff --git a/ircd/ircd_res.c b/ircd/ircd_res.c index 88b0efa..627e12e 100644 --- a/ircd/ircd_res.c +++ b/ircd/ircd_res.c @@ -633,7 +633,6 @@ proc_answer(struct reslist *request, HEADER* header, char* buf, char* eob) { char hostbuf[HOSTLEN + 100]; /* working buffer */ unsigned char *current; /* current position in buf */ - int query_class; /* answer class */ int type; /* answer type */ int n; /* temp count */ int rd_length; @@ -687,9 +686,8 @@ proc_answer(struct reslist *request, HEADER* header, char* buf, char* eob) type = irc_ns_get16(current); current += TYPE_SIZE; - query_class = irc_ns_get16(current); + /* We do not use the class or TTL values. */ current += CLASS_SIZE; - current += TTL_SIZE; rd_length = irc_ns_get16(current); diff --git a/ircd/m_nick.c b/ircd/m_nick.c index b1fa7fd..fe13d4e 100644 --- a/ircd/m_nick.c +++ b/ircd/m_nick.c @@ -146,7 +146,6 @@ int m_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) char nick[NICKLEN + 2]; char* arg; char* s; - const char* client_name; assert(0 != cptr); assert(cptr == sptr); @@ -154,11 +153,6 @@ int m_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) if (IsServerPort(cptr)) return exit_client(cptr, cptr, &me, "Use a different port"); - /* - * parv[0] will be empty for clients connecting for the first time - */ - client_name = (*(cli_name(sptr))) ? cli_name(sptr) : "*"; - if (parc < 2) { send_reply(sptr, ERR_NONICKNAMEGIVEN); return 0; diff --git a/ircd/m_ping.c b/ircd/m_ping.c index c1393d4..95d7479 100644 --- a/ircd/m_ping.c +++ b/ircd/m_ping.c @@ -178,14 +178,13 @@ int m_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) int mo_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { struct Client* acptr; - char *destination, *origin; + char *destination; assert(0 != cptr); assert(cptr == sptr); if (parc < 2 || EmptyString(parv[1])) return send_reply(sptr, ERR_NOORIGIN); - origin = parv[1]; destination = parv[2]; /* Will get NULL or pointer (parc >= 2!!) */ if (!EmptyString(destination) && 0 != ircd_strcmp(destination, cli_name(&me))) { diff --git a/ircd/m_whois.c b/ircd/m_whois.c index f38d6ad..01c9db5 100644 --- a/ircd/m_whois.c +++ b/ircd/m_whois.c @@ -235,7 +235,6 @@ static int do_wilds(struct Client* sptr, char *nick, int count, int parc) { struct Client *acptr; /* Current client we're considering */ struct User *user; /* the user portion of the client */ - const char *name; /* the name of this client */ struct Membership* chan; int invis; /* does +i apply? */ int member; /* Is this user on any channels? */ @@ -273,7 +272,6 @@ static int do_wilds(struct Client* sptr, char *nick, int count, int parc) * the target user(s) are on; */ user = cli_user(acptr); - name = (!*(cli_name(acptr))) ? "?" : cli_name(acptr); assert(user); invis = (acptr != sptr) && IsInvisible(acptr); diff --git a/ircd/parse.c b/ircd/parse.c index 65b7d02..b79ebb8 100644 --- a/ircd/parse.c +++ b/ircd/parse.c @@ -824,7 +824,6 @@ parse_client(struct Client *cptr, char *buffer, char *bufend) char* s; int i; int paramcount; - int noprefix = 0; struct Message* mptr; MessageHandler handler = 0; @@ -842,8 +841,6 @@ parse_client(struct Client *cptr, char *buffer, char *bufend) while (*ch == ' ') ch++; /* Advance to command */ } - else - noprefix = 1; if (*ch == '\0') { ServerStats->is_empt++; diff --git a/ircd/s_conf.c b/ircd/s_conf.c index 96f2b99..7db9ff2 100644 --- a/ircd/s_conf.c +++ b/ircd/s_conf.c @@ -94,7 +94,6 @@ static void killcomment(struct Client* sptr, const char* filename) FBFILE* file = 0; char line[80]; struct stat sb; - struct tm* tm; if (NULL == (file = fbopen(filename, "r"))) { send_reply(sptr, ERR_NOMOTD); @@ -103,7 +102,6 @@ static void killcomment(struct Client* sptr, const char* filename) return; } fbstat(&sb, file); - tm = localtime((time_t*) &sb.st_mtime); /* NetBSD needs cast */ while (fbgets(line, sizeof(line) - 1, file)) { char* end = line + strlen(line); while (end > line) { diff --git a/ircd/s_stats.c b/ircd/s_stats.c index c3f01cd..b373c91 100644 --- a/ircd/s_stats.c +++ b/ircd/s_stats.c @@ -90,14 +90,13 @@ stats_configured_links(struct Client *sptr, const struct StatDesc* sd, struct ConfItem *tmp; unsigned short int port; int maximum; - char *host, *pass, *name, *username, *hub_limit; + char *host, *name, *username, *hub_limit; for (tmp = GlobalConfList; tmp; tmp = tmp->next) { if ((tmp->status & sd->sd_funcdata)) { host = BadPtr(tmp->host) ? null : tmp->host; - pass = BadPtr(tmp->passwd) ? null : tmp->passwd; name = BadPtr(tmp->name) ? null : tmp->name; username = BadPtr(tmp->username) ? null : tmp->username; hub_limit = BadPtr(tmp->hub_limit) ? null : tmp->hub_limit; -- 2.20.1