Delete local variables that are set but never read.
authorMichael Poole <mdpoole@troilus.org>
Tue, 24 Jan 2012 02:06:56 +0000 (21:06 -0500)
committerMichael Poole <mdpoole@troilus.org>
Tue, 24 Jan 2012 02:06:56 +0000 (21:06 -0500)
gcc 4.6 complains about these with -Wall.

ChangeLog
ircd/ircd_res.c
ircd/m_nick.c
ircd/m_ping.c
ircd/m_whois.c
ircd/parse.c
ircd/s_conf.c
ircd/s_stats.c

index ff001296c50f5d03e3768c2178eaaac84c609154..2699fe687a84835e3cfe9565d1ca11237faf410d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2011-01-23  Michael Poole <mdpoole@troilus.org>
+
+       * 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 <mdpoole@troilus.org>
 
        * ircd/gline.c (gline_modify): Notify opers using SNO_AUTO rather
 2011-01-23  Michael Poole <mdpoole@troilus.org>
 
        * ircd/gline.c (gline_modify): Notify opers using SNO_AUTO rather
index 88b0efaee3f941758aab1d2472507902e602a97c..627e12e826fa813361d0a2737b7e8543aa383ec9 100644 (file)
@@ -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 */
 {
   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;
   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;
 
     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 += CLASS_SIZE;
-
     current += TTL_SIZE;
 
     rd_length = irc_ns_get16(current);
     current += TTL_SIZE;
 
     rd_length = irc_ns_get16(current);
index b1fa7fd8da82005882cafbfd96a09921959b5170..fe13d4ecb2722f8214cfea7d746bee92de054f8b 100644 (file)
@@ -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;
   char           nick[NICKLEN + 2];
   char*          arg;
   char*          s;
-  const char*    client_name;
 
   assert(0 != cptr);
   assert(cptr == sptr);
 
   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");
 
   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;
   if (parc < 2) {
     send_reply(sptr, ERR_NONICKNAMEGIVEN);
     return 0;
index c1393d44b95e10d6e72675c65caebfddf65446b1..95d747953e3a37d8ede7a9abfac110e0127099f6 100644 (file)
@@ -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;
 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);
 
   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))) {
   destination = parv[2];        /* Will get NULL or pointer (parc >= 2!!) */
 
   if (!EmptyString(destination) && 0 != ircd_strcmp(destination, cli_name(&me))) {
index f38d6adfefde91a4796d8c6ca3b72923e385d038..01c9db55db3d1d8311a6b89f76bc40ffa79a9930 100644 (file)
@@ -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 */
 {
   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? */
   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);
      *   the target user(s) are on;
      */
     user = cli_user(acptr);
-    name = (!*(cli_name(acptr))) ? "?" : cli_name(acptr);
     assert(user);
 
     invis = (acptr != sptr) && IsInvisible(acptr);
     assert(user);
 
     invis = (acptr != sptr) && IsInvisible(acptr);
index 65b7d020844bcee4ba8e83e64836095f99153db6..b79ebb8ace48f6f52a9e50dce8812c4ddb2c82c2 100644 (file)
@@ -824,7 +824,6 @@ parse_client(struct Client *cptr, char *buffer, char *bufend)
   char*           s;
   int             i;
   int             paramcount;
   char*           s;
   int             i;
   int             paramcount;
-  int             noprefix = 0;
   struct Message* mptr;
   MessageHandler  handler = 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 */
   }
     while (*ch == ' ')
       ch++;                     /* Advance to command */
   }
-  else
-    noprefix = 1;
   if (*ch == '\0')
   {
     ServerStats->is_empt++;
   if (*ch == '\0')
   {
     ServerStats->is_empt++;
index 96f2b99efed09ce18333be6e4218e5e1bcb1b2cd..7db9ff2e4722e68136e3532d6cc7cc5446b475df 100644 (file)
@@ -94,7 +94,6 @@ static void killcomment(struct Client* sptr, const char* filename)
   FBFILE*     file = 0;
   char        line[80];
   struct stat sb;
   FBFILE*     file = 0;
   char        line[80];
   struct stat sb;
-  struct tm*  tm;
 
   if (NULL == (file = fbopen(filename, "r"))) {
     send_reply(sptr, ERR_NOMOTD);
 
   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);
     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) {
   while (fbgets(line, sizeof(line) - 1, file)) {
     char* end = line + strlen(line);
     while (end > line) {
index c3f01cd7c43abc0e64b5c2c5fe01dc748d253a47..b373c91f17ea3719f80788c0b57bf19371c4b0f5 100644 (file)
@@ -90,14 +90,13 @@ stats_configured_links(struct Client *sptr, const struct StatDesc* sd,
   struct ConfItem *tmp;
   unsigned short int port;
   int maximum;
   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;
 
   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;
       name = BadPtr(tmp->name) ? null : tmp->name;
       username = BadPtr(tmp->username) ? null : tmp->username;
       hub_limit = BadPtr(tmp->hub_limit) ? null : tmp->hub_limit;