INN commit: branches/2.5 (12 files)

INN Commit rra at isc.org
Sun Jul 17 18:04:50 UTC 2011


    Date: Sunday, July 17, 2011 @ 11:04:50
  Author: iulius
Revision: 9248

Build INN with the new "-Wunused-but-set-variable" and 
"-Wunused-but-set-parameter" GCC 4.6.0 warnings.

Remove unused variables.

In innd/python.c, also use "wasspace" as a boolean.

In tests/overview/api-t.c, keep the "expires" variable because
it is set afterwards in the code to the right expected value.
Though unused after being set, it is worth keeping it for the
day when the overview API uses the value.

Modified:
  branches/2.5/backends/actsync.c
  branches/2.5/innd/python.c
  branches/2.5/innd/rc.c
  branches/2.5/innd/status.c
  branches/2.5/innfeed/article.c
  branches/2.5/innfeed/endpoint.c
  branches/2.5/innfeed/host.c
  branches/2.5/nnrpd/article.c
  branches/2.5/nnrpd/auth-ext.c
  branches/2.5/tests/authprogs/ident-t.c
  branches/2.5/tests/lib/xmalloc.c
  branches/2.5/tests/overview/api-t.c

---------------------------+
 backends/actsync.c        |    6 ------
 innd/python.c             |   27 +++++++++++++--------------
 innd/rc.c                 |    4 ++--
 innd/status.c             |    3 +--
 innfeed/article.c         |    4 ----
 innfeed/endpoint.c        |    3 ---
 innfeed/host.c            |    7 +------
 nnrpd/article.c           |    2 --
 nnrpd/auth-ext.c          |    2 --
 tests/authprogs/ident-t.c |    4 +---
 tests/lib/xmalloc.c       |    6 ++----
 tests/overview/api-t.c    |    2 +-
 12 files changed, 21 insertions(+), 49 deletions(-)

Modified: backends/actsync.c
===================================================================
--- backends/actsync.c	2011-07-17 18:03:49 UTC (rev 9247)
+++ backends/actsync.c	2011-07-17 18:04:50 UTC (rev 9248)
@@ -1800,9 +1800,6 @@
     int add;		/* number of groups added */
     int change;		/* number of groups changed */
     int remove;		/* number of groups removed */
-    int no_new_dir;	/* number of new groups with missing/empty dirs */
-    int new_dir;	/* number of new groups, non-empty dir no water chg */
-    int water_change;	/* number of new groups where hi&low water changed */
     int work;		/* adds + changes + removals */
     int same;		/* the number of groups the same */
     int ignore;		/* host1 newsgroups to ignore */
@@ -1901,9 +1898,6 @@
     remove = 0;
     same = 0;
     ignore = 0;
-    no_new_dir = 0;
-    new_dir = 0;
-    water_change = 0;
     for (i=0; i < grplen; ++i) {
 	/* skip non-output ...  */
 	if (grp[i].output == 0) {

Modified: innd/python.c
===================================================================
--- innd/python.c	2011-07-17 18:03:49 UTC (rev 9247)
+++ innd/python.c	2011-07-17 18:04:50 UTC (rev 9248)
@@ -111,7 +111,6 @@
 char *
 PYartfilter(const ARTDATA *data, char *artBody, long artLen, int lines)
 {
-    const ARTHEADER *hp;
     const HDRCONTENT *hc = data->HdrContent;
     int		hdrnum;
     int		i;
@@ -125,7 +124,6 @@
     hdrnum = 0;
     for (i = 0 ; i < MAX_ARTHEADER ; i++) {
 	if (HDR_FOUND(i)) {
-	    hp = &ARTheaders[i];
 	    PYheaditem[hdrnum] = PyBuffer_FromMemory(HDR(i), HDR_LEN(i));
 	} else
 	    PYheaditem[hdrnum] = Py_None;
@@ -477,7 +475,8 @@
     char	*instring, *wpos, *p, *q;
     char	*workstring = NULL;
     Py_ssize_t  insize;
-    int         worksize, newsize, i, wasspace;
+    int         worksize, i;
+    bool        wasspace;
     int		lines = 0;
     HASH	myhash;
 
@@ -516,21 +515,21 @@
 	 * do a copy because this is probably an original art
 	 * buffer. */
 	workstring =  memcpy(xmalloc(worksize), wpos, worksize);
-	newsize = wasspace = 0;
+        wasspace = false;
 	p = wpos;
 	q = workstring;
 	for (i=0 ; i<worksize ; i++) {
 	    if (isspace((unsigned char) *p)) {
-		if (!wasspace)
-		    *q++ = ' ';
-		wasspace = 1;
-	    }
-	    else {
-		*q++ = tolower(*p);
-		wasspace = 0;
-	    }
-	    p++;
-	}
+                if (!wasspace) {
+                    *q++ = ' ';
+                }
+                wasspace = true;
+	    } else {
+                *q++ = tolower(*p);
+                wasspace = false;
+            }
+            p++;
+        }
 	worksize = q - workstring;
 	myhash = Hash(workstring, worksize);
 	free(workstring);

Modified: innd/rc.c
===================================================================
--- innd/rc.c	2011-07-17 18:03:49 UTC (rev 9247)
+++ innd/rc.c	2011-07-17 18:04:50 UTC (rev 9248)
@@ -768,7 +768,6 @@
     int			infocount;
     int                 groupcount;
     int                 maxgroup;
-    REMOTEHOST_DATA 	*dt;
     REMOTEHOST		*rp;
     char		*word;
     REMOTEHOST		*groups;
@@ -815,7 +814,8 @@
 	syslog(L_FATAL, "%s cant read %s: %m", LogName, filename);
 	exit(1);
     }
-    dt = *data = xmalloc(sizeof(REMOTEHOST_DATA));
+
+    *data = xmalloc(sizeof(REMOTEHOST_DATA));
     rp = *list = xmalloc(sizeof(REMOTEHOST));
 
 #if	!defined(HAVE_UNIX_DOMAIN_SOCKETS)

Modified: innd/status.c
===================================================================
--- innd/status.c	2011-07-17 18:03:49 UTC (rev 9247)
+++ innd/status.c	2011-07-17 18:04:50 UTC (rev 9248)
@@ -98,7 +98,7 @@
 STATUSsummary(void)
 {
   FILE			*F;
-  int			i, j;
+  int			i;
   CHANNEL               *cp;
   int			activeCxn = 0;
   int			sleepingCxns = 0;
@@ -144,7 +144,6 @@
 
   tmp = head = NULL;
   for (i = 0; (cp = CHANiter(&i, CTnntp)) != NULL; ) {
-    j = 0;
     strlcpy(TempString,
 	    cp->Address.ss_family == 0 ? "localhost" : RChostname(cp),
             sizeof(TempString));

Modified: innfeed/article.c
===================================================================
--- innfeed/article.c	2011-07-17 18:03:49 UTC (rev 9247)
+++ innfeed/article.c	2011-07-17 18:04:50 UTC (rev 9248)
@@ -815,9 +815,7 @@
      characters as needed */
 static bool prepareArticleForNNTP (Article article)
 {
-  static Buffer dotFirstBuffer ;
   static Buffer dotBuffer ;
-  static Buffer crlfBuffer ;
   Buffer *nntpBuffs = NULL ;
   int buffLen = 0 ;
   int buffIdx = 0 ;
@@ -841,8 +839,6 @@
   if (dotBuffer == NULL)
     {
       dotBuffer = newBufferByCharP (".\r\n",3,3) ;
-      dotFirstBuffer = newBufferByCharP ("\r\n.",3,3) ;
-      crlfBuffer = newBufferByCharP ("\r\n",2,2) ;
     }
 
   /* overlay a set of buffers on top of the articles contents buffer. This

Modified: innfeed/endpoint.c
===================================================================
--- innfeed/endpoint.c	2011-07-17 18:03:49 UTC (rev 9247)
+++ innfeed/endpoint.c	2011-07-17 18:04:50 UTC (rev 9248)
@@ -228,12 +228,10 @@
 
   if (fd > absHighestFd)
     {
-      static bool sizelogged = false ;
           
 #if defined (FD_SETSIZE)
       if ((unsigned int) fd >= FD_SETSIZE)
         {
-          sizelogged = true ;
           warn ("ME fd (%d) looks too big (%d -- FD_SETSIZE)", fd,
                 FD_SETSIZE) ;
           return NULL ;
@@ -241,7 +239,6 @@
 #else
       if (fd > (sizeof (fd_set) * CHAR_BIT))
         {
-          sizelogged = true ;
           warn ("ME fd (%d) looks too big (%d -- sizeof (fd_set) * CHAR_BIT)",
                 fd, (sizeof (fd_set) * CHAR_BIT)) ;
           return NULL ;

Modified: innfeed/host.c
===================================================================
--- innfeed/host.c	2011-07-17 18:03:49 UTC (rev 9247)
+++ innfeed/host.c	2011-07-17 18:04:50 UTC (rev 9248)
@@ -566,7 +566,7 @@
 
 static void hostReconfigure(Host h, HostParams params)
 {
-  unsigned int i, absMaxCxns ;
+  unsigned int i;
   double oldBacklogFilter ;
   
   if (strcmp(h->params->ipName, params->ipName) != 0)
@@ -585,7 +585,6 @@
   
   oldBacklogFilter = h->params->dynBacklogFilter;
   i = h->params->absMaxConnections; /* keep old value */
-  absMaxCxns = params->absMaxConnections;
   /* Use this set of params and allocate, and free
    * up the old
    */
@@ -2854,8 +2853,6 @@
   scope *s ;
   HostParams p=NULL;
 
-  bool isGood = false ;
-
   if (topScope == NULL)
     return p;
   
@@ -2868,8 +2865,6 @@
 
       p=hostDetails(s,v->name,false,NULL);
 
-      isGood = true ;
-      
       break ;
     }
 

Modified: nnrpd/article.c
===================================================================
--- nnrpd/article.c	2011-07-17 18:03:49 UTC (rev 9247)
+++ nnrpd/article.c	2011-07-17 18:04:50 UTC (rev 9248)
@@ -335,12 +335,10 @@
 {
     const char		*p, *q, *r;
     const char		*s, *path, *xref, *endofpath;
-    long		bytecount;
     char		lastchar;
 
     ARTcount++;
     GRParticles++;
-    bytecount = 0;
     lastchar = -1;
 
     /* Get the headers and detect if wire format. */

Modified: nnrpd/auth-ext.c
===================================================================
--- nnrpd/auth-ext.c	2011-07-17 18:03:49 UTC (rev 9247)
+++ nnrpd/auth-ext.c	2011-07-17 18:04:50 UTC (rev 9248)
@@ -41,14 +41,12 @@
     pid_t pid;
     char *path;
     struct vector *args;
-    bool allocated = false;
 
     /* Parse the command and find the path to the binary. */
     args = vector_split_space(command, NULL);
     path = args->strings[0];
     if (path[0] != '/') {
         path = concatpath(dir, path);
-        allocated = true;
     }
 
     /* Set up the pipes and run the program. */

Modified: tests/authprogs/ident-t.c
===================================================================
--- tests/authprogs/ident-t.c	2011-07-17 18:03:49 UTC (rev 9247)
+++ tests/authprogs/ident-t.c	2011-07-17 18:04:50 UTC (rev 9248)
@@ -135,14 +135,12 @@
 int
 main(void)
 {
-    int n;
-
     if (access("ident.t", F_OK) < 0)
         if (access("authprogs/ident.t", F_OK) == 0)
             chdir("authprogs");
 
     test_init(4);
-    n = server_ipv4(1);
+    server_ipv4(1);
 
     return 0;
 }

Modified: tests/lib/xmalloc.c
===================================================================
--- tests/lib/xmalloc.c	2011-07-17 18:03:49 UTC (rev 9247)
+++ tests/lib/xmalloc.c	2011-07-17 18:04:50 UTC (rev 9248)
@@ -150,13 +150,12 @@
 test_asprintf(size_t size)
 {
     char *copy, *string;
-    int status;
     size_t i;
 
     string = xmalloc(size);
     memset(string, 42, size - 1);
     string[size - 1] = '\0';
-    status = xasprintf(&copy, "%s", string);
+    xasprintf(&copy, "%s", string);
     free(string);
     for (i = 0; i < size - 1; i++)
         if (copy[i] != 42)
@@ -186,13 +185,12 @@
 test_vasprintf(size_t size)
 {
     char *copy, *string;
-    int status;
     size_t i;
 
     string = xmalloc(size);
     memset(string, 42, size - 1);
     string[size - 1] = '\0';
-    status = xvasprintf_wrapper(&copy, "%s", string);
+    xvasprintf_wrapper(&copy, "%s", string);
     free(string);
     for (i = 0; i < size - 1; i++)
         if (copy[i] != 42)

Modified: tests/overview/api-t.c
===================================================================
--- tests/overview/api-t.c	2011-07-17 18:03:49 UTC (rev 9247)
+++ tests/overview/api-t.c	2011-07-17 18:04:50 UTC (rev 9248)
@@ -264,7 +264,7 @@
            struct overview_data *data)
 {
     bool status = true;
-    time_t expires;
+    time_t expires UNUSED; // See below why it is still unused.
     char *saw;
 
     if (artnum != data->number) {




More information about the inn-committers mailing list