From 0bcddc9caf1823bcc9bb9424fbbb86767664f290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Groenvall?= Date: Fri, 15 Nov 1996 18:39:27 +0000 Subject: [PATCH] Fix warnings, remove unused variables. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@970 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/ftp/ftp/cmds.c | 2 +- appl/ftp/ftp/ftp.c | 5 ++--- appl/kx/Makefile.in | 2 +- appl/kx/common.c | 2 +- appl/kx/kx.c | 2 -- appl/otp/otpprint.c | 2 ++ appl/popper/Makefile.in | 2 +- appl/xnlock/Makefile.in | 2 +- lib/auth/Makefile.in | 2 +- lib/auth/afskauthlib/Makefile.in | 2 +- lib/auth/pam/Makefile.in | 2 +- lib/auth/sia/Makefile.in | 2 +- lib/des/Makefile.in | 2 +- lib/des/mdtest.c | 3 +++ lib/des/rnd_keys.c | 4 ++++ lib/kafs/Makefile.in | 2 +- lib/otp/Makefile.in | 2 +- lib/roken/Makefile.in | 2 +- lib/roken/resolve.c | 6 +++--- lib/roken/roken.h | 13 +++++++++++++ lib/roken/roken.h.in | 13 +++++++++++++ lib/roken/setegid.c | 4 ++++ lib/roken/seteuid.c | 4 ++++ 23 files changed, 61 insertions(+), 21 deletions(-) diff --git a/appl/ftp/ftp/cmds.c b/appl/ftp/ftp/cmds.c index ea60b4454..9150298ff 100644 --- a/appl/ftp/ftp/cmds.c +++ b/appl/ftp/ftp/cmds.c @@ -1934,7 +1934,7 @@ restart(int argc, char **argv) printf("restart: offset not specified\n"); else { 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"); } } diff --git a/appl/ftp/ftp/ftp.c b/appl/ftp/ftp/ftp.c index 2f5e0d0f2..994d8930b 100644 --- a/appl/ftp/ftp/ftp.c +++ b/appl/ftp/ftp/ftp.c @@ -538,13 +538,12 @@ copy_stream(FILE *from, FILE *to) char buf[BUFSIZ]; int n; int bytes = 0; - struct stat st; - int werr; +#ifdef HAVE_MMAP + struct stat st; void *chunk; -#ifdef HAVE_MMAP if(fstat(fileno(from), &st) == 0 && S_ISREG(st.st_mode)){ chunk = mmap(0, st.st_size, PROT_READ, MAP_SHARED, fileno(from), 0); if(chunk != NULL){ diff --git a/appl/kx/Makefile.in b/appl/kx/Makefile.in index 8e25c6bc7..68527a504 100644 --- a/appl/kx/Makefile.in +++ b/appl/kx/Makefile.in @@ -43,7 +43,7 @@ SOURCES = $(SOURCES_KX) $(SOURCES_KXD) $(SOURCES_COMMON) all: $(PROGS) 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: $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $< diff --git a/appl/kx/common.c b/appl/kx/common.c index 820730b2a..ed4d4e631 100644 --- a/appl/kx/common.c +++ b/appl/kx/common.c @@ -128,7 +128,7 @@ copy_encrypted (int fd1, int fd2, des_cblock *iv, int get_xsockets (int *unix_socket, int *tcp_socket) { - int unixfd, tcpfd; + int unixfd, tcpfd = -1; struct sockaddr_un unixaddr; struct sockaddr_in tcpaddr; int dpy; diff --git a/appl/kx/kx.c b/appl/kx/kx.c index ca3cfa5fb..15d162e25 100644 --- a/appl/kx/kx.c +++ b/appl/kx/kx.c @@ -111,7 +111,6 @@ connect_host (char *host, des_cblock *key, des_key_schedule schedule, struct hostent *hostent; int s; u_char b; - char tmp[16]; char **p; hostent = gethostbyname (host); @@ -329,7 +328,6 @@ doit (char *host, int passivep, int debugp, int tcpp) if (passivep) { struct sockaddr_in newaddr; int addrlen; - u_char b = passivep; int otherside; otherside = connect_host (host, &key, schedule, passivep); diff --git a/appl/otp/otpprint.c b/appl/otp/otpprint.c index cd737d78f..6c3b5c773 100644 --- a/appl/otp/otpprint.c +++ b/appl/otp/otpprint.c @@ -51,6 +51,7 @@ usage (void) exit (1); } +#if 0 static void strlwr (char *s) { @@ -59,6 +60,7 @@ strlwr (char *s) s++; } } +#endif static int print (int argc, diff --git a/appl/popper/Makefile.in b/appl/popper/Makefile.in index b3fd93409..500ee059e 100644 --- a/appl/popper/Makefile.in +++ b/appl/popper/Makefile.in @@ -42,7 +42,7 @@ OBJECTS = pop_dele.o pop_dropcopy.o pop_dropinfo.o \ all: $(PROGS) 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: $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $< diff --git a/appl/xnlock/Makefile.in b/appl/xnlock/Makefile.in index 23882604f..843fe0c91 100644 --- a/appl/xnlock/Makefile.in +++ b/appl/xnlock/Makefile.in @@ -40,7 +40,7 @@ OBJECTS = xnlock.o all: $(PROGS) 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: $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $< diff --git a/lib/auth/Makefile.in b/lib/auth/Makefile.in index df1807681..c6af4e825 100644 --- a/lib/auth/Makefile.in +++ b/lib/auth/Makefile.in @@ -17,7 +17,7 @@ all: do (cd $$i && $(MAKE) $(MFLAGS) all); done 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 SUBDIRS=$(SUBDIRS); \ diff --git a/lib/auth/afskauthlib/Makefile.in b/lib/auth/afskauthlib/Makefile.in index 2ce86d4d3..e974a6567 100644 --- a/lib/auth/afskauthlib/Makefile.in +++ b/lib/auth/afskauthlib/Makefile.in @@ -36,7 +36,7 @@ OBJECTS = verify.o all: $(LIB) 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: $(CC) -c $(CPPFLAGS) $(DEFS) -I../../.. -I../../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $< diff --git a/lib/auth/pam/Makefile.in b/lib/auth/pam/Makefile.in index c2d9dc204..3689d1227 100644 --- a/lib/auth/pam/Makefile.in +++ b/lib/auth/pam/Makefile.in @@ -35,7 +35,7 @@ OBJECTS = pam.o all: $(LIB) 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: $(CC) -c $(CPPFLAGS) $(DEFS) -I../../.. -I../../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $< diff --git a/lib/auth/sia/Makefile.in b/lib/auth/sia/Makefile.in index 5179de45c..f3c06541c 100644 --- a/lib/auth/sia/Makefile.in +++ b/lib/auth/sia/Makefile.in @@ -35,7 +35,7 @@ OBJECTS = sia.o all: $(LIB) 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: $(CC) -c $(CPPFLAGS) $(DEFS) -I../../.. -I../../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $< diff --git a/lib/des/Makefile.in b/lib/des/Makefile.in index 030b7f1d2..746d31b90 100644 --- a/lib/des/Makefile.in +++ b/lib/des/Makefile.in @@ -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) 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: $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $< diff --git a/lib/des/mdtest.c b/lib/des/mdtest.c index 9d7d6dab2..07c5db305 100644 --- a/lib/des/mdtest.c +++ b/lib/des/mdtest.c @@ -47,6 +47,7 @@ RCSID("$Id$"); #include #include +static int md4_tests (void) { @@ -89,6 +90,7 @@ md4_tests (void) return 0; } +static int md5_tests (void) { @@ -123,6 +125,7 @@ md5_tests (void) return 0; } +static int sha_tests (void) { diff --git a/lib/des/rnd_keys.c b/lib/des/rnd_keys.c index ec14e2fc3..cb11d9124 100644 --- a/lib/des/rnd_keys.c +++ b/lib/des/rnd_keys.c @@ -164,9 +164,13 @@ sigALRM(int sig) #endif #if !defined(HAVE_RANDOM) && defined(HAVE_RAND) +#ifndef srandom #define srandom srand +#endif +#ifndef random #define random rand #endif +#endif #ifdef HAVE_RANDOM diff --git a/lib/kafs/Makefile.in b/lib/kafs/Makefile.in index 63dd4d300..436de1710 100644 --- a/lib/kafs/Makefile.in +++ b/lib/kafs/Makefile.in @@ -37,7 +37,7 @@ OBJECTS = afssys.o all: $(LIB) 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: $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $< diff --git a/lib/otp/Makefile.in b/lib/otp/Makefile.in index 4cf92db17..2889e7f68 100644 --- a/lib/otp/Makefile.in +++ b/lib/otp/Makefile.in @@ -38,7 +38,7 @@ OBJECTS = otp.o otp_challenge.o otp_db.o otp_md.o \ all: $(LIB) 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: $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) -I$(srcdir)/../des $(CFLAGS) $(PICFLAGS) $< diff --git a/lib/roken/Makefile.in b/lib/roken/Makefile.in index f2261a773..360b6d84f 100644 --- a/lib/roken/Makefile.in +++ b/lib/roken/Makefile.in @@ -45,7 +45,7 @@ OBJECTS = k_getpwuid.o k_getpwnam.o signal.o tm2time.o \ all: $(LIB) 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: $(CC) -c $(CPPFLAGS) $(DEFS) -I../.. -I../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $< diff --git a/lib/roken/resolve.c b/lib/roken/resolve.c index 96fba0a76..b3fc311a9 100644 --- a/lib/roken/resolve.c +++ b/lib/roken/resolve.c @@ -70,6 +70,7 @@ string_to_type(const char *name) return -1; } +#if 0 static char * type_to_string(int type) { @@ -79,6 +80,7 @@ type_to_string(int type) return p->name; return NULL; } +#endif void dns_free_data(struct dns_reply *r) @@ -126,7 +128,7 @@ parse_reply(unsigned char *data, int len) p += 2; rr = &r->head; 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)); if(status < 0){ dns_free_data(r); @@ -160,7 +162,6 @@ parse_reply(unsigned char *data, int len) break; case T_MX: case T_AFSDB:{ - struct mx_record *mx; status = dn_expand(data, data + len, p + 2, host, sizeof(host)); if(status < 0){ dns_free_data(r); @@ -173,7 +174,6 @@ parse_reply(unsigned char *data, int len) break; } case T_SRV:{ - struct srv_record *srv; status = dn_expand(data, data + len, p + 6, host, sizeof((char*)host)); if(status < 0){ diff --git a/lib/roken/roken.h b/lib/roken/roken.h index cf1162db3..f0bcb7c78 100644 --- a/lib/roken/roken.h +++ b/lib/roken/roken.h @@ -42,6 +42,7 @@ #define __ROKEN_H__ #include +#include #include #include #ifdef HAVE_SYS_TYPES_H @@ -131,6 +132,14 @@ char *getstr(char *id, char **cpp); struct passwd *k_getpwnam (char *user); struct passwd *k_getpwuid (uid_t uid); +#ifndef HAVE_SETEUID +int seteuid(int euid); +#endif + +#ifndef HAVE_SETEGID +int setegid(int egid); +#endif + #include #include time_t tm2time (struct tm tm, int local); @@ -168,6 +177,10 @@ void mini_inetd (int port); #include /* Misc definitions for old syslogs */ +#ifndef HAVE_VSYSLOG +void vsyslog(int pri, const char *fmt, va_list ap); +#endif + #ifndef LOG_DAEMON #define openlog(id,option,facility) openlog((id),(option)) #endif diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index cf1162db3..f0bcb7c78 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -42,6 +42,7 @@ #define __ROKEN_H__ #include +#include #include #include #ifdef HAVE_SYS_TYPES_H @@ -131,6 +132,14 @@ char *getstr(char *id, char **cpp); struct passwd *k_getpwnam (char *user); struct passwd *k_getpwuid (uid_t uid); +#ifndef HAVE_SETEUID +int seteuid(int euid); +#endif + +#ifndef HAVE_SETEGID +int setegid(int egid); +#endif + #include #include time_t tm2time (struct tm tm, int local); @@ -168,6 +177,10 @@ void mini_inetd (int port); #include /* Misc definitions for old syslogs */ +#ifndef HAVE_VSYSLOG +void vsyslog(int pri, const char *fmt, va_list ap); +#endif + #ifndef LOG_DAEMON #define openlog(id,option,facility) openlog((id),(option)) #endif diff --git a/lib/roken/setegid.c b/lib/roken/setegid.c index 92b64e113..a0c1e554a 100644 --- a/lib/roken/setegid.c +++ b/lib/roken/setegid.c @@ -41,6 +41,10 @@ RCSID("$Id$"); #endif +#include + +#include "roken.h" + int setegid(int egid) { diff --git a/lib/roken/seteuid.c b/lib/roken/seteuid.c index e14458939..28811800d 100644 --- a/lib/roken/seteuid.c +++ b/lib/roken/seteuid.c @@ -41,6 +41,10 @@ RCSID("$Id$"); #endif +#include + +#include "roken.h" + int seteuid(int euid) {