Fix warnings, remove unused variables.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@970 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Björn Groenvall
1996-11-15 18:39:27 +00:00
parent 629f5ec95c
commit 0bcddc9caf
23 changed files with 61 additions and 21 deletions

View File

@@ -1934,7 +1934,7 @@ restart(int argc, char **argv)
printf("restart: offset not specified\n"); printf("restart: offset not specified\n");
else { else {
off_t restart_point = atol(argv[1]); off_t restart_point = atol(argv[1]);
printf("restarting at %qd. %s\n", restart_point, printf("restarting at %ld. %s\n", (long)restart_point,
"execute get, put or append to initiate transfer"); "execute get, put or append to initiate transfer");
} }
} }

View File

@@ -538,13 +538,12 @@ copy_stream(FILE *from, FILE *to)
char buf[BUFSIZ]; char buf[BUFSIZ];
int n; int n;
int bytes = 0; int bytes = 0;
struct stat st;
int werr; int werr;
#ifdef HAVE_MMAP
struct stat st;
void *chunk; void *chunk;
#ifdef HAVE_MMAP
if(fstat(fileno(from), &st) == 0 && S_ISREG(st.st_mode)){ if(fstat(fileno(from), &st) == 0 && S_ISREG(st.st_mode)){
chunk = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fileno(from), 0); chunk = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fileno(from), 0);
if(chunk != NULL){ if(chunk != NULL){

View File

@@ -43,7 +43,7 @@ SOURCES = $(SOURCES_KX) $(SOURCES_KXD) $(SOURCES_COMMON)
all: $(PROGS) all: $(PROGS)
Wall: Wall:
make CFLAGS="-g -Wall -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__" make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $< $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $<

View File

@@ -128,7 +128,7 @@ copy_encrypted (int fd1, int fd2, des_cblock *iv,
int int
get_xsockets (int *unix_socket, int *tcp_socket) get_xsockets (int *unix_socket, int *tcp_socket)
{ {
int unixfd, tcpfd; int unixfd, tcpfd = -1;
struct sockaddr_un unixaddr; struct sockaddr_un unixaddr;
struct sockaddr_in tcpaddr; struct sockaddr_in tcpaddr;
int dpy; int dpy;

View File

@@ -111,7 +111,6 @@ connect_host (char *host, des_cblock *key, des_key_schedule schedule,
struct hostent *hostent; struct hostent *hostent;
int s; int s;
u_char b; u_char b;
char tmp[16];
char **p; char **p;
hostent = gethostbyname (host); hostent = gethostbyname (host);
@@ -329,7 +328,6 @@ doit (char *host, int passivep, int debugp, int tcpp)
if (passivep) { if (passivep) {
struct sockaddr_in newaddr; struct sockaddr_in newaddr;
int addrlen; int addrlen;
u_char b = passivep;
int otherside; int otherside;
otherside = connect_host (host, &key, schedule, passivep); otherside = connect_host (host, &key, schedule, passivep);

View File

@@ -51,6 +51,7 @@ usage (void)
exit (1); exit (1);
} }
#if 0
static void static void
strlwr (char *s) strlwr (char *s)
{ {
@@ -59,6 +60,7 @@ strlwr (char *s)
s++; s++;
} }
} }
#endif
static int static int
print (int argc, print (int argc,

View File

@@ -42,7 +42,7 @@ OBJECTS = pop_dele.o pop_dropcopy.o pop_dropinfo.o \
all: $(PROGS) all: $(PROGS)
Wall: Wall:
make CFLAGS="-g -Wall -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__" make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $< $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $<

View File

@@ -40,7 +40,7 @@ OBJECTS = xnlock.o
all: $(PROGS) all: $(PROGS)
Wall: Wall:
make CFLAGS="$(XINCS) -g -Wall -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__" make CFLAGS="$(XINCS) -g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $< $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $<

View File

@@ -17,7 +17,7 @@ all:
do (cd $$i && $(MAKE) $(MFLAGS) all); done do (cd $$i && $(MAKE) $(MFLAGS) all); done
Wall: Wall:
make CFLAGS="-g -Wall -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__" make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
install: all install: all
SUBDIRS=$(SUBDIRS); \ SUBDIRS=$(SUBDIRS); \

View File

@@ -36,7 +36,7 @@ OBJECTS = verify.o
all: $(LIB) all: $(LIB)
Wall: Wall:
make CFLAGS="-g -Wall -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__" make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I../../.. -I../../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $< $(CC) -c $(CPPFLAGS) $(DEFS) -I../../.. -I../../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $<

View File

@@ -35,7 +35,7 @@ OBJECTS = pam.o
all: $(LIB) all: $(LIB)
Wall: Wall:
make CFLAGS="-g -Wall -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__" make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I../../.. -I../../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $< $(CC) -c $(CPPFLAGS) $(DEFS) -I../../.. -I../../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $<

View File

@@ -35,7 +35,7 @@ OBJECTS = sia.o
all: $(LIB) all: $(LIB)
Wall: Wall:
make CFLAGS="-g -Wall -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__" make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I../../.. -I../../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $< $(CC) -c $(CPPFLAGS) $(DEFS) -I../../.. -I../../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $<

View File

@@ -41,7 +41,7 @@ LIBOBJ = cbc3_enc.o cbc_enc.o cfb64ede.o cfb64enc.o cfb_enc.o ecb3_enc.o ede_enc
all: $(LIB) $(PROGS) all: $(LIB) $(PROGS)
Wall: Wall:
make CFLAGS="-g -Wall -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__" make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $< $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $<

View File

@@ -47,6 +47,7 @@ RCSID("$Id$");
#include <md5.h> #include <md5.h>
#include <sha.h> #include <sha.h>
static
int int
md4_tests (void) md4_tests (void)
{ {
@@ -89,6 +90,7 @@ md4_tests (void)
return 0; return 0;
} }
static
int int
md5_tests (void) md5_tests (void)
{ {
@@ -123,6 +125,7 @@ md5_tests (void)
return 0; return 0;
} }
static
int int
sha_tests (void) sha_tests (void)
{ {

View File

@@ -164,9 +164,13 @@ sigALRM(int sig)
#endif #endif
#if !defined(HAVE_RANDOM) && defined(HAVE_RAND) #if !defined(HAVE_RANDOM) && defined(HAVE_RAND)
#ifndef srandom
#define srandom srand #define srandom srand
#endif
#ifndef random
#define random rand #define random rand
#endif #endif
#endif
#ifdef HAVE_RANDOM #ifdef HAVE_RANDOM

View File

@@ -37,7 +37,7 @@ OBJECTS = afssys.o
all: $(LIB) all: $(LIB)
Wall: Wall:
make CFLAGS="-g -Wall -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__" make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $< $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $<

View File

@@ -38,7 +38,7 @@ OBJECTS = otp.o otp_challenge.o otp_db.o otp_md.o \
all: $(LIB) all: $(LIB)
Wall: Wall:
make CFLAGS="-g -Wall -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__" make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) -I$(srcdir)/../des $(CFLAGS) $(PICFLAGS) $< $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) -I$(srcdir)/../des $(CFLAGS) $(PICFLAGS) $<

View File

@@ -45,7 +45,7 @@ OBJECTS = k_getpwuid.o k_getpwnam.o signal.o tm2time.o \
all: $(LIB) all: $(LIB)
Wall: Wall:
make CFLAGS="-g -Wall -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__" make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
.c.o: .c.o:
$(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $< $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $<

View File

@@ -70,6 +70,7 @@ string_to_type(const char *name)
return -1; return -1;
} }
#if 0
static char * static char *
type_to_string(int type) type_to_string(int type)
{ {
@@ -79,6 +80,7 @@ type_to_string(int type)
return p->name; return p->name;
return NULL; return NULL;
} }
#endif
void void
dns_free_data(struct dns_reply *r) dns_free_data(struct dns_reply *r)
@@ -126,7 +128,7 @@ parse_reply(unsigned char *data, int len)
p += 2; p += 2;
rr = &r->head; rr = &r->head;
while(p < data + len){ while(p < data + len){
int type, class, ttl, size, priority, weight, port; int type, class, ttl, size;
status = dn_expand(data, data + len, p, host, sizeof(host)); status = dn_expand(data, data + len, p, host, sizeof(host));
if(status < 0){ if(status < 0){
dns_free_data(r); dns_free_data(r);
@@ -160,7 +162,6 @@ parse_reply(unsigned char *data, int len)
break; break;
case T_MX: case T_MX:
case T_AFSDB:{ case T_AFSDB:{
struct mx_record *mx;
status = dn_expand(data, data + len, p + 2, host, sizeof(host)); status = dn_expand(data, data + len, p + 2, host, sizeof(host));
if(status < 0){ if(status < 0){
dns_free_data(r); dns_free_data(r);
@@ -173,7 +174,6 @@ parse_reply(unsigned char *data, int len)
break; break;
} }
case T_SRV:{ case T_SRV:{
struct srv_record *srv;
status = dn_expand(data, data + len, p + 6, host, status = dn_expand(data, data + len, p + 6, host,
sizeof((char*)host)); sizeof((char*)host));
if(status < 0){ if(status < 0){

View File

@@ -42,6 +42,7 @@
#define __ROKEN_H__ #define __ROKEN_H__
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h>
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
@@ -131,6 +132,14 @@ char *getstr(char *id, char **cpp);
struct passwd *k_getpwnam (char *user); struct passwd *k_getpwnam (char *user);
struct passwd *k_getpwuid (uid_t uid); struct passwd *k_getpwuid (uid_t uid);
#ifndef HAVE_SETEUID
int seteuid(int euid);
#endif
#ifndef HAVE_SETEGID
int setegid(int egid);
#endif
#include <time.h> #include <time.h>
#include <sys/time.h> #include <sys/time.h>
time_t tm2time (struct tm tm, int local); time_t tm2time (struct tm tm, int local);
@@ -168,6 +177,10 @@ void mini_inetd (int port);
#include <syslog.h> #include <syslog.h>
/* Misc definitions for old syslogs */ /* Misc definitions for old syslogs */
#ifndef HAVE_VSYSLOG
void vsyslog(int pri, const char *fmt, va_list ap);
#endif
#ifndef LOG_DAEMON #ifndef LOG_DAEMON
#define openlog(id,option,facility) openlog((id),(option)) #define openlog(id,option,facility) openlog((id),(option))
#endif #endif

View File

@@ -42,6 +42,7 @@
#define __ROKEN_H__ #define __ROKEN_H__
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h>
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
@@ -131,6 +132,14 @@ char *getstr(char *id, char **cpp);
struct passwd *k_getpwnam (char *user); struct passwd *k_getpwnam (char *user);
struct passwd *k_getpwuid (uid_t uid); struct passwd *k_getpwuid (uid_t uid);
#ifndef HAVE_SETEUID
int seteuid(int euid);
#endif
#ifndef HAVE_SETEGID
int setegid(int egid);
#endif
#include <time.h> #include <time.h>
#include <sys/time.h> #include <sys/time.h>
time_t tm2time (struct tm tm, int local); time_t tm2time (struct tm tm, int local);
@@ -168,6 +177,10 @@ void mini_inetd (int port);
#include <syslog.h> #include <syslog.h>
/* Misc definitions for old syslogs */ /* Misc definitions for old syslogs */
#ifndef HAVE_VSYSLOG
void vsyslog(int pri, const char *fmt, va_list ap);
#endif
#ifndef LOG_DAEMON #ifndef LOG_DAEMON
#define openlog(id,option,facility) openlog((id),(option)) #define openlog(id,option,facility) openlog((id),(option))
#endif #endif

View File

@@ -41,6 +41,10 @@
RCSID("$Id$"); RCSID("$Id$");
#endif #endif
#include <unistd.h>
#include "roken.h"
int int
setegid(int egid) setegid(int egid)
{ {

View File

@@ -41,6 +41,10 @@
RCSID("$Id$"); RCSID("$Id$");
#endif #endif
#include <unistd.h>
#include "roken.h"
int int
seteuid(int euid) seteuid(int euid)
{ {