Fixed compiler warnings

This commit is contained in:
Michiel Broek
2011-05-22 17:43:12 +02:00
parent ad0d7cc679
commit 517cc6944f
38 changed files with 174 additions and 210 deletions

View File

@@ -1806,7 +1806,7 @@ int binkp_send_frame(int cmd, char *buf, int len)
unsigned short header = 0;
int rc, id;
#ifdef HAVE_ZLIB_H
int rcz, last;
int rcz;
uLongf zlen;
Bytef *zbuf;
@@ -1833,7 +1833,6 @@ int binkp_send_frame(int cmd, char *buf, int len)
}
#ifdef HAVE_ZLIB_H
last = bp.cmpblksize;
/*
* Only use compression for DATA blocks larger then 20 bytes.
* Also, don't send PLZ blocks if GZ or BZ2 mode is active.
@@ -2433,7 +2432,7 @@ int binkp_process_messages(void)
the_queue *tmpq, *oldq;
binkp_list *tmp;
file_list *tsl;
int Found, rmode;
int Found;
char *lname, *ropts;
time_t ltime;
int lsize, loffs;
@@ -2446,20 +2445,13 @@ int binkp_process_messages(void)
for (tmpq = tql; tmpq; tmpq = tmpq->next) {
Syslog('+', "Binkp: %s \"%s\"", bstate[tmpq->cmd], printable(tmpq->data, 0));
if (tmpq->cmd == MM_GET) {
rmode = CompNone;
snprintf(lname, 512, "%s", strtok(tmpq->data, " \n\r"));
lsize = atoi(strtok(NULL, " \n\r"));
ltime = atoi(strtok(NULL, " \n\r"));
loffs = atoi(strtok(NULL, " \n\r"));
snprintf(ropts, 512, "%s", printable(strtok(NULL, " \n\r\0"), 0));
Syslog('b', "Binkp: m_file options \"%s\"", ropts);
if (strcmp((char *)"GZ", ropts) == 0)
rmode = CompGZ;
else if (strcmp((char *)"BZ2", ropts) == 0)
rmode = CompBZ2;
else
if (strcmp((char *)"NZ", ropts) == 0) {
rmode = CompNone;
if (strcmp((char *)"NZ", ropts) == 0) {
#ifdef HAVE_ZLIB_H
bp.GZwe = bp.GZthey = No;
#endif

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: chat.c,v 1.11 2005/08/28 13:45:26 mbse Exp $
* Purpose ...............: Fidonet mailer - modem chat
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -146,7 +145,7 @@ void almhdl(int sig)
int expect_str(int, int, char *);
int expect_str(int timeout, int aftermode, char *Phone)
{
int matched = FALSE, smatch = FALSE, ematch = FALSE, ioerror = FALSE, i, rc;
int matched = FALSE, smatch = FALSE, ioerror = FALSE, i, rc;
char inbuf[256];
unsigned char ch = '\0';
int eol = FALSE;
@@ -188,7 +187,6 @@ int expect_str(int timeout, int aftermode, char *Phone)
if (strlen(modem.error[i]))
if (strncmp(modem.error[i], inbuf, strlen(modem.error[i])) == 0) {
matched = TRUE;
ematch = TRUE;
Syslog('+', "chat: got \"%s\", aborting", printable(inbuf, 0));
}

View File

@@ -1,11 +1,10 @@
/*****************************************************************************
*
* $Id: hydra.c,v 1.36 2007/08/25 18:32:07 mbse Exp $
* Purpose ...............: Fidonet mailer - Hydra protocol driver
* Remark ................: See below for more copyright details and credits.
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -1405,7 +1404,6 @@ int hydra_batch(int role, file_list *to_send)
*/
else if ((rxlen > 41) && (rxbuf[rxlen - 1] == 0)) {
time_t timestamp;
time_t orgstamp;
int filesize, tt;
char dosname[8 + 1 + 3 + 1], *Name;
@@ -1413,7 +1411,6 @@ int hydra_batch(int role, file_list *to_send)
timestamp = (time_t)tt;
/* convert timestamp to UNIX time */
orgstamp = timestamp;
timestamp = sl2mtime(timestamp);
/*

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: openport.c,v 1.11 2007/08/26 12:21:16 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************
* Copyright (C) 1997-2004
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -387,7 +386,7 @@ static struct termios tios;
int tty_raw(int speed)
{
int rc;
speed_t tspeed, is, os;
speed_t tspeed;
Syslog('t', "Set tty raw");
tspeed = transpeed(speed);
@@ -414,8 +413,8 @@ int tty_raw(int speed)
if ((rc = tcsetattr(0,TCSADRAIN,&tios)))
WriteError("$tcsetattr(0,TCSADRAIN,raw) return %d",rc);
is = cfgetispeed(&tios);
os = cfgetospeed(&tios);
cfgetispeed(&tios);
cfgetospeed(&tios);
return rc;
}

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: respfreq.c,v 1.22 2008/11/26 22:01:01 mbse Exp $
* Purpose ...............: Fidonet mailer - respond to filerequests
*
*****************************************************************************
* Copyright (C) 1997-2008
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -159,7 +158,6 @@ file_list *respfreq(char *nm, char *pw, char *dt)
time_t upd = 0L;
int newer = 1, Send;
FILE *fa, *fi;
int Area;
struct FILEIndex idx;
struct _fdbarea *fdb_area = NULL;
@@ -246,7 +244,6 @@ file_list *respfreq(char *nm, char *pw, char *dt)
WriteError("$Can't open %s", p);
return NULL;
}
Area = 0L;
free(p);
Syslog('f', "Start search ...");

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: xmrecv.c,v 1.15 2007/08/26 12:21:16 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -125,7 +124,7 @@ SM_NAMES
SM_EDECL
int tmp, i;
int SEAlink = FALSE, Slo = FALSE;
int SEAlink = FALSE;
int crcmode = session_flags & FTSC_XMODEM_CRC;
int count=0,junk=0,cancount=0;
int header = 0;
@@ -192,7 +191,6 @@ SM_STATE(waitblk0)
} else {
switch (header) {
case EOT: Syslog('x', "got EOT");
Slo = FALSE;
if (ackd_blk == -1L)
last=1;
else {
@@ -457,7 +455,6 @@ SM_STATE(checktelink)
remtime=sl2mtime(((time_t)xmblk.data[4])+ ((time_t)xmblk.data[5]<<8)+
((time_t)xmblk.data[6]<<16)+ ((time_t)xmblk.data[7]<<24));
if (xmblk.data[40]) {
Slo = TRUE;
remote_flags |= FTSC_XMODEM_SLO;
} else
remote_flags &= ~FTSC_XMODEM_SLO;
@@ -519,7 +516,6 @@ SM_STATE(recvm7)
SM_STATE(goteof)
Slo = FALSE;
closeit(1);
if (ackd_blk == -1L)
last=1;

View File

@@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: zmrecv.c,v 1.15 2007/08/26 14:02:28 mbse Exp $
* Purpose ...............: Fidonet mailer
*
*****************************************************************************
* Copyright (C) 1997-2005
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@@ -483,20 +482,16 @@ int ackbibi(void)
*/
int procheader(char *Name)
{
register char *openmode, *p;
register char *p;
static int dummy;
char ctt[32];
Syslog('z', "procheader \"%s\"",printable(Name,0));
/* set default parameters and overrides */
openmode = (char *)"w";
Syslog('z', "procheader \"%s\"", printable(Name,0));
/*
* Process ZMODEM remote file management requests
*/
Thisbinary = (zconv != ZCNL); /* Remote ASCII override */
if (zmanag == ZMAPND)
openmode = (char *)"a";
Bytesleft = DEFBYTL;
Filemode = 0;