INN commit: branches/2.6 (13 files)

INN Commit rra at isc.org
Thu May 5 12:39:19 UTC 2016


    Date: Thursday, May 5, 2016 @ 05:39:19
  Author: iulius
Revision: 10009

Fix signedness in printf-like statements (reported by cppcheck)

Modified:
  branches/2.6/backends/nntpget.c
  branches/2.6/contrib/reset-cnfs.c
  branches/2.6/expire/expireover.c
  branches/2.6/innd/status.c
  branches/2.6/innfeed/article.c
  branches/2.6/innfeed/buffer.c
  branches/2.6/innfeed/connection.c
  branches/2.6/innfeed/host.c
  branches/2.6/innfeed/imap_connection.c
  branches/2.6/innfeed/innlistener.c
  branches/2.6/innfeed/main.c
  branches/2.6/nnrpd/misc.c
  branches/2.6/nnrpd/nnrpd.c

---------------------------+
 backends/nntpget.c        |    2 
 contrib/reset-cnfs.c      |   11 +--
 expire/expireover.c       |    2 
 innd/status.c             |   52 +++++++--------
 innfeed/article.c         |   20 +++---
 innfeed/buffer.c          |    2 
 innfeed/connection.c      |   28 ++++----
 innfeed/host.c            |  145 ++++++++++++++++++++++----------------------
 innfeed/imap_connection.c |   10 +--
 innfeed/innlistener.c     |    2 
 innfeed/main.c            |    2 
 nnrpd/misc.c              |    6 -
 nnrpd/nnrpd.c             |    4 -
 13 files changed, 144 insertions(+), 142 deletions(-)

Modified: backends/nntpget.c
===================================================================
--- backends/nntpget.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ backends/nntpget.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -461,7 +461,7 @@
     if (Update) {
 	if ((F = fopen(Update, "w")) == NULL)
             sysdie("cannot update %s", Update);
-	fprintf(F, "got %ld offered %ld sent %ld rejected %ld\n",
+	fprintf(F, "got %lu offered %lu sent %lu rejected %lu\n",
 		STATgot, STAToffered, STATsent, STATrejected); 
 	if (ferror(F) || fclose(F) == EOF)
             sysdie("cannot update %s", Update);

Modified: contrib/reset-cnfs.c
===================================================================
--- contrib/reset-cnfs.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ contrib/reset-cnfs.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -12,7 +12,7 @@
 main(int argc, char *argv[])
 {
     int fd;
-    int i, j;
+    int i;
     char buf[512];
 #ifdef DO_LARGEFILES
     struct stat64 st;
@@ -19,7 +19,7 @@
 #else
     struct stat st;
 #endif
-    int numwr;
+    size_t j, numwr;
     bool status = true;
 
     bzero(buf, sizeof(buf));
@@ -45,11 +45,12 @@
                  * fuzz.  buf has 512 bytes in it, therefore containing data
                  * for (512 * 8) * 512 bytes of data. */
                 numwr = (st.st_size / (512*8) / sizeof(buf)) + 50;
-                printf("File %s: %lu %u\n", argv[i],
-                       (unsigned long) st.st_size, numwr);
+                printf("File %s: %lu %lu\n", argv[i],
+                       (unsigned long) st.st_size, (unsigned long) numwr);
                 for (j = 0; j < numwr; j++) {
                     if (!(j % 100)) {
-                        printf("\t%d/%d\n", j, numwr);
+                        printf("\t%lu/%lu\n", (unsigned long) j,
+                               (unsigned long) numwr);
                     }
                     write(fd, buf, sizeof(buf));
                 }

Modified: expire/expireover.c
===================================================================
--- expire/expireover.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ expire/expireover.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -201,7 +201,7 @@
         if (!OVexpiregroup(line, &low, history))
             warn("can't expire %s", line);
         else if (lowmark != NULL && low != 0)
-            fprintf(lowmark, "%s %u\n", line, low);
+            fprintf(lowmark, "%s %d\n", line, low);
         line = QIOread(qp);
     }
     if (signalled)

Modified: innd/status.c
===================================================================
--- innd/status.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ innd/status.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -292,16 +292,16 @@
   fprintf (F, "global (process)\n");
   fprintf (F, "         seconds: %ld\n", (long) seconds);
   offered = accepted + refused + rejected;
-  fprintf (F, "         offered: %-9ld\n", offered);
+  fprintf (F, "         offered: %-9lu\n", offered);
   if (!offered) offered = 1; /* to avoid division by zero */
   if (!size) size = 1; /* avoid divide by zero here too */
-  fprintf (F, "        accepted: %-9ld       %%accepted: %.1f%%\n",
+  fprintf (F, "        accepted: %-9lu       %%accepted: %.1f%%\n",
 	   accepted, (float) accepted / offered * 100);
-  fprintf (F, "         refused: %-9ld        %%refused: %.1f%%\n",
+  fprintf (F, "         refused: %-9lu        %%refused: %.1f%%\n",
 	   refused, (float) refused / offered * 100);
-  fprintf (F, "        rejected: %-9ld       %%rejected: %.1f%%\n",
+  fprintf (F, "        rejected: %-9lu       %%rejected: %.1f%%\n",
 	   rejected, (float) rejected / offered * 100);
-  fprintf (F, "      duplicated: %-9ld     %%duplicated: %.1f%%\n",
+  fprintf (F, "      duplicated: %-9lu     %%duplicated: %.1f%%\n",
 	   duplicate, (float) duplicate / offered * 100);
   fprintf (F, "           bytes: %-7s\n", PrettySize (size + DuplicateSize + RejectSize, str));
   fprintf (F, " duplicated size: %-7s  %%duplicated size: %.1f%%\n",
@@ -311,8 +311,8 @@
   fputc ('\n', F) ;
 
   if(innconf->logstatus) {
-    notice ("%s status seconds %ld accepted %ld "
-            "refused %ld rejected %ld duplicate %ld "
+    notice ("%s status seconds %ld accepted %lu "
+            "refused %lu rejected %lu duplicate %lu "
             "accepted size %.0f duplicate size %.0f rejected size %.0f\n",
                 "ME", (long) seconds, accepted,
                 refused, rejected, duplicate,
@@ -324,41 +324,41 @@
     fprintf (F, "%s\n",                      status->name);
     fprintf (F, " ip address: %s\n",         status->ip_addr);
     fprintf (F, "    seconds: %-7ld  ",      (long) status->seconds);
-    fprintf (F, "      duplicates: %-5ld ",  status->Duplicate);
-    fprintf (F, "max allowed cxns: %d\n",    status->maxCxn);
-    fprintf (F, "    offered: %-7ld  ",
+    fprintf (F, "      duplicates: %-5lu ",  status->Duplicate);
+    fprintf (F, "max allowed cxns: %u\n",    status->maxCxn);
+    fprintf (F, "    offered: %-7lu  ",
 	     status->accepted + status->refused + status->rejected);
-    fprintf (F, "   uw newsgroups: %-7ld ",  status->Unwanted_g);
-    fprintf (F, "   active cxns: %d\n",      status->activeCxn);
-    fprintf (F, "   accepted: %-7ld  ",      status->accepted);
-    fprintf (F, "uw distributions: %-7ld ",  status->Unwanted_d);
-    fprintf (F, " sleeping cxns: %d\n",      status->sleepingCxns);
-    fprintf (F, "    refused: %-7ld  ",      status->refused);
-    fprintf (F, "      unapproved: %-7ld ",  status->Unwanted_u);
+    fprintf (F, "   uw newsgroups: %-7lu ",  status->Unwanted_g);
+    fprintf (F, "   active cxns: %u\n",      status->activeCxn);
+    fprintf (F, "   accepted: %-7lu  ",      status->accepted);
+    fprintf (F, "uw distributions: %-7lu ",  status->Unwanted_d);
+    fprintf (F, " sleeping cxns: %u\n",      status->sleepingCxns);
+    fprintf (F, "    refused: %-7lu  ",      status->refused);
+    fprintf (F, "      unapproved: %-7lu ",  status->Unwanted_u);
     fprintf (F, "want streaming: %s\n",
 	     status->can_stream ? "Yes" : "No");
-    fprintf (F, "   rejected: %-7ld  ",      status->rejected);
-    fprintf (F, "        filtered: %-7ld ",  status->Unwanted_f);
+    fprintf (F, "   rejected: %-7lu  ",      status->rejected);
+    fprintf (F, "        filtered: %-7lu ",  status->Unwanted_f);
     fprintf (F, "  is streaming: %s\n",
 	     (status->Check || status->Takethis) ? "Yes" : "No");
     fprintf (F, "       size: %-8s ",        PrettySize(status->Size, str));
-    fprintf (F, "       bad sites: %-7ld ", status->Unwanted_s);
+    fprintf (F, "       bad sites: %-7lu ", status->Unwanted_s);
     fprintf (F, "duplicate size: %s\n", PrettySize(status->DuplicateSize, str));
     fprintf (F, "reject size: %-8s\n",       PrettySize(status->RejectSize, str));
     fprintf (F, "  Protocol:\n");
-    fprintf (F, "      Ihave: %-6ld SendIt[%d]: %-6ld    Got[%d]: %-6ld Deferred[%d]: %ld\n",
+    fprintf (F, "      Ihave: %-6lu SendIt[%d]: %-6lu    Got[%d]: %-6lu Deferred[%d]: %lu\n",
 	     status->Ihave, NNTP_CONT_IHAVE, status->Ihave_SendIt,
 	     NNTP_FAIL_IHAVE_REFUSE, status->Ihave_Duplicate, NNTP_FAIL_IHAVE_DEFER,
 	     status->Ihave_Deferred);
-    fprintf (F, "      Check: %-6ld SendIt[%d]: %-6ld    Got[%d]: %-6ld Deferred[%d]: %ld\n",
+    fprintf (F, "      Check: %-6lu SendIt[%d]: %-6lu    Got[%d]: %-6lu Deferred[%d]: %lu\n",
 	     status->Check, NNTP_OK_CHECK, status->Check_send,
 	     NNTP_FAIL_CHECK_REFUSE, status->Check_got, NNTP_FAIL_CHECK_DEFER,
 	     status->Check_deferred);
-    fprintf (F, "   Takethis: %-6ld     Ok[%d]: %-6ld  Error[%d]: %-6ld\n",
+    fprintf (F, "   Takethis: %-6lu     Ok[%d]: %-6lu  Error[%d]: %-6lu\n",
 	     status->Takethis, NNTP_OK_TAKETHIS, status->Takethis_Ok,
 	     NNTP_FAIL_TAKETHIS_REJECT, status->Takethis_Err);
     if (innconf->refusecybercancels) {
-        fprintf (F, "   Cancelrejects:    Ihave[%d]: %-6ld  Check[%d]: %-6ld\n",
+        fprintf (F, "   Cancelrejects:    Ihave[%d]: %-6lu  Check[%d]: %-6lu\n",
 	     NNTP_FAIL_IHAVE_REFUSE, status->Ihave_Cybercan,
 	     NNTP_FAIL_CHECK_REFUSE, status->Check_cybercan);
     }
@@ -365,8 +365,8 @@
     fputc ('\n', F) ;
 
     if(innconf->logstatus) {
-      notice ("%s status seconds %ld accepted %ld "
-              "refused %ld rejected %ld duplicate %ld "
+      notice ("%s status seconds %ld accepted %lu "
+              "refused %lu rejected %lu duplicate %lu "
               "accepted size %.0f duplicate size %.0f rejected size %.0f\n",
                   status->name, (long) status->seconds, status->accepted,
                   status->refused, status->rejected, status->Duplicate,

Modified: innfeed/article.c
===================================================================
--- innfeed/article.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ innfeed/article.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -296,20 +296,20 @@
     indent [i] = ' ' ;
   indent [i] = '\0' ;
 
-  fprintf (fp,"%sGlobal Article information : (count %d) {\n",
+  fprintf (fp,"%sGlobal Article information : (count %u) {\n",
            indent, articlesInUse) ;
 
-  fprintf (fp,"%s  missingArticleCount : %d\n",indent,missingArticleCount) ;
+  fprintf (fp,"%s  missingArticleCount : %u\n",indent,missingArticleCount) ;
   fprintf (fp,"%s  logMissingArticles : %d\n",indent,logMissingArticles) ;
-  fprintf (fp,"%s  preparedBytes : %d\n",indent,preparedBytes) ;
-  fprintf (fp,"%s  preparedNewlines : %d\n",indent,preparedNewlines) ;
-  fprintf (fp,"%s  avgCharsPerLine : %d\n",indent,avgCharsPerLine) ;
+  fprintf (fp,"%s  preparedBytes : %u\n",indent,preparedBytes) ;
+  fprintf (fp,"%s  preparedNewlines : %u\n",indent,preparedNewlines) ;
+  fprintf (fp,"%s  avgCharsPerLine : %u\n",indent,avgCharsPerLine) ;
   fprintf (fp,"%s  rolledOver : %s\n",indent,boolToString (rolledOver)) ;
-  fprintf (fp,"%s  bytesInUse : %d\n",indent,bytesInUse) ;
-  fprintf (fp,"%s  maxBytesInUse : %d\n",indent,maxBytesInUse) ;
-  fprintf (fp,"%s  articlesInUse : %d\n",indent,articlesInUse) ;
-  fprintf (fp,"%s  byteTotal : %d\n",indent,byteTotal) ;
-  fprintf (fp,"%s  articleTotal : %d\n",indent,articleTotal) ;
+  fprintf (fp,"%s  bytesInUse : %u\n",indent,bytesInUse) ;
+  fprintf (fp,"%s  maxBytesInUse : %u\n",indent,maxBytesInUse) ;
+  fprintf (fp,"%s  articlesInUse : %u\n",indent,articlesInUse) ;
+  fprintf (fp,"%s  byteTotal : %u\n",indent,byteTotal) ;
+  fprintf (fp,"%s  articleTotal : %u\n",indent,articleTotal) ;
   fprintf (fp,"%s  articleStatsId : %d\n",indent,articleStatsId) ;
   
   {

Modified: innfeed/buffer.c
===================================================================
--- innfeed/buffer.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ innfeed/buffer.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -184,7 +184,7 @@
     indent [i] = ' ' ;
   indent [i] = '\0' ;
   
-  fprintf (fp,"%sGlobal Buffer List : (count %d) {\n",indent,bufferCount) ;
+  fprintf (fp,"%sGlobal Buffer List : (count %u) {\n",indent,bufferCount) ;
   
   for (b = gBufferList ; b != NULL ; b = b->next)
     printBufferInfo (b,fp,indentAmt + INDENT_INCR) ;

Modified: innfeed/connection.c
===================================================================
--- innfeed/connection.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ innfeed/connection.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -1089,7 +1089,7 @@
     indent [i] = ' ' ;
   indent [i] = '\0' ;
 
-  fprintf (fp,"%sGlobal Connection list : (count %d) {\n",
+  fprintf (fp,"%sGlobal Connection list : (count %u) {\n",
            indent,gCxnCount) ;
   for (cxn = gCxnList ; cxn != NULL ; cxn = cxn->next)
     printCxnInfo (cxn,fp,indentAmt + INDENT_INCR) ;
@@ -1117,10 +1117,10 @@
   fprintf (fp,"%s    host : %p\n",indent, (void *) cxn->myHost) ;
   fprintf (fp,"%s    endpoint : %p\n",indent, (void *) cxn->myEp) ;
   fprintf (fp,"%s    state : %s\n",indent, stateToString (cxn->state)) ;
-  fprintf (fp,"%s    ident : %d\n",indent,cxn->ident) ;
+  fprintf (fp,"%s    ident : %u\n",indent,cxn->ident) ;
   fprintf (fp,"%s    ip-name : %s\n", indent, cxn->ipName) ;
-  fprintf (fp,"%s    port-number : %d\n",indent,cxn->port) ;
-  fprintf (fp,"%s    max-checks : %d\n",indent,cxn->maxCheck) ;
+  fprintf (fp,"%s    port-number : %u\n",indent,cxn->port) ;
+  fprintf (fp,"%s    max-checks : %u\n",indent,cxn->maxCheck) ;
   fprintf (fp,"%s    does-streaming : %s\n",indent,
            boolToString (cxn->doesStreaming)) ;
   fprintf (fp,"%s    authenticated : %s\n",indent,
@@ -1131,14 +1131,14 @@
            boolToString (cxn->needsChecks)) ;
 
   fprintf (fp,"%s    time-connected : %ld\n",indent,(long) cxn->timeCon) ;
-  fprintf (fp,"%s    articles from INN : %d\n",indent,cxn->artsTaken) ;
-  fprintf (fp,"%s    articles offered : %d\n",indent,
+  fprintf (fp,"%s    articles from INN : %u\n",indent,cxn->artsTaken) ;
+  fprintf (fp,"%s    articles offered : %u\n",indent,
            cxn->checksIssued) ;
-  fprintf (fp,"%s    articles refused : %d\n",indent,
+  fprintf (fp,"%s    articles refused : %u\n",indent,
            cxn->checksRefused) ;
-  fprintf (fp,"%s    articles rejected : %d\n",indent,
+  fprintf (fp,"%s    articles rejected : %u\n",indent,
            cxn->takesRejected) ;
-  fprintf (fp,"%s    articles accepted : %d\n",indent,
+  fprintf (fp,"%s    articles accepted : %u\n",indent,
            cxn->takesOkayed) ;
   fprintf (fp,"%s    low-pass upper limit : %0.6f\n", indent,
            cxn->onThreshold) ;
@@ -1149,19 +1149,19 @@
   fprintf (fp,"%s    low-pass filter : %0.6f\n", indent,
            cxn->filterValue) ;
 
-  fprintf (fp,"%s    article-timeout : %d\n",indent,cxn->articleReceiptTimeout) ;
+  fprintf (fp,"%s    article-timeout : %u\n",indent,cxn->articleReceiptTimeout) ;
   fprintf (fp,"%s    article-callback : %d\n",indent,cxn->artReceiptTimerId) ;
 
-  fprintf (fp,"%s    response-timeout : %d\n",indent,cxn->readTimeout) ;
+  fprintf (fp,"%s    response-timeout : %u\n",indent,cxn->readTimeout) ;
   fprintf (fp,"%s    response-callback : %d\n",indent,cxn->readBlockedTimerId) ;
 
-  fprintf (fp,"%s    write-timeout : %d\n",indent,cxn->writeTimeout) ;
+  fprintf (fp,"%s    write-timeout : %u\n",indent,cxn->writeTimeout) ;
   fprintf (fp,"%s    write-callback : %d\n",indent,cxn->writeBlockedTimerId) ;
 
-  fprintf (fp,"%s    flushTimeout : %d\n",indent,cxn->flushTimeout) ;
+  fprintf (fp,"%s    flushTimeout : %u\n",indent,cxn->flushTimeout) ;
   fprintf (fp,"%s    flushTimerId : %d\n",indent,cxn->flushTimerId) ;
 
-  fprintf (fp,"%s    reopen wait : %d\n",indent,cxn->sleepTimeout) ;
+  fprintf (fp,"%s    reopen wait : %u\n",indent,cxn->sleepTimeout) ;
   fprintf (fp,"%s    reopen id : %d\n",indent,cxn->sleepTimerId) ;
 
   fprintf (fp,"%s    CHECK queue {\n",indent) ;

Modified: innfeed/host.c
===================================================================
--- innfeed/host.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ innfeed/host.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -1277,7 +1277,7 @@
     indent [i] = ' ' ;
   indent [i] = '\0' ;
   
-  fprintf (fp,"%sGlobal Host list : (count %d) {\n",indent,gHostCount) ;
+  fprintf (fp,"%sGlobal Host list : (count %u) {\n",indent,gHostCount) ;
   
   for (h = gHostList ; h != NULL ; h = h->next)
     printHostInfo (h,fp,indentAmt + INDENT_INCR) ;
@@ -1292,20 +1292,20 @@
   char indent [INDENT_BUFFER_SIZE] ;
   unsigned int i ;
   ProcQElem qe ;
-  double cnt = (host->blCount) ? (host->blCount) : 1.0;
+  double cnt ;
   
   for (i = 0 ; i < MIN(INDENT_BUFFER_SIZE - 1,indentAmt) ; i++)
     indent [i] = ' ' ;
   indent [i] = '\0' ;
 
-  fprintf (fp,"%sHost : %p {\n",indent,(void *) host) ;
+  if (host == NULL) {
+    fprintf(fp, "%sHost : NULL {\n%s}\n", indent, indent);
+    return;
+  }
 
-  if (host == NULL)
-    {
-      fprintf (fp,"%s}\n",indent) ;
-      return ;
-    }
-  
+  cnt = (host->blCount) ? (host->blCount) : 1.0;
+
+  fprintf (fp,"%sHost : %p {\n", indent, (void *) host) ;
   fprintf (fp,"%s    peer-name : %s\n",indent,host->params->peerName) ;
   fprintf (fp,"%s    ip-name : %s\n",indent,host->params->ipName) ;
   fprintf (fp,"%s    bindaddress : %s\n",indent,
@@ -1312,11 +1312,11 @@
            host->params->bindAddr ? host->params->bindAddr : "any") ;
   fprintf (fp,"%s    bindaddress6 : %s\n",indent,
            host->params->bindAddr6 ? host->params->bindAddr6 : "any") ;
-  fprintf (fp,"%s    abs-max-connections : %d\n",indent,
+  fprintf (fp,"%s    abs-max-connections : %u\n",indent,
 	   host->params->absMaxConnections) ;
-  fprintf (fp,"%s    active-connections : %d\n",indent,host->activeCxns) ;
-  fprintf (fp,"%s    sleeping-connections : %d\n",indent,host->sleepingCxns) ;
-  fprintf (fp,"%s    initial-connections : %d\n",indent,
+  fprintf (fp,"%s    active-connections : %u\n",indent,host->activeCxns) ;
+  fprintf (fp,"%s    sleeping-connections : %u\n",indent,host->sleepingCxns) ;
+  fprintf (fp,"%s    initial-connections : %u\n",indent,
 	   host->params->initialConnections) ;
   fprintf (fp,"%s    want-streaming : %s\n",indent,
            boolToString (host->params->wantStreaming)) ;
@@ -1326,15 +1326,15 @@
            boolToString (host->params->minQueueCxn)) ;
   fprintf (fp,"%s    remote-streams : %s\n",indent,
            boolToString (host->remoteStreams)) ;
-  fprintf (fp,"%s    max-checks : %d\n",indent,host->params->maxChecks) ;
-  fprintf (fp,"%s    article-timeout : %d\n",indent,
+  fprintf (fp,"%s    max-checks : %u\n",indent,host->params->maxChecks) ;
+  fprintf (fp,"%s    article-timeout : %u\n",indent,
 	   host->params->articleTimeout) ;
-  fprintf (fp,"%s    response-timeout : %d\n",indent,
+  fprintf (fp,"%s    response-timeout : %u\n",indent,
 	   host->params->responseTimeout) ;
-  fprintf (fp,"%s    close-period : %d\n",indent,
+  fprintf (fp,"%s    close-period : %u\n",indent,
 	   host->params->closePeriod) ;
-  fprintf (fp,"%s    port : %d\n",indent,host->params->portNum) ;
-  fprintf (fp,"%s    dynamic-method : %d\n",indent,
+  fprintf (fp,"%s    port : %u\n",indent,host->params->portNum) ;
+  fprintf (fp,"%s    dynamic-method : %u\n",indent,
 	   host->params->dynamicMethod) ;
   fprintf (fp,"%s    dynamic-backlog-filter : %2.1f\n",indent,
 	   host->params->dynBacklogFilter) ;
@@ -1348,13 +1348,13 @@
 	   host->params->lowPassLow) ;
   fprintf (fp,"%s    no-check filter : %2.1f\n",indent,
 	   host->params->lowPassFilter) ;
-  fprintf (fp,"%s    backlog-limit : %d\n",indent,
+  fprintf (fp,"%s    backlog-limit : %u\n",indent,
 	   host->params->backlogLimit) ;
-  fprintf (fp,"%s    backlog-limit-highwater : %d\n",indent,
+  fprintf (fp,"%s    backlog-limit-highwater : %u\n",indent,
 	   host->params->backlogLimitHigh) ;
   fprintf (fp,"%s    backlog-factor : %2.1f\n",indent,
 	   host->params->backlogFactor) ;
-  fprintf (fp,"%s    max-connections : %d\n",indent,
+  fprintf (fp,"%s    max-connections : %u\n",indent,
 	   host->maxConnections) ;
   fprintf (fp,"%s    backlog-feed-first : %s\n",indent,
            boolToString (host->params->backlogFeedFirst)) ;
@@ -1364,8 +1364,8 @@
   fprintf (fp,"%s    ChkCxns-id : %d\n",indent,host->ChkCxnsId) ;
   fprintf (fp,"%s    deferred-id : %d\n",indent,host->deferredId) ;
   fprintf (fp,"%s    backed-up : %s\n",indent,boolToString (host->backedUp));
-  fprintf (fp,"%s    backlog : %d\n",indent,host->backlog) ;
-  fprintf (fp,"%s    deferLen : %d\n",indent,host->deferLen) ;
+  fprintf (fp,"%s    backlog : %u\n",indent,host->backlog) ;
+  fprintf (fp,"%s    deferLen : %u\n",indent,host->deferLen) ;
   fprintf (fp,"%s    loggedModeOn : %s\n",indent,
            boolToString (host->loggedModeOn)) ;
   fprintf (fp,"%s    loggedModeOff : %s\n",indent,
@@ -1374,47 +1374,47 @@
            boolToString (host->loggedBacklog)) ;
   fprintf (fp,"%s    streaming-type changed : %s\n",indent,
            boolToString (host->notifiedChangedRemBlckd)) ;
-  fprintf (fp,"%s    articles offered : %d\n",indent,host->artsOffered) ;
-  fprintf (fp,"%s    articles accepted : %d\n",indent,host->artsAccepted) ;
-  fprintf (fp,"%s    articles not wanted : %d\n",indent,
+  fprintf (fp,"%s    articles offered : %u\n",indent,host->artsOffered) ;
+  fprintf (fp,"%s    articles accepted : %u\n",indent,host->artsAccepted) ;
+  fprintf (fp,"%s    articles not wanted : %u\n",indent,
            host->artsNotWanted) ;
-  fprintf (fp,"%s    articles rejected : %d\n",indent,host->artsRejected);
-  fprintf (fp,"%s    articles deferred : %d\n",indent,host->artsDeferred) ;
-  fprintf (fp,"%s    articles missing : %d\n",indent,host->artsMissing) ;
-  fprintf (fp,"%s    articles spooled : %d\n",indent,host->artsToTape) ;
-  fprintf (fp,"%s      because of queue overflow : %d\n",indent,
+  fprintf (fp,"%s    articles rejected : %u\n",indent,host->artsRejected);
+  fprintf (fp,"%s    articles deferred : %u\n",indent,host->artsDeferred) ;
+  fprintf (fp,"%s    articles missing : %u\n",indent,host->artsMissing) ;
+  fprintf (fp,"%s    articles spooled : %u\n",indent,host->artsToTape) ;
+  fprintf (fp,"%s      because of queue overflow : %u\n",indent,
            host->artsQueueOverflow) ;
-  fprintf (fp,"%s      when the we closed the host : %d\n",indent,
+  fprintf (fp,"%s      when the we closed the host : %u\n",indent,
            host->artsHostClose) ;
-  fprintf (fp,"%s      because the host was asleep : %d\n",indent,
+  fprintf (fp,"%s      because the host was asleep : %u\n",indent,
            host->artsHostSleep) ;
-  fprintf (fp,"%s    articles unspooled : %d\n",indent,host->artsFromTape) ;
-  fprintf (fp,"%s    articles requeued from dropped connections : %d\n",indent,
+  fprintf (fp,"%s    articles unspooled : %u\n",indent,host->artsFromTape) ;
+  fprintf (fp,"%s    articles requeued from dropped connections : %u\n",indent,
            host->artsCxnDrop) ;
 
-  fprintf (fp,"%s    process articles offered : %d\n",indent,
+  fprintf (fp,"%s    process articles offered : %u\n",indent,
            host->gArtsOffered) ;
-  fprintf (fp,"%s    process articles accepted : %d\n",indent,
+  fprintf (fp,"%s    process articles accepted : %u\n",indent,
            host->gArtsAccepted) ;
-  fprintf (fp,"%s    process articles not wanted : %d\n",indent,
+  fprintf (fp,"%s    process articles not wanted : %u\n",indent,
            host->gArtsNotWanted) ;
-  fprintf (fp,"%s    process articles rejected : %d\n",indent,
+  fprintf (fp,"%s    process articles rejected : %u\n",indent,
            host->gArtsRejected);
-  fprintf (fp,"%s    process articles deferred : %d\n",indent,
+  fprintf (fp,"%s    process articles deferred : %u\n",indent,
            host->gArtsDeferred) ;
-  fprintf (fp,"%s    process articles missing : %d\n",indent,
+  fprintf (fp,"%s    process articles missing : %u\n",indent,
            host->gArtsMissing) ;
-  fprintf (fp,"%s    process articles spooled : %d\n",indent,
+  fprintf (fp,"%s    process articles spooled : %u\n",indent,
            host->gArtsToTape) ;
-  fprintf (fp,"%s      because of queue overflow : %d\n",indent,
+  fprintf (fp,"%s      because of queue overflow : %u\n",indent,
            host->gArtsQueueOverflow) ;
-  fprintf (fp,"%s      when the we closed the host : %d\n",indent,
+  fprintf (fp,"%s      when the we closed the host : %u\n",indent,
            host->gArtsHostClose) ;
-  fprintf (fp,"%s      because the host was asleep : %d\n",indent,
+  fprintf (fp,"%s      because the host was asleep : %u\n",indent,
            host->gArtsHostSleep) ;
-  fprintf (fp,"%s    process articles unspooled : %d\n",indent,
+  fprintf (fp,"%s    process articles unspooled : %u\n",indent,
            host->gArtsFromTape) ;
-  fprintf (fp,"%s    process articles requeued from dropped connections : %d\n",
+  fprintf (fp,"%s    process articles requeued from dropped connections : %u\n",
            indent, host->gArtsCxnDrop) ;
 
   fprintf (fp,"%s    average (mean) defer length : %.1f\n", indent,
@@ -1518,13 +1518,13 @@
   fprintf (fp,"%s    Active Connections {\n%s        ",indent,indent) ;
   for (i = 0 ; i < host->maxConnections ; i++)
     if (host->cxnActive[i])
-      fprintf (fp," [%d:%p]",i,(void *) host->connections[i]) ;
+      fprintf (fp," [%u:%p]",i,(void *) host->connections[i]) ;
   fprintf (fp,"\n%s    }\n",indent) ;
 
   fprintf (fp,"%s    Sleeping Connections {\n%s        ",indent,indent) ;
   for (i = 0 ; i < host->maxConnections ; i++)
     if (host->cxnSleeping[i])
-      fprintf (fp," [%d:%p]",i,(void *) host->connections[i]) ;
+      fprintf (fp," [%u:%p]",i,(void *) host->connections[i]) ;
   fprintf (fp,"\n%s    }\n",indent) ;
 
   fprintf (fp,"%s}\n",indent) ;
@@ -3297,7 +3297,7 @@
                INN_VERSION_STRING,(int) myPid,startTime,timeString) ;
       fprintf (fp,"Stats period: %-5ld    Stats reset: %ld\n",
                (long) statsPeriod, (long) statsResetPeriod);
-      fprintf (fp,"(peers: %d active-cxns: %d sleeping-cxns: %d idle-cxns: %d)\n\n",
+      fprintf (fp,"(peers: %u active-cxns: %u sleeping-cxns: %u idle-cxns: %u)\n\n",
                peerNum, actConn, slpConn,(maxcon - (actConn + slpConn))) ;
 
       fprintf (fp,"Configuration file: %s\n\n",configFile) ;
@@ -3331,23 +3331,23 @@
 */
       fprintf(fp,"%sDefault peer configuration parameters:%s\n",
               genHtml ? "<B>" : "", genHtml ? "</B>" : "") ;
-      fprintf(fp,"    article timeout: %-5d     initial connections: %d\n",
+      fprintf(fp,"    article timeout: %-5u     initial connections: %u\n",
 	    defaultParams->articleTimeout,
 	    defaultParams->initialConnections) ;
-      fprintf(fp,"   response timeout: %-5d         max connections: %d\n",
+      fprintf(fp,"   response timeout: %-5u         max connections: %u\n",
 	    defaultParams->responseTimeout,
 	    defaultParams->absMaxConnections) ;
-      fprintf(fp,"  reconnection time: %-5d   max reconnection time: %d\n",
+      fprintf(fp,"  reconnection time: %-5u   max reconnection time: %u\n",
               init_reconnect_period, max_reconnect_period);
-      fprintf(fp,"       close period: %-5d              max checks: %d\n",
+      fprintf(fp,"       close period: %-5u              max checks: %u\n",
 	    defaultParams->closePeriod,
 	    defaultParams->maxChecks) ;
-      fprintf(fp,"   DNS retry period: %-5d       DNS expire period: %d\n", 
+      fprintf(fp,"   DNS retry period: %-5u       DNS expire period: %u\n", 
               dnsRetPeriod, dnsExpPeriod);
-      fprintf(fp,"           port num: %-5d              force IPv4: %s\n",
+      fprintf(fp,"           port num: %-5u              force IPv4: %s\n",
               defaultParams->portNum,
               defaultParams->forceIPv4 ? "true " : "false");
-      fprintf(fp,"     want streaming: %-5s          dynamic method: %d\n",
+      fprintf(fp,"     want streaming: %-5s          dynamic method: %u\n",
 	    defaultParams->wantStreaming ? "true " : "false",
 	    defaultParams->dynamicMethod) ;
       fprintf(fp,"        no-check on: %-2.1f%%     dynamic backlog low: %-2.1f%%\n",
@@ -3359,10 +3359,10 @@
       fprintf(fp,"    no-check filter: %-2.1f   dynamic backlog filter: %-2.1f\n",
 	    defaultParams->lowPassFilter,
 	    defaultParams->dynBacklogFilter) ;
-      fprintf(fp,"  backlog limit low: %-7d         drop-deferred: %s\n",
+      fprintf(fp,"  backlog limit low: %-7u         drop-deferred: %s\n",
 	    defaultParams->backlogLimit,
 	    defaultParams->dropDeferred ? "true " : "false");
-      fprintf(fp," backlog limit high: %-7d         min-queue-cxn: %s\n",
+      fprintf(fp," backlog limit high: %-7u         min-queue-cxn: %s\n",
 	    defaultParams->backlogLimitHigh,
 	    defaultParams->minQueueCxn ? "true " : "false");
       fprintf(fp," backlog feed first: %s\n",
@@ -3490,7 +3490,7 @@
   fputc ('\n',fp) ;
 
   if (host->ipAddrs) {
-    int  i;
+    size_t  i;
     char ip_addr[INET6_ADDRSTRLEN];
     const char *family;
 
@@ -3511,45 +3511,46 @@
 
       network_sockaddr_sprint(ip_addr, sizeof(ip_addr),
                               host->ipAddrs[i]);
-      fprintf(fp, "   Addr %-2u: %-4.4s  %s\n", i+1, family, ip_addr);
+      fprintf(fp, "   Addr %-2lu: %-4.4s  %s\n", (unsigned long) (i+1),
+              family, ip_addr);
     }
   }
 
-  fprintf (fp, "   seconds: %-7ld   art. timeout: %-5d        ip name: %s\n",
+  fprintf (fp, "   seconds: %-7ld   art. timeout: %-5u        ip name: %s\n",
 	   host->firstConnectTime > 0 ? (long)(now - host->firstConnectTime) : 0,
 	   host->params->articleTimeout, host->params->ipName) ;
            
-  fprintf (fp, "   offered: %-7ld  resp. timeout: %-5d           port: %d\n",
+  fprintf (fp, "   offered: %-7ld  resp. timeout: %-5u           port: %u\n",
 	   (long) host->gArtsOffered, host->params->responseTimeout,
 	   host->params->portNum);
 
-  fprintf (fp, "  accepted: %-7ld want streaming: %s      active cxns: %d\n",
+  fprintf (fp, "  accepted: %-7ld want streaming: %s      active cxns: %u\n",
 	   (long) host->gArtsAccepted, 
            (host->params->wantStreaming ? "yes" : "no "),
 	   host->activeCxns) ;
 
-  fprintf (fp, "   refused: %-7ld   is streaming: %s    sleeping cxns: %d\n",
+  fprintf (fp, "   refused: %-7ld   is streaming: %s    sleeping cxns: %u\n",
 	   (long) host->gArtsNotWanted,
            (host->remoteStreams ? "yes" : "no "),
 	   host->sleepingCxns) ;
 
-  fprintf (fp, "  rejected: %-7ld     max checks: %-5d   initial cxns: %d\n",
+  fprintf (fp, "  rejected: %-7ld     max checks: %-5u   initial cxns: %u\n",
 	   (long) host->gArtsRejected, host->params->maxChecks,
 	   host->params->initialConnections) ;
 
-  fprintf (fp, "   missing: %-7ld    no-check on: %-3.1f%%      idle cxns: %d\n",
+  fprintf (fp, "   missing: %-7ld    no-check on: %-3.1f%%      idle cxns: %u\n",
 	   (long) host->gArtsMissing, host->params->lowPassHigh,
            host->maxConnections - (host->activeCxns + host->sleepingCxns)) ;
 
-  fprintf (fp, "  deferred: %-7ld   no-check off: %-3.1f%%       max cxns: %d/%d\n",
+  fprintf (fp, "  deferred: %-7ld   no-check off: %-3.1f%%       max cxns: %u/%u\n",
 	   (long) host->gArtsDeferred, host->params->lowPassLow,
 	   host->maxConnections, host->params->absMaxConnections) ;
 
-  fprintf (fp, "  requeued: %-7ld  no-check fltr: %-3.1f    queue length: %-3.1f/%d\n",
+  fprintf (fp, "  requeued: %-7ld  no-check fltr: %-3.1f    queue length: %-3.1f/%u\n",
 	   (long) host->gArtsCxnDrop, host->params->lowPassFilter,
 	   (double)host->blAccum / cnt, hostHighwater) ;
 
-  fprintf (fp, "   spooled: %-7ld dynamic method: %-5d          empty: %-3.1f%%\n",
+  fprintf (fp, "   spooled: %-7ld dynamic method: %-5u          empty: %-3.1f%%\n",
 	   (long) host->gArtsToTape,
 	   host->params->dynamicMethod,
 	   100.0 * host->blNone / cnt) ;
@@ -3607,7 +3608,7 @@
       fprintf(fp, "   refused: %5.2f art/s   rejected: %5.2f art/s, %.3g %s/s\n",
 	      rr, jr, jrs, tjrs);
   }
-  fprintf(fp, "   missing %d spooled %d\n",
+  fprintf(fp, "   missing %u spooled %u\n",
 	  host->artsMissing, host->artsToTape);
   }
 

Modified: innfeed/imap_connection.c
===================================================================
--- innfeed/imap_connection.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ innfeed/imap_connection.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -4560,7 +4560,7 @@
     indent [i] = ' ' ;
   indent [i] = '\0' ;
 
-  fprintf (fp,"%sGlobal Connection list : (count %d) {\n",
+  fprintf (fp,"%sGlobal Connection list : (count %u) {\n",
            indent,gCxnCount) ;
   for (cxn = gCxnList ; cxn != NULL ; cxn = cxn->next)
     printCxnInfo (cxn,fp,indentAmt + INDENT_INCR) ;
@@ -4583,7 +4583,7 @@
   fprintf (fp,"%s    endpoint (lmtp): %p\n",indent, (void *) cxn->lmtp_endpoint) ;
   fprintf (fp,"%s    state (imap) : %s\n",indent, imap_stateToString (cxn->imap_state)) ;
   fprintf (fp,"%s    state (lmtp) : %s\n",indent, lmtp_stateToString (cxn->lmtp_state)) ;
-  fprintf (fp,"%s    ident : %d\n",indent,cxn->ident) ;
+  fprintf (fp,"%s    ident : %u\n",indent,cxn->ident) ;
   fprintf (fp,"%s    ip-name (imap): %s\n", indent, cxn->ServerName) ;
   fprintf (fp,"%s    ip-name (lmtp): %s\n", indent, cxn->ServerName) ;
   fprintf (fp,"%s    port-number (imap) : %d\n",indent,cxn->imap_port) ;
@@ -4614,13 +4614,13 @@
   fprintf(fp,"%s    remove:     yes: %d no: %d\n",indent,
 	  cxn->remove_succeeded, cxn->remove_failed);
 
-  fprintf (fp,"%s    response-timeout : %d\n",indent,cxn->imap_readTimeout) ;
+  fprintf (fp,"%s    response-timeout : %u\n",indent,cxn->imap_readTimeout) ;
   fprintf (fp,"%s    response-callback : %d\n",indent,cxn->imap_readBlockedTimerId) ;
 
-  fprintf (fp,"%s    write-timeout : %d\n",indent,cxn->imap_writeTimeout) ;
+  fprintf (fp,"%s    write-timeout : %u\n",indent,cxn->imap_writeTimeout) ;
   fprintf (fp,"%s    write-callback : %d\n",indent,cxn->imap_writeBlockedTimerId) ;
 
-  fprintf (fp,"%s    reopen wait : %d\n",indent,cxn->imap_sleepTimeout) ;
+  fprintf (fp,"%s    reopen wait : %u\n",indent,cxn->imap_sleepTimeout) ;
   fprintf (fp,"%s    reopen id : %d\n",indent,cxn->imap_sleepTimerId) ;
 
   fprintf (fp,"%s    IMAP queue {\n",indent) ;

Modified: innfeed/innlistener.c
===================================================================
--- innfeed/innlistener.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ innfeed/innlistener.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -128,7 +128,7 @@
     indent [i] = ' ' ;
   indent [i] = '\0' ;
 
-  fprintf (fp,"%sGlobal InnListener list : %p (count %d) {\n",
+  fprintf (fp,"%sGlobal InnListener list : %p (count %u) {\n",
            indent,(void *) listenerList,listenerCount) ;
   for (p = listenerList ; p != NULL ; p = p->next)
     printListenerInfo (p,fp,indentAmt + INDENT_INCR) ;

Modified: innfeed/main.c
===================================================================
--- innfeed/main.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ innfeed/main.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -980,7 +980,7 @@
   fprintf (fp,"      Log file: %s\n",(logFile == NULL ? "(none)" : logFile));
   fprintf (fp,"   Debug level: %-5u        Debug shrinking: %s\n",
            loggingLevel, boolToString(debugShrinking));
-  fprintf (fp,"     Fast exit: %-5s            stdio-fdmax: %d\n",
+  fprintf (fp,"     Fast exit: %-5s            stdio-fdmax: %u\n",
            boolToString(fastExit), stdioFdMax);
   fprintf (fp,"          Mmap: %s\n", boolToString(useMMap));
   fprintf (fp,"\n") ;

Modified: nnrpd/misc.c
===================================================================
--- nnrpd/misc.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ nnrpd/misc.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -244,7 +244,7 @@
      for (i=0; i<4; i++)
        quads[i] = (unsigned char) (0xff & (addr>>(i*8)));
 
-     snprintf(dirbuff, sizeof(dirbuff), "%s/%03d%03d/%03d",
+     snprintf(dirbuff, sizeof(dirbuff), "%s/%03u%03u/%03u",
          postrec_dir, quads[3], quads[2], quads[1]);
      if (!MakeDirectory(dirbuff,true)) {
        syslog(L_ERROR, "%s Unable to create postrec directories '%s': %s",
@@ -251,7 +251,7 @@
                Client.host, dirbuff, strerror(errno));
        return NULL;
      }
-     snprintf(buff, sizeof(buff), "%s/%03d", dirbuff, quads[0]);
+     snprintf(buff, sizeof(buff), "%s/%03u", dirbuff, quads[0]);
      return(buff);
 }
 
@@ -275,7 +275,7 @@
     fd = open(lockname, O_WRONLY|O_EXCL|O_CREAT, 0600);
     if (fd >= 0) {
       /* We got the lock! */
-      snprintf(temp, sizeof(temp), "pid:%ld\n", (unsigned long) getpid());
+      snprintf(temp, sizeof(temp), "pid:%lu\n", (unsigned long) getpid());
       write(fd, temp, strlen(temp));
       close(fd);
       return(1);

Modified: nnrpd/nnrpd.c
===================================================================
--- nnrpd/nnrpd.c	2016-04-19 20:06:38 UTC (rev 10008)
+++ nnrpd/nnrpd.c	2016-05-05 12:39:19 UTC (rev 10009)
@@ -950,7 +950,7 @@
     char                **v;
     char		*Reject;
     int			timeout;
-    unsigned int	vid=0; 
+    unsigned int	vid=0;
     int 		count=123456789;
     struct		timeval tv;
     unsigned short	ListenPort = NNTP_PORT;
@@ -1371,7 +1371,7 @@
 	vid = tv.tv_sec ^ tv.tv_usec ^ pid ^ count;
 	len = strlen("innconf->pathlog") + strlen("/tracklogs/log-") + BUFSIZ;
 	LocalLogFileName = xmalloc(len);
-	sprintf(LocalLogFileName, "%s/tracklogs/log-%d", innconf->pathlog, vid);
+	sprintf(LocalLogFileName, "%s/tracklogs/log-%u", innconf->pathlog, vid);
 	if ((locallog = fopen(LocalLogFileName, "w")) == NULL) {
             LocalLogDirName = concatpath(innconf->pathlog, "tracklogs");
 	    MakeDirectory(LocalLogDirName, false);



More information about the inn-committers mailing list