INN commit: trunk (6 files)

INN Commit rra at isc.org
Sat May 2 16:27:37 UTC 2015


    Date: Saturday, May 2, 2015 @ 09:27:37
  Author: iulius
Revision: 9841

Fix a few Clang warnings for unused variables and style improvement

Modified:
  trunk/backends/innxbatch.c
  trunk/innd/cc.c
  trunk/innd/lc.c
  trunk/nnrpd/tls.c
  trunk/storage/expire.c
  trunk/storage/tradspool/tradspool.c

-------------------------------+
 backends/innxbatch.c          |    5 ++---
 innd/cc.c                     |   22 +++++++++++-----------
 innd/lc.c                     |    3 +--
 nnrpd/tls.c                   |    2 --
 storage/expire.c              |    2 +-
 storage/tradspool/tradspool.c |    3 ++-
 6 files changed, 17 insertions(+), 20 deletions(-)

Modified: backends/innxbatch.c
===================================================================
--- backends/innxbatch.c	2015-05-02 15:39:27 UTC (rev 9840)
+++ backends/innxbatch.c	2015-05-02 16:27:37 UTC (rev 9841)
@@ -58,7 +58,7 @@
 /*
 **  Global variables.
 */
-static bool		Debug = 0;
+static bool		Debug = false;
 static bool		STATprint;
 static char		*REMhost;
 static double		STATbegin;
@@ -291,7 +291,6 @@
 /*
 **  Mark that the alarm went off.
 */
-/* ARGSUSED0 */
 static void
 CATCHalarm(int s UNUSED)
 {
@@ -355,7 +354,7 @@
       /* NOTREACHED */
       break;
     case 'D':
-      Debug++;
+      Debug = true;
       break;
 #ifdef FROMSTDIN
     case 'i':

Modified: innd/cc.c
===================================================================
--- innd/cc.c	2015-05-02 15:39:27 UTC (rev 9840)
+++ innd/cc.c	2015-05-02 16:27:37 UTC (rev 9841)
@@ -458,7 +458,7 @@
 **  Syntax-check the newsfeeds file.
 */
 const char *
-CCcheckfile(char *unused[])
+CCcheckfile(char *unused[] UNUSED)
 {
   char		**strings;
   char		*p;
@@ -469,7 +469,6 @@
   bool		needheaders, needoverview, needpath, needstoredgroup;
   bool		needreplicdata;
 
-  unused = unused;		/* ARGSUSED */
   /* Parse all site entries. */
   strings = SITEreadfile(false);
   fake.Buffer.size = 0;
@@ -632,12 +631,11 @@
 **  Flush the log files as well as exploder and process channels.
 */
 static const char *
-CCflushlogs(char *unused[])
+CCflushlogs(char *unused[] UNUSED)
 {
     SITE        *sp;
     CHANNEL     *cp;
     int         i;
-    unused = unused;		/* ARGSUSED */
 
     if (Debug)
 	return "1 In debug mode";
@@ -909,9 +907,8 @@
 **  Log our operating mode (via syslog).
 */
 static const char *
-CClogmode(char *unused[])
+CClogmode(char *unused[] UNUSED)
 {
-    unused = unused;		/* ARGSUSED */
     syslog(L_NOTICE, "%s servermode %s", LogName, CCcurrmode());
     return NULL;
 }
@@ -1962,9 +1959,8 @@
 **  Called when a write-in-progress is done on the channel.  Shouldn't happen.
 */
 static void
-CCwritedone(CHANNEL *unused)
+CCwritedone(CHANNEL *unused UNUSED)
 {
-    unused = unused;		/* ARGSUSED */
     syslog(L_ERROR, "%s internal CCwritedone", LogName);
 }
 
@@ -2064,16 +2060,20 @@
 }
 
 
+#ifdef HAVE_SIGACTION
+#define NO_SIGACTION_UNUSED UNUSED
+#else
+#define NO_SIGACTION_UNUSED
+#endif
+
 /*
 **  Restablish the control channel.
 */
 static void
-CCresetup(int unused)
+CCresetup(int s NO_SIGACTION_UNUSED)
 {
 #ifndef HAVE_SIGACTION
     xsignal(s, CCresetup);
-#else
-    unused = unused;		/* ARGSUSED */
 #endif
     CCclose();
     CCsetup();

Modified: innd/lc.c
===================================================================
--- innd/lc.c	2015-05-02 15:39:27 UTC (rev 9840)
+++ innd/lc.c	2015-05-02 16:27:37 UTC (rev 9841)
@@ -51,9 +51,8 @@
 **  Write-done function.  Shouldn't happen.
 */
 static void
-LCwritedone(CHANNEL *unused)
+LCwritedone(CHANNEL *unused UNUSED)
 {
-    unused = unused;		/* ARGSUSED */
     syslog(L_ERROR, "%s internal LCwritedone", LogName);
 }
 

Modified: nnrpd/tls.c
===================================================================
--- nnrpd/tls.c	2015-05-02 15:39:27 UTC (rev 9840)
+++ nnrpd/tls.c	2015-05-02 16:27:37 UTC (rev 9841)
@@ -29,8 +29,6 @@
 #ifdef HAVE_OPENSSL
 
 /* We must keep some of the info available. */
-static const char hexcodes[] = "0123456789ABCDEF";
-
 static bool tls_initialized = false;
 
 static int verify_depth;

Modified: storage/expire.c
===================================================================
--- storage/expire.c	2015-05-02 15:39:27 UTC (rev 9840)
+++ storage/expire.c	2015-05-02 16:27:37 UTC (rev 9841)
@@ -758,7 +758,7 @@
             keeper = true;
         if ((krps[i] == Remove) && strcmp(group, arts[i]) == 0)
             delete = true;
-        if ((krps[i] == Keep))
+        if (krps[i] == Keep)
             purge = false;
     }
     EXPprocessed++;

Modified: storage/tradspool/tradspool.c
===================================================================
--- storage/tradspool/tradspool.c	2015-05-02 15:39:27 UTC (rev 9840)
+++ storage/tradspool/tradspool.c	2015-05-02 16:27:37 UTC (rev 9841)
@@ -594,7 +594,8 @@
 	    return xrefs;
 	}
 	/* skip to next space or EOL */
-	for (q=p; *q && *q != ' ' && *q != '\n' && *q != '\r' ; ++q) ;
+        for (q=p; *q && *q != ' ' && *q != '\n' && *q != '\r' ; ++q)
+            ;
 
         xrefs[len] = xstrndup(p, q - p);
 



More information about the inn-committers mailing list