Quiet final set of warnings.

This commit is contained in:
hpa 2001-07-21 02:02:43 +00:00
parent 0034637792
commit 304cb0877c
5 changed files with 36 additions and 19 deletions

View file

@ -38,5 +38,10 @@
* @(#)extern.h 8.1 (Berkeley) 6/6/93
*/
#ifndef RECVFILE_H
#define RECVFILE_H
void recvfile (int, char *, char *);
void sendfile (int, char *, char *);
#endif

View file

@ -34,13 +34,16 @@
* SUCH DAMAGE.
*/
#include "tftpsubs.h"
#ifndef lint
static const char *copyright =
static const char *copyright UNUSED =
"@(#) Copyright (c) 1983, 1993\n\
The Regents of the University of California. All rights reserved.\n";
/* static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; */
/* static char rcsid[] = "$OpenBSD: main.c,v 1.4 1997/01/17 07:13:30 millert Exp $"; */
static const char *rcsid = "tftp-hpa $Id$";
static const char *rcsid UNUSED =
"tftp-hpa $Id$";
#endif /* not lint */
/* Many bug fixes are from Jim Guyton <guyton@rand-unix> */
@ -66,17 +69,8 @@ static const char *rcsid = "tftp-hpa $Id$";
#include <string.h>
#include <unistd.h>
#include "../config.h"
#include "extern.h"
void bsd_signal(int, void (*)(int));
#ifndef HAVE_SIGSETJMP
#define sigsetjmp(x,y) setjmp(x)
#define siglongjmp(x,y) longjmp(x,y)
#define sigjmp_buf jmp_buf
#endif
#define TIMEOUT 5 /* secs between rexmt's */
#define LBUFLEN 200 /* size of input buffer */

View file

@ -36,10 +36,13 @@
* SUCH DAMAGE.
*/
#include "tftpsubs.h"
#ifndef lint
/* static char sccsid[] = "@(#)tftpsubs.c 8.1 (Berkeley) 6/6/93"; */
/* static char rcsid[] = "$OpenBSD: tftpsubs.c,v 1.2 1996/06/26 05:40:36 deraadt Exp $"; */
static const char *rcsid = "tftp-hpa: $Id$";
static const char *rcsid UNUSED =
"tftp-hpa: $Id$";
#endif /* not lint */
/* Simple minded read-ahead/write-behind subroutines for tftp user and
@ -62,8 +65,6 @@ static const char *rcsid = "tftp-hpa: $Id$";
#include <stdio.h>
#include <unistd.h>
#include "tftpsubs.h"
#define PKTSIZE MAX_SEGSIZE+4 /* should be moved to tftp.h */
int segsize = SEGSIZE; /* Default segsize */

View file

@ -47,6 +47,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <setjmp.h>
#include "../config.h"
struct tftphdr;
@ -69,6 +72,17 @@ extern int segsize;
extern void *xmalloc(size_t);
extern char *xstrdup(const char *);
/*
* Signal-related stuff
*/
void bsd_signal(int, void (*)(int));
#ifndef HAVE_SIGSETJMP
#define sigsetjmp(x,y) setjmp(x)
#define siglongjmp(x,y) longjmp(x,y)
#define sigjmp_buf jmp_buf
#endif
/*
* How to annotate unused variables
*/

View file

@ -775,8 +775,9 @@ void
sendfile(struct formats *pf, struct tftphdr *oap, int oacklen)
{
struct tftphdr *dp;
struct tftphdr *ap; /* ack packet */
int block = 1, size, n;
struct tftphdr *ap; /* ack packet */
static int block = 1; /* Static to avoid longjmp funnies */
int size, n;
ap = (struct tftphdr *)ackbuf;
@ -882,8 +883,10 @@ void
recvfile(struct formats *pf, struct tftphdr *oap, int oacklen)
{
struct tftphdr *dp;
struct tftphdr *ap; /* ack buffer */
int block = 0, acksize, n, size;
int n, size;
/* These are "static" to avoid longjmp funnies */
static struct tftphdr *ap; /* ack buffer */
static int block = 0, acksize;
dp = w_init();
do {