INN commit: trunk (20 files)

INN Commit rra at isc.org
Sat Mar 15 22:29:46 UTC 2014


    Date: Saturday, March 15, 2014 @ 15:29:46
  Author: iulius
Revision: 9623

Fix clang warnings about unused variables

Modified:
  trunk/backends/buffchan.c
  trunk/backends/cvtbatch.c
  trunk/backends/shlock.c
  trunk/expire/fastrm.c
  trunk/expire/makedbz.c
  trunk/expire/makehistory.c
  trunk/expire/prunehistory.c
  trunk/frontends/ctlinnd.c
  trunk/frontends/getlist.c
  trunk/frontends/rnews.c
  trunk/innfeed/endpoint.c
  trunk/innfeed/imap_connection.c
  trunk/innfeed/tape.c
  trunk/nnrpd/perm.c
  trunk/nnrpd/post.c
  trunk/tests/lib/confparse-t.c
  trunk/tests/nnrpd/auth-ext-t.c
  trunk/tests/overview/api-t.c
  trunk/tests/runtests.c
  trunk/tests/util/innbind-t.c

---------------------------+
 backends/buffchan.c       |    1 -
 backends/cvtbatch.c       |    2 --
 backends/shlock.c         |    1 -
 expire/fastrm.c           |    1 -
 expire/makedbz.c          |    1 -
 expire/makehistory.c      |    3 ---
 expire/prunehistory.c     |    1 -
 frontends/ctlinnd.c       |    1 -
 frontends/getlist.c       |    2 +-
 frontends/rnews.c         |   11 ++++++-----
 innfeed/endpoint.c        |    4 ----
 innfeed/imap_connection.c |   23 ++++++++---------------
 innfeed/tape.c            |    2 --
 nnrpd/perm.c              |    2 +-
 nnrpd/post.c              |    2 +-
 tests/lib/confparse-t.c   |    2 +-
 tests/nnrpd/auth-ext-t.c  |    2 +-
 tests/overview/api-t.c    |    2 +-
 tests/runtests.c          |    1 -
 tests/util/innbind-t.c    |    2 +-
 20 files changed, 21 insertions(+), 45 deletions(-)

Modified: backends/buffchan.c
===================================================================
--- backends/buffchan.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ backends/buffchan.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -409,7 +409,6 @@
 	    break;
 	}
     ac -= optind;
-    av += optind;
     if (ac)
 	die("usage error");
 

Modified: backends/cvtbatch.c
===================================================================
--- backends/cvtbatch.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ backends/cvtbatch.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -1,5 +1,4 @@
 /*  $Id$
-**
 **  Read file list on standard input and spew out batch files.
 */
 
@@ -57,7 +56,6 @@
 	    }
 	}
     ac -= optind;
-    av += optind;
     if (ac)
 	die("usage error");
 

Modified: backends/shlock.c
===================================================================
--- backends/shlock.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ backends/shlock.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -172,7 +172,6 @@
   }
 
   ac -= optind;
-  av += optind;
   if (ac || pid == 0 || name == NULL) {
     Usage();
   }

Modified: expire/fastrm.c
===================================================================
--- expire/fastrm.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ expire/fastrm.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -273,7 +273,6 @@
                     dlen = strlen(line);
                     dir = xstrdup(line);
                 } else {
-                    p = line;
                     dlen = -1;
                     dir = NULL;
                 }

Modified: expire/makedbz.c
===================================================================
--- expire/makedbz.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ expire/makedbz.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -273,7 +273,6 @@
     }
 
     argc -= optind;
-    argv += optind;
     if (argc) {
 	Usage();
     }

Modified: expire/makehistory.c
===================================================================
--- expire/makehistory.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ expire/makehistory.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -710,10 +710,8 @@
         }
     }
 
-    MessageID = (char *)NULL;
     Arrived = art->arrived;
     Expires = 0;
-    Posted = 0;
 
     if (!Msgidp->HasHeader) {
         warn("no Message-ID header in %s", TokenToText(*art->token));
@@ -938,7 +936,6 @@
 	}
     }
     argc -= optind;
-    argv += optind;
     if (argc) {
         fprintf(stderr, "%s", usage);
         exit(1);

Modified: expire/prunehistory.c
===================================================================
--- expire/prunehistory.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ expire/prunehistory.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -62,7 +62,6 @@
 	    break;
 	}
     ac -= optind;
-    av += optind;
     if (ac) {
 	Usage();
 	rc = 1;

Modified: frontends/ctlinnd.c
===================================================================
--- frontends/ctlinnd.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ frontends/ctlinnd.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -262,7 +262,6 @@
 	case 3:
 	    break;
 	}
-	ac = 3;
     }
     else if (ac > cp->argc && cp->Glue) {
 	/* Glue any extra words together. */

Modified: frontends/getlist.c
===================================================================
--- frontends/getlist.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ frontends/getlist.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -306,7 +306,7 @@
     /* Be polite and say goodbye; it gives the server a chance to shut the
        connection down cleanly. */
     if (nntp_send_line(nntp, "QUIT"))
-        status = nntp_read_response(nntp, &response, &line);
+        nntp_read_response(nntp, &response, &line);
     nntp_free(nntp);
     exit(0);
 }

Modified: frontends/rnews.c
===================================================================
--- frontends/rnews.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ frontends/rnews.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -434,12 +434,13 @@
        seems like the best of a set of bad options; Reject would save the
        article into bad and then someone might reprocess it, leaving us with
        accepting the truncated version. */
-    for (p = article, left = artsize; left; p += i, left -= i)
-	if ((i = read(fd, p, left)) <= 0) {
-	    i = errno;
+    for (p = article, left = artsize; left; p += i, left -= i) {
+        i = read(fd, p, left);
+        if (i <= 0) {
             warn("cannot read, wanted %d got %d", artsize, artsize - left);
-	    return true;
-	}
+            return true;
+        }
+    }
     if (p[-1] != '\n') {
 	*p++ = '\n';
         artsize++;

Modified: innfeed/endpoint.c
===================================================================
--- innfeed/endpoint.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ innfeed/endpoint.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -940,8 +940,6 @@
 
   bCount = (bCount > IOV_MAX ? IOV_MAX : bCount) ;
 
-  i = 0 ;
-
   /* now set up the iovecs for the readv */
   if (bCount > 0)
     {
@@ -1064,8 +1062,6 @@
 
   bCount = (bCount > IOV_MAX ? IOV_MAX : bCount) ;
 
-  i = 0 ;
-  
   if (bCount > 0)
     {
       vp = xcalloc (bCount, sizeof(struct iovec)) ;

Modified: innfeed/imap_connection.c
===================================================================
--- innfeed/imap_connection.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ innfeed/imap_connection.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -1043,7 +1043,6 @@
 	return RET_FAIL;
     }
 
-    res = RET_OK;
     /* now let's look at the control to see what it is */
     if (!strncasecmp(control_header,"newgroup",8)) {
 	control_header += 8;
@@ -1758,10 +1757,9 @@
 
     ASSERT(cxn->imap_sleepTimerId == 0);
 
-    /* make the IMAP connection */
-    result = SetupIMAPConnection(cxn,
-				 cxn->ServerName,
-				 IMAP_PORT);
+    /* make the IMAP connection */                        SetupIMAPConnection(cxn,
+                        cxn->ServerName,
+                        IMAP_PORT);
 
     /* Listen to the intro and start the authenticating process */
     result = imap_listenintro(cxn);
@@ -4016,9 +4014,9 @@
 	result = FindHeader(cxn->current_bufs, "Followup-To",
 			    &to_list, &to_list_end);
 
-	if ((result != RET_OK) || (to_list == NULL)) {
-	    result = FindHeader(cxn->current_bufs, "Newsgroups",
-				&to_list, &to_list_end);
+	if ((result != RET_OK) || (to_list == NULL)){
+        FindHeader(cxn->current_bufs, "Newsgroups",
+                   &to_list, &to_list_end);
 	}
 
 	/* free's original to_list */
@@ -4471,7 +4469,7 @@
 {
   const char *peerName ;
   time_t now = theTime() ;
-  int total, good, bad;
+  int total, bad;
 
   ASSERT (cxn != NULL) ;
 
@@ -4482,15 +4480,11 @@
   total += cxn->create_succeeded + cxn->create_failed;
   total += cxn->remove_succeeded + cxn->remove_failed;
 
-  good = cxn->lmtp_succeeded;
-  good += cxn->cancel_succeeded;
-  good += cxn->create_succeeded;
-  good += cxn->remove_succeeded;
-
   bad = cxn->lmtp_failed;
   bad += cxn->cancel_failed;
   bad += cxn->create_failed;
   bad += cxn->remove_failed;
+
   notice ("%s:%d %s seconds %ld accepted %d refused %d rejected %d",
           peerName, cxn->ident, (final ? "final" : "checkpoint"),
           (long) (now - cxn->timeCon), total, 0, bad);
@@ -4509,7 +4503,6 @@
       if (cxn->timeCon > 0)
         cxn->timeCon = theTime() ;
     }
-
 }
 
   /* return the number of articles the connection can be given. This lets

Modified: innfeed/tape.c
===================================================================
--- innfeed/tape.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ innfeed/tape.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -1090,8 +1090,6 @@
                  tape->inputFilename) ;
       else
         inpExists = true ;
-
-      outExists = false ;
     }
 
   /* now open up the input file and seek to the proper position. */

Modified: nnrpd/perm.c
===================================================================
--- nnrpd/perm.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ nnrpd/perm.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -1127,7 +1127,7 @@
     /* Are we editing an auth or access group? */
 
     inwhat	= 0;
-    newgroup	= curgroup = 0;
+    curgroup = 0;
 
     tok		= CONFgettoken(PERMtoks, cf->f);
 

Modified: nnrpd/post.c
===================================================================
--- nnrpd/post.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ nnrpd/post.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -1099,7 +1099,7 @@
     }
 
     strlcpy(frombuf, HDR(HDR__FROM), sizeof(frombuf));
-    for (i = 0, p = frombuf;p < frombuf + sizeof(frombuf);)
+    for (p = frombuf;p < frombuf + sizeof(frombuf);)
 	if ((p = strchr(p, '\n')) == NULL)
 	    break;
 	else

Modified: tests/lib/confparse-t.c
===================================================================
--- tests/lib/confparse-t.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ tests/lib/confparse-t.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -691,7 +691,7 @@
     n = test_warnings_uint(n);
     n = test_warnings_real(n);
     n = test_warnings_string(n);
-    n = test_warnings_list(n);
+    test_warnings_list(n);
 
     return 0;
 }

Modified: tests/nnrpd/auth-ext-t.c
===================================================================
--- tests/nnrpd/auth-ext-t.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ tests/nnrpd/auth-ext-t.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -129,7 +129,7 @@
                     "example.com auth: program caught signal 1\n");
     n = ok_external(n, client, "newline", "tester", NULL);
     n = ok_external(n, client, "partial", "tester", NULL);
-    n = ok_external(n, client, "partial-error", NULL,
+    ok_external(n, client, "partial-error", NULL,
                     "example.com auth: program error: This is an error\n");
 
     return 0;

Modified: tests/overview/api-t.c
===================================================================
--- tests/overview/api-t.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ tests/overview/api-t.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -704,7 +704,7 @@
     free(innconf->ovmethod);
     innconf->ovmethod = xstrdup("buffindexed");
     diag("buffindexed");
-    n = overview_tests(n);
+    overview_tests(n);
 
     return 0;
 }

Modified: tests/runtests.c
===================================================================
--- tests/runtests.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ tests/runtests.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -1149,7 +1149,6 @@
         fprintf(stderr, usage_message, argv[0], argv[0]);
         exit(1);
     }
-    argc -= optind;
     argv += optind;
 
     if (source != NULL) {

Modified: tests/util/innbind-t.c
===================================================================
--- tests/util/innbind-t.c	2014-03-15 20:49:43 UTC (rev 9622)
+++ tests/util/innbind-t.c	2014-03-15 22:29:46 UTC (rev 9623)
@@ -323,7 +323,7 @@
 
     n = test_ipv4(1);           /* Tests  1-5.  */
     n = test_ipv6(n);           /* Tests  6-10. */
-    n = test_sendfd(n);         /* Tests 11-15. */
+    test_sendfd(n);         /* Tests 11-15. */
 
     return 0;
 }



More information about the inn-committers mailing list