Compiling with -Wall
Jeffrey M. Vinocur
jeff at litech.org
Sat Feb 23 18:53:06 UTC 2002
I was trying to compile some bits of CURRENT with -Wall this morning, and
was sufficiently bored to go through and try to fix some of the warnings.
There were tons of unused variables (and some that were unused depending
on configure, so I put them inside the ifdefs where they belonged). Also
a couple actual code changes -- places where pointers were being treated
as non-pointers and arguments to printf were not exactly right.
Things I didn't do:
- "possibly unitialized" warnings
- "impliicit definition" warnings
- control flow falling off the end of non-void functions
- some of the top-level unused variables looked important, so I played it
safe
- imapfeed.c and authprogs/smb are a complete mess
Anyway, I touched a lot of things I don't fully understand, so I'm not
comfortable committing this until somebody at least glances at it.
--
Jeffrey M. Vinocur
jeff at litech.org
-- Attached file included as plaintext by Ecartis --
-- File: warnings
Index: authprogs/ckpasswd.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/authprogs/ckpasswd.c,v
retrieving revision 1.14
diff -u -r1.14 ckpasswd.c
--- ckpasswd.c 2002/01/16 14:16:51 1.14
+++ ckpasswd.c 2002/02/23 17:54:55
@@ -114,7 +114,7 @@
if (!found)
return(0);
iter = colon+1;
- if (colon = strchr(iter, ':'))
+ if ((colon = strchr(iter, ':')) != NULL)
*colon = 0;
strcpy(pass, iter);
return(pass);
@@ -155,7 +155,6 @@
int do_shadow, do_file, do_db;
char *fname;
char uname[SMBUF], pass[SMBUF];
- char buff[SMBUF];
char *rpass;
do_shadow = do_file = do_db = 0;
Index: authprogs/radius.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/authprogs/radius.c,v
retrieving revision 1.24
diff -u -r1.24 radius.c
--- radius.c 2001/06/29 22:28:40 1.24
+++ radius.c 2002/02/23 17:54:55
@@ -64,7 +64,7 @@
lineno++;
buf[strlen(buf)-1] = '\0'; /* strip '\n' */
- if (iter = strchr(buf, '#'))
+ if ((iter = strchr(buf, '#')) != NULL)
*iter = '\0'; /* strip comments */
iter = buf+strlen(buf)-1; /* strip trailing whitespace */
@@ -155,7 +155,6 @@
char secbuf[128];
HASH digest;
struct timeval seed;
- struct md5_context context;
struct sockaddr_in sinl, sinr;
int sock;
struct hostent *hent;
Index: authprogs/smbval/std-defines.h
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/authprogs/smbval/std-defines.h,v
retrieving revision 1.1
diff -u -r1.1 std-defines.h
--- std-defines.h 2000/10/23 06:38:11 1.1
+++ std-defines.h 2002/02/23 17:54:55
@@ -4,6 +4,7 @@
SMBlib Standard Includes
Copyright (C) 1996, Richard Sharpe
+*/
/* One day we will conditionalize these on OS types ... */
Index: authprogs/smbval/std-includes.h
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/authprogs/smbval/std-includes.h,v
retrieving revision 1.1
diff -u -r1.1 std-includes.h
--- std-includes.h 2000/10/23 06:38:12 1.1
+++ std-includes.h 2002/02/23 17:54:55
@@ -4,6 +4,7 @@
RFCNB Standard Includes
Copyright (C) 1996, Richard Sharpe
+*/
/* One day we will conditionalize these on OS types ... */
Index: frontends/inews.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/frontends/inews.c,v
retrieving revision 1.35
diff -u -r1.35 inews.c
--- inews.c 2000/11/16 05:49:29 1.35
+++ inews.c 2002/02/23 17:54:55
@@ -42,12 +42,10 @@
char *Value;
} HEADER;
-static char *tmpPtr ;
static bool Dump;
static bool Revoked;
static bool Spooling;
static char **OtherHeaders;
-static char NGSEPS[] = NG_SEPARATOR;
static char SIGSEP[] = SIG_SEPARATOR;
static FILE *FromServer;
static FILE *ToServer;
@@ -585,11 +583,9 @@
HEADER *hp;
char *p;
TIMEINFO Now;
- struct tm *tm;
char buff[SMBUF];
char from[SMBUF];
int i;
- long zone;
/* Do some preliminary fix-ups. */
for (hp = Table; hp < ENDOF(Table); hp++) {
@@ -985,7 +981,6 @@
int port;
int Mode;
int SigLines;
- FILE *F;
struct passwd *pwp;
char *article;
char *deadfile;
Index: innd/art.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/innd/art.c,v
retrieving revision 1.180
diff -u -r1.180 art.c
--- art.c 2002/02/22 20:39:11 1.180
+++ art.c 2002/02/23 17:54:55
@@ -227,7 +227,6 @@
ARTsetup(void)
{
const char * p;
- ARTHEADER * hp;
ARTHEADER ** table;
unsigned int i;
@@ -287,8 +286,6 @@
void
ARTclose(void)
{
- ARTHEADER *hp;
-
if (ARTfields != NULL) {
DISPOSE(ARTfields);
ARTfields = NULL;
@@ -388,7 +385,6 @@
ARTDATA *data = &cp->Data;
HDRCONTENT *hc = data->HdrContent;
const char *p;
- char *end;
ARTHANDLE arth;
int i, j, iovcnt = 0;
long headersize;
@@ -744,8 +740,8 @@
{
BUFFER *bp = &cp->In;
ARTDATA *data = &cp->Data;
- int i, j, limit, hopcount;
- char *p, **hops;
+ int i, limit, hopcount;
+ char **hops;
HDRCONTENT *hc = data->HdrContent;
/* Read through the buffer to find header, body and end of article */
@@ -965,11 +961,8 @@
{
HDRCONTENT *hc = data->HdrContent;
ARTHEADER *hp = ARTheaders;
- char *in;
- char *out;
int i;
char *p;
- const char *error;
int delta;
TMRstart(TMR_ARTCLEAN);
Index: innd/cc.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/innd/cc.c,v
retrieving revision 1.86
diff -u -r1.86 cc.c
--- cc.c 2001/07/11 07:26:19 1.86
+++ cc.c 2002/02/23 17:54:56
@@ -243,8 +243,6 @@
ARTDATA Data;
const char * p, *msgid;
bool ok;
- HASH hash;
- int i;
TOKEN token;
/* You must pass a <message-id> ID, the history API will hash it as it
Index: innd/innd.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/innd/innd.c,v
retrieving revision 1.82
diff -u -r1.82 innd.c
--- innd.c 2002/02/22 20:39:12 1.82
+++ innd.c 2002/02/23 17:54:56
@@ -171,9 +171,9 @@
xmalloc_abort(const char *what, size_t size, const char *file, int line)
{
fprintf(stderr, "SERVER cant %s %lu bytes at %s line %d: %m", what,
- (unsigned long) size, line, file);
+ (unsigned long) size, file, line);
syslog(LOG_CRIT, "SERVER cant %s %lu bytes at %s line %d: %m", what,
- (unsigned long) size, line, file);
+ (unsigned long) size, file, line);
abort();
}
@@ -285,12 +285,11 @@
bool flag;
static char WHEN[] = "PID file";
int i, j, fd[MAX_SOCKETS + 1];
- char buff[SMBUF], *q, *path1, *path2;
+ char buff[SMBUF], *path1, *path2;
FILE *F;
bool ShouldFork;
bool ShouldRenumber;
bool ShouldSyntaxCheck;
- bool val;
bool filter = TRUE;
pid_t pid;
#if defined(_DEBUG_MALLOC_INC)
@@ -421,7 +420,7 @@
fd[j++] = atoi(p);
if (j == MAX_SOCKETS)
break;
- } while (p = strtok(NULL, ","));
+ } while ((p = strtok(NULL, ",")) != NULL);
fd[j] = -1;
DISPOSE(t);
break;
Index: innd/nc.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/innd/nc.c,v
retrieving revision 1.75
diff -u -r1.75 nc.c
--- nc.c 2001/07/11 07:26:19 1.75
+++ nc.c 2002/02/23 17:54:56
@@ -190,7 +190,7 @@
char buff[SMBUF];
/* Note that some use break, some use return here. */
- if (postok = ARTpost(cp)) {
+ if ((postok = ARTpost(cp)) != 0) {
cp->Received++;
if (cp->Sendid.Size > 3) { /* We be streaming */
cp->Takethis_Ok++;
Index: innd/perl.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/innd/perl.c,v
retrieving revision 1.22
diff -u -r1.22 perl.c
--- perl.c 2001/07/11 07:26:20 1.22
+++ perl.c 2002/02/23 17:54:56
@@ -72,7 +72,6 @@
CV * filter;
int i, rc;
char * p;
- char save = '\0';
static SV * body = NULL;
static char buf[256];
@@ -408,7 +407,7 @@
/* Get the article token from the message ID and the history file. */
msgid = (char *) SvPV(ST(0), PL_na);
- if (!HISlookup(History, msgid, NULL, NULL, NULL, &token)) XSRETURN_UNDEF;
+ if (!HISlookup(History, msgid, NULL, NULL, NULL, token)) XSRETURN_UNDEF;
/* Retrieve the article header and convert it from wire format. */
art = SMretrieve(*token, RETR_HEAD);
Index: innd/rc.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/innd/rc.c,v
retrieving revision 1.59
diff -u -r1.59 rc.c
--- rc.c 2002/02/22 20:39:13 1.59
+++ rc.c 2002/02/23 17:54:56
@@ -841,8 +841,12 @@
char *p;
char **q;
char **r;
+#if !defined( HAVE_INET6)
struct hostent *hp;
+#endif
+#if !defined(HAVE_UNIX_DOMAIN_SOCKETS)
struct in_addr addr;
+#endif
int i;
int j;
int linecount;
Index: innd/util.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/innd/util.c,v
retrieving revision 1.5
diff -u -r1.5 util.c
--- util.c 2001/07/18 12:38:09 1.5
+++ util.c 2002/02/23 17:54:56
@@ -324,7 +324,7 @@
}
free(histpath);
HISsetcache(History, 1024 * innconf->hiscachesize);
- synccount = &innconf->icdsynccount;
+ synccount = innconf->icdsynccount;
HISctl(History, HISCTLS_SYNCCOUNT, &synccount);
}
Index: innfeed/article.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/innfeed/article.c,v
retrieving revision 1.22
diff -u -r1.22 article.c
--- article.c 2001/06/30 00:17:37 1.22
+++ article.c 2002/02/23 17:54:57
@@ -866,6 +866,7 @@
return false ;
if (art->nntpBuffers != NULL)
+ {
if (bufferRefCount (art->nntpBuffers[0]) > 1)
return false ;
else
@@ -873,6 +874,7 @@
freeBufferArray (art->nntpBuffers) ;
art->nntpBuffers = NULL ;
}
+ }
ASSERT (bufferRefCount (art->contents) == 1) ;
Index: innfeed/connection.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/innfeed/connection.c,v
retrieving revision 1.39
diff -u -r1.39 connection.c
--- connection.c 2002/02/22 20:39:14 1.39
+++ connection.c 2002/02/23 17:54:57
@@ -366,7 +366,6 @@
char *sv ;
int rval = 1 ;
FILE *fp = (FILE *) data ;
- struct in_addr addr ;
if (getInteger (topScope,"max-reconnect-time",&iv,NO_INHERIT))
{
@@ -413,6 +412,7 @@
memcpy( bind_addr, res->ai_addr, res->ai_addrlen );
}
#else
+ struct in_addr addr ;
if (!inet_aton(sv,&addr))
{
logOrPrint (LOG_ERR,fp,"innfeed unable to determine bind ip") ;
Index: innfeed/host.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/innfeed/host.c,v
retrieving revision 1.51
diff -u -r1.51 host.c
--- host.c 2002/02/22 20:39:14 1.51
+++ host.c 2002/02/23 17:54:58
@@ -95,7 +95,7 @@
#define TRYBLOCKEDHOSTPERIOD 120
extern char *configFile ;
-extern mainLogStatus (FILE *fp) ;
+extern void mainLogStatus (FILE *fp) ;
#if defined(hpux) || defined(__hpux) || defined(_SCO_DS)
extern int h_errno;
#endif
@@ -1731,7 +1731,7 @@
u_int x_queue = host->params->maxChecks + 1 ;
for (idx = 0 ; x_queue > 0 && idx < host->maxConnections ; idx++)
- if ((cxn = host->connections[idx]) != host->notThisCxn)
+ if ((cxn = host->connections[idx]) != host->notThisCxn) {
if (!host->cxnActive [idx]) {
if (!host->cxnSleeping [idx]) {
if (cxnTakeArticle (cxn, extraRef)) {
@@ -1748,6 +1748,7 @@
x_cxn = cxn ;
}
}
+ }
if (x_cxn != NULL && cxnTakeArticle (x_cxn, extraRef)) {
if (x_queue == 0) host->gNoQueue++ ;
@@ -2576,10 +2577,12 @@
}
if (s != NULL)
- if (getString (s,IP_NAME,&q,NO_INHERIT))
- p->ipName = q ;
- else
- p->ipName = xstrdup (name) ;
+ {
+ if (getString (s,IP_NAME,&q,NO_INHERIT))
+ p->ipName = q ;
+ else
+ p->ipName = xstrdup (name) ;
+ }
}
@@ -2989,7 +2992,6 @@
u_int peerNum = 0, actConn = 0, slpConn = 0, maxcon = 0 ;
static bool logged = false ;
static bool flogged = false ;
- time_t now;
if (statusFile == NULL && !logged)
{
@@ -3347,7 +3349,7 @@
static void hostStatsTimeoutCbk (TimeoutId tid, void *data)
{
Host host = (Host) data ;
- time_t delta, now = theTime () ;
+ time_t now = theTime () ;
(void) tid ; /* keep lint happy */
Index: lib/inndcomm.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/lib/inndcomm.c,v
retrieving revision 1.14
diff -u -r1.14 inndcomm.c
--- inndcomm.c 2001/06/29 21:07:37 1.14
+++ inndcomm.c 2002/02/23 17:54:58
@@ -197,12 +197,12 @@
char *buff;
char *p;
const char *q;
- char *path;
char save;
int bufsiz;
int i ;
#if !defined(HAVE_UNIX_DOMAIN_SOCKETS)
int fd;
+ char *path;
#endif /* !defined(HAVE_UNIX_DOMAIN_SOCKETS) */
int len;
fd_set Rmask;
Index: lib/remopen.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/lib/remopen.c,v
retrieving revision 1.14
diff -u -r1.14 remopen.c
--- remopen.c 2002/02/22 20:39:16 1.14
+++ remopen.c 2002/02/23 17:54:58
@@ -25,12 +25,8 @@
*/
int NNTPconnect(char *host, int port, FILE **FromServerp, FILE **ToServerp, char *errbuff)
{
- char **ap;
- char *fakelist[2];
- char *dest;
char mybuff[NNTP_STRLEN + 2];
char *buff;
- char *p;
int i;
int j;
int oerrno;
@@ -40,6 +36,10 @@
char portbuf[16];
struct sockaddr_storage client;
#else
+ char **ap;
+ char *dest;
+ char *fakelist[2];
+ char *p;
struct hostent *hp;
struct hostent fakehp;
struct in_addr quadaddr;
Index: nnrpd/article.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/nnrpd/article.c,v
retrieving revision 1.107
diff -u -r1.107 article.c
--- article.c 2001/07/11 07:40:45 1.107
+++ article.c 2002/02/23 17:54:58
@@ -691,7 +691,7 @@
Reply("%s\r\n", ARTnocurrart);
return;
}
- (void)sprintf(buff, "%ld", ARTnumber);
+ (void)sprintf(buff, "%d", ARTnumber);
tart=ARTnumber;
}
else {
@@ -709,7 +709,7 @@
Reply("%s\r\n", ARTnoartingroup);
return;
}
- (void)sprintf(buff, "%ld", ARTnumber);
+ (void)sprintf(buff, "%d", ARTnumber);
tart=ARTnumber;
}
if (ac > 1)
@@ -856,7 +856,7 @@
}
/* Skip leading headers. */
- for (field; field >= 0 && *p; p++)
+ for ( ; field >= 0 && *p; p++)
if ((p = strchr(p, '\t')) == NULL)
return NULL;
else
@@ -994,7 +994,7 @@
OVERtime+=(etv.tv_sec - stv.tv_sec) * 1000;
OVERtime+=(etv.tv_usec - stv.tv_usec) / 1000;
}
- if (len == 0 || PERMaccessconf->nnrpdcheckart && !ARTinstorebytoken(token)) {
+ if (len == 0 || (PERMaccessconf->nnrpdcheckart && !ARTinstorebytoken(token))) {
if (PERMaccessconf->nnrpdoverstats) {
OVERmiss++;
gettimeofday(&stv, NULL);
@@ -1149,7 +1149,7 @@
continue;
p = GetHeader(header, FALSE);
if (p && (!pattern || wildmat_simple(p, pattern))) {
- sprintf(buff, "%lu ", i);
+ sprintf(buff, "%u ", i);
SendIOb(buff, strlen(buff));
SendIOb(p, strlen(p));
SendIOb("\r\n", 2);
@@ -1172,8 +1172,8 @@
Printf("%d %s matches follow (NOV)\r\n", NNTP_HEAD_FOLLOWS_VAL,
header);
while (OVsearch(handle, &artnum, &data, &len, &token, NULL)) {
- if (len == 0 || PERMaccessconf->nnrpdcheckart
- && !ARTinstorebytoken(token))
+ if (len == 0 || (PERMaccessconf->nnrpdcheckart
+ && !ARTinstorebytoken(token)))
continue;
if ((p = OVERGetHeader(data, Overview)) != NULL) {
if (!pattern || wildmat_simple(p, pattern)) {
Index: nnrpd/commands.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/nnrpd/commands.c,v
retrieving revision 1.54
diff -u -r1.54 commands.c
--- commands.c 2002/02/22 20:39:16 1.54
+++ commands.c 2002/02/23 17:54:59
@@ -224,7 +224,9 @@
static char Password[30];
char accesslist[BIG_BUFFER];
char errorstr[BIG_BUFFER];
+#ifdef DO_PYTHON
int code;
+#endif
if (caseEQ(av[1], "generic")) {
char *logrec = Glom(av);
Index: nnrpd/misc.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/nnrpd/misc.c,v
retrieving revision 1.53
diff -u -r1.53 misc.c
--- misc.c 2002/02/22 20:39:17 1.53
+++ misc.c 2002/02/23 17:54:59
@@ -23,10 +23,6 @@
# include "sasl_config.h"
#endif
-static bool setup = FALSE;
-static FILE *hfp = NULL;
-static ino_t ino = 0;
-
#ifdef HAVE_SSL
extern SSL *tls_conn;
extern int nnrpd_starttls_done;
@@ -646,7 +642,6 @@
int ac;
char *av[];
{
- SSL_CTX *ctx;
int result;
sasl_config_read();
Index: nnrpd/nnrpd.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/nnrpd/nnrpd.c,v
retrieving revision 1.122
diff -u -r1.122 nnrpd.c
--- nnrpd.c 2002/02/22 20:39:17 1.122
+++ nnrpd.c 2002/02/23 17:54:59
@@ -536,11 +536,11 @@
{
struct sockaddr_storage ssc, sss;
socklen_t length;
- char buff[SMBUF];
+#ifdef DO_PYTHON
char accesslist[BIG_BUFFER];
int code;
static ACCESSGROUP *authconf;
- struct in_addr client_addr;
+#endif
char *default_host_error = "unknown error";
ClientIpAddr = 0L;
@@ -1211,7 +1211,8 @@
innconf->readertrack=TrackClient(ClientHost,Username);
}
- if (PERMaccessconf && PERMaccessconf->readertrack || !PERMaccessconf && innconf->readertrack) {
+ if ((PERMaccessconf && PERMaccessconf->readertrack)
+ || (!PERMaccessconf && innconf->readertrack)) {
int len;
syslog(L_NOTICE, "%s Tracking Enabled (%s)", ClientHost, Username);
pid=getpid();
@@ -1220,7 +1221,7 @@
vid = tv.tv_sec ^ tv.tv_usec ^ pid ^ count;
len = strlen("innconf->pathlog") + strlen("/tracklogs/log-") + BUFSIZ;
LocalLogFileName = NEW(char, len);
- sprintf(LocalLogFileName, "%s/tracklogs/log-%ld", innconf->pathlog, vid);
+ sprintf(LocalLogFileName, "%s/tracklogs/log-%d", innconf->pathlog, vid);
if ((locallog = fopen(LocalLogFileName, "w")) == NULL) {
LocalLogDirName = NEW(char, len);
sprintf(LocalLogDirName, "%s/tracklogs", innconf->pathlog);
Index: nnrpd/perl.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/nnrpd/perl.c,v
retrieving revision 1.17
diff -u -r1.17 perl.c
--- perl.c 2002/01/27 21:56:46 1.17
+++ perl.c 2002/02/23 17:54:59
@@ -175,7 +175,7 @@
if (SvTRUE(ERRSV)) /* check $@ */ {
syslog (L_ERROR,"Perl function filter_post died: %s",
SvPV(ERRSV, PL_na)) ;
- POPs ;
+ (void)POPs ;
PerlFilter (FALSE) ;
} else if (rc == 1) {
p = POPp;
@@ -204,7 +204,6 @@
}
char *itoa(int n) {
- int i = 0;
char *s = "";
char *tmp;
@@ -222,7 +221,7 @@
dSP;
HV *attribs;
SV *sv;
- int rc, code, i;
+ int rc, i;
char *p, *key, *val, **access_array;
if (!PerlFilterActive)
@@ -315,7 +314,7 @@
}
while (rc--) {
- POPs;
+ (void)POPs;
}
PUTBACK;
@@ -328,7 +327,6 @@
dSP;
HV *attribs;
int rc;
- SV *sv;
char *p;
int code;
Index: nnrpd/perm.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/nnrpd/perm.c,v
retrieving revision 1.45
diff -u -r1.45 perm.c
--- perm.c 2002/02/22 20:39:17 1.45
+++ perm.c 2002/02/23 17:54:59
@@ -2029,11 +2029,8 @@
char *arg0;
char *resdir;
char *tmp;
- char *perl_path;
EXECSTUFF *foo;
int done = 0;
- int code;
- char accesslist[BIG_BUFFER];
char buf[BIG_BUFFER];
if (!auth->res_methods)
Index: nnrpd/tls.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/nnrpd/tls.c,v
retrieving revision 1.4
diff -u -r1.4 tls.c
--- tls.c 2001/02/08 22:23:45 1.4
+++ tls.c 2002/02/23 17:54:59
@@ -452,8 +452,6 @@
int tls_start_servertls(int readfd, int writefd)
{
int sts;
- int j;
- unsigned int n;
SSL_SESSION *session;
SSL_CIPHER *cipher;
Index: storage/ov.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/storage/ov.c,v
retrieving revision 1.32
diff -u -r1.32 ov.c
--- ov.c 2002/01/13 13:29:43 1.32
+++ ov.c 2002/02/23 17:55:00
@@ -249,7 +249,7 @@
* If there are other fields beyond Xref in overview, then
* we must find Xref's end, or data following is misinterpreted.
*/
- if (xrefend = memchr(next, '\t', xreflen))
+ if ((xrefend = memchr(next, '\t', xreflen)) != NULL)
xreflen = xrefend - next;
if (xrefdatalen == 0) {
@@ -305,7 +305,7 @@
if (artnum <= 0)
continue;
- sprintf(overdata, "%d\t", artnum);
+ sprintf(overdata, "%ld\t", artnum);
i = strlen(overdata);
memcpy(overdata + i, data, len);
i += len;
@@ -819,8 +819,6 @@
{
static NEWSGROUP Removeit;
BADGROUP *bg;
- char *p;
- char buff[SPOOLNAMEBUFF];
/* See if we already know about this group. */
for (bg = EXPbadgroups; bg; bg = bg->Next)
@@ -846,7 +844,6 @@
*/
static enum KRP EXPkeepit(char *Entry, time_t when, time_t expires)
{
- char *p;
NEWSGROUP *ngp;
enum KRP retval = Remove;
@@ -969,7 +966,7 @@
static int buffsize;
int i;
ARTOVERFIELD *fp;
- char *next, *q;
+ char *next;
fp = &ARTfields[field];
@@ -1070,13 +1067,11 @@
char *p;
int i;
int count;
- time_t posted;
time_t when;
bool poisoned;
bool keeper;
bool remove;
bool purge;
- ARTHANDLE *article;
char *Xref;
if (SMprobe(SELFEXPIRE, &token, NULL)) {
Index: storage/buffindexed/buffindexed.c
===================================================================
RCS file: /dist1/cvs/isc/inn/inn/storage/buffindexed/buffindexed.c,v
retrieving revision 1.61
diff -u -r1.61 buffindexed.c
--- buffindexed.c 2002/01/17 01:41:29 1.61
+++ buffindexed.c 2002/02/23 17:55:00
@@ -994,7 +994,6 @@
HASH grouphash;
GROUPLOC gloc;
GROUPENTRY *ge;
- void *handle;
#ifdef OV_DEBUG
struct ov_name_table *ntp;
#endif /* OV_DEBUG */
@@ -1135,7 +1134,6 @@
bool buffindexed_groupdel(char *group) {
GROUPLOC gloc;
GROUPENTRY *ge;
- void *handle;
gloc = GROUPfind(group, FALSE);
if (GROUPLOCempty(gloc)) {
@@ -1176,7 +1174,6 @@
#endif /* OV_DEBUG */
OVBUFF *ovbuff;
OV ov;
- int delta, i;
OVINDEXHEAD ovindexhead;
/* there is no index */
@@ -1421,7 +1418,6 @@
#endif /* OV_DEBUG */
GROUPDATABLOCK *gdb;
int i;
- OV ov;
GIBLIST *giblist;
for (giblist = Giblist ; giblist != NULL ; giblist = giblist->next) {
@@ -1500,7 +1496,7 @@
OV ov = ge->baseindex;
OVBUFF *ovbuff;
GROUPDATABLOCK *gdb;
- int pagefudge, base, limit, i, count, len;
+ int pagefudge, limit, i, count, len;
off_t offset, mmapoffset;
OVBLOCK *ovblock;
caddr_t addr;
@@ -1663,7 +1659,6 @@
bool ovsearch(void *handle, ARTNUM *artnum, char **data, int *len, TOKEN *token, time_t *arrived, time_t *expires) {
OVSEARCH *search = (OVSEARCH *)handle;
- OVBLOCK *ovblock;
OV srchov;
GROUPDATABLOCK *gdb;
off_t offset, mmapoffset;
More information about the inn-patches
mailing list