INN commit: trunk (7 files)

INN Commit rra at isc.org
Mon Dec 9 21:30:42 UTC 2013


    Date: Monday, December 9, 2013 @ 13:30:42
  Author: iulius
Revision: 9582

Fix a few useless assignments (never read) reported by clang

Modified:
  trunk/innd/chan.c
  trunk/innd/nc.c
  trunk/innd/rc.c
  trunk/lib/conffile.c
  trunk/nnrpd/article.c
  trunk/nnrpd/commands.c
  trunk/storage/buffindexed/buffindexed.c

-----------------------------------+
 innd/chan.c                       |    2 +-
 innd/nc.c                         |    9 ++++-----
 innd/rc.c                         |   10 +++-------
 lib/conffile.c                    |    6 ++----
 nnrpd/article.c                   |    1 -
 nnrpd/commands.c                  |    4 ++--
 storage/buffindexed/buffindexed.c |    3 ++-
 7 files changed, 14 insertions(+), 21 deletions(-)

Modified: innd/chan.c
===================================================================
--- innd/chan.c	2013-12-09 20:07:03 UTC (rev 9581)
+++ innd/chan.c	2013-12-09 21:30:42 UTC (rev 9582)
@@ -539,7 +539,7 @@
 CHANiter(int *ip, enum channel_type type)
 {
     CHANNEL *cp;
-    int i = *ip;
+    int i;
 
     for (i = *ip; i >= 0 && i < channels.table_size; i++) {
         cp = &channels.table[i];

Modified: innd/nc.c
===================================================================
--- innd/nc.c	2013-12-09 20:07:03 UTC (rev 9581)
+++ innd/nc.c	2013-12-09 21:30:42 UTC (rev 9582)
@@ -1088,7 +1088,6 @@
   bool          validcommandtoolong;
   int           syntaxerrorcode = NNTP_ERR_SYNTAX;
 
-  readmore = movedata = false;
   if (Tracing || cp->Tracing)
     syslog(L_TRACE, "%s NCproc Used=%lu", CHANname(cp),
            (unsigned long) cp->In.used);
@@ -1604,7 +1603,6 @@
 
     if (movedata) { /* move data rather than extend buffer */
       TMRstart(TMR_DATAMOVE);
-      movedata = false;
       if (cp->Start > 0)
 	memmove(bp->data, &bp->data[cp->Start], bp->used - cp->Start);
       bp->used -= cp->Start;
@@ -1625,9 +1623,10 @@
       cp->Start = 0;
       TMRstop(TMR_DATAMOVE);
     }
-    if (readmore)
-      /* need to read more */
-      break;
+    if (readmore) {
+        /* need to read more */
+        break;
+    }
   }
 }
 

Modified: innd/rc.c
===================================================================
--- innd/rc.c	2013-12-09 20:07:03 UTC (rev 9581)
+++ innd/rc.c	2013-12-09 21:30:42 UTC (rev 9582)
@@ -662,7 +662,6 @@
   char	*s;
   char	*t;
   char	*word;
-  bool	flag;
 
   *toolong = false;
   if (*RCbuff == '\0') {
@@ -674,7 +673,6 @@
       return (NULL); /* Line too long */
     }
   }
-  p = RCbuff;
   do {
      /* Ignore blank and comment lines. */
      if ((p = strchr(RCbuff, '\n')) != NULL)
@@ -684,19 +682,17 @@
 	   *p = '\0';
      }
      for (p = RCbuff; *p == ' ' || *p == '\t' ; p++);
-     flag = true;
      if (*p == '\0' && !feof (F)) {
-       flag = false;
        fgets(RCbuff, sizeof RCbuff, F);
        (*num)++;
        if (strlen (RCbuff) == sizeof RCbuff) {
-	 *toolong = true;
-	 return (NULL); /* Line too long */
+           *toolong = true;
+           return (NULL); /* Line too long */
        }
        continue;
      }
      break;
-  } while (!feof (F) || !flag);
+  } while (!feof (F));
 
   if (*p == '"') { /* double quoted string ? */
     p++;

Modified: lib/conffile.c
===================================================================
--- lib/conffile.c	2013-12-09 20:07:03 UTC (rev 9581)
+++ lib/conffile.c	2013-12-09 21:30:42 UTC (rev 9582)
@@ -41,7 +41,7 @@
   char *s;
   char *t;
   char *word;
-  bool flag, comment;
+  bool comment;
 
   if (!F) return (NULL);	/* No conf file */
   if (!F->buf || !F->buf[0]) {
@@ -58,15 +58,13 @@
      if ((p = strchr(F->buf, '\n')) != NULL)
        *p = '\0';
      for (p = F->buf; *p == ' ' || *p == '\t' ; p++);
-     flag = true;
      if ((*p == '\0' || *p == '#') && !cfeof(F)) {
-       flag = false;
        if (getconfline(F, F->buf, F->sbuf))
          return (NULL); /* Line too long */
        continue;
      }
      break;
-  } while (!cfeof(F) || !flag);
+  } while (!cfeof(F));
 
   comment = false;
   if (*p == '"') { /* double quoted string ? */

Modified: nnrpd/article.c
===================================================================
--- nnrpd/article.c	2013-12-09 20:07:03 UTC (rev 9581)
+++ nnrpd/article.c	2013-12-09 21:30:42 UTC (rev 9582)
@@ -675,7 +675,6 @@
                   PERMcanauthenticate ? NNTP_FAIL_AUTH_NEEDED : NNTP_ERR_ACCESS);
 	    return;
 	}
-	tart=art;
 	Reply("%d %lu %s %s\r\n", what->ReplyCode, art, av[1], what->Item);
 	if (what->Type != STstat) {
 	    ARTsendmmap(what->Type);

Modified: nnrpd/commands.c
===================================================================
--- nnrpd/commands.c	2013-12-09 20:07:03 UTC (rev 9581)
+++ nnrpd/commands.c	2013-12-09 21:30:42 UTC (rev 9582)
@@ -197,7 +197,7 @@
     }
 
     close(pan[PIPE_WRITE]);
-    i = read(pan[PIPE_READ], path, sizeof(path));
+    read(pan[PIPE_READ], path, sizeof(path));
 
     waitpid(pid, &status, 0);
     if (!WIFEXITED(status) || WEXITSTATUS(status) != 0)
@@ -254,7 +254,7 @@
 
         /* Go on parsing the command line. */
         ac--;
-        ac += reArgify(av[ac], &av[ac], -1, true);
+        (void) reArgify(av[ac], &av[ac], -1, true);
 
 	strlcpy(PERMuser, "<none>", sizeof(PERMuser));
 

Modified: storage/buffindexed/buffindexed.c
===================================================================
--- storage/buffindexed/buffindexed.c	2013-12-09 20:07:03 UTC (rev 9581)
+++ storage/buffindexed/buffindexed.c	2013-12-09 21:30:42 UTC (rev 9582)
@@ -2237,7 +2237,7 @@
 
 void buffindexed_close(void) {
   struct stat	sb;
-  OVBUFF	*ovbuff = ovbufftab;
+  OVBUFF	*ovbuff = NULL;
 #ifdef OV_DEBUG
   FILE		*F = NULL;
   pid_t		pid;
@@ -2249,6 +2249,7 @@
 #endif /* OV_DEBUG */
 
 #ifdef OV_DEBUG
+  ovbuff = ovbufftab;
   for (; ovbuff != (OVBUFF *)NULL; ovbuff = ovbuff->next) {
     for (i = 0 ; i < ovbuff->totalblk ; i++) {
       trace = &ovbuff->trace[i];



More information about the inn-committers mailing list