From 27b62657a94b21845fcea14320c285cb5b1a2800 Mon Sep 17 00:00:00 2001 From: tholo <> Date: Sun, 15 Sep 1996 09:31:53 +0000 Subject: Remove dead code Remove unused variables Silence some warnings lint(1) is your friend --- src/lib/libc/crypt/md5crypt.c | 3 ++- src/lib/libc/net/rcmdsh.c | 14 ++++++++------ src/lib/libc/net/res_debug.c | 4 ++-- src/lib/libc/net/res_init.c | 5 ++--- src/lib/libc/net/res_mkquery.c | 5 ++++- src/lib/libc/stdlib/malloc.c | 4 ++-- src/lib/libc/stdlib/merge.c | 6 +++--- src/lib/libc/stdlib/random.c | 5 ++--- src/lib/libc/stdlib/system.c | 6 ++++-- src/lib/libc/string/__strerror.c | 4 ++-- 10 files changed, 31 insertions(+), 25 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libc/crypt/md5crypt.c b/src/lib/libc/crypt/md5crypt.c index 0efd81c36e..3e3c681c8e 100644 --- a/src/lib/libc/crypt/md5crypt.c +++ b/src/lib/libc/crypt/md5crypt.c @@ -9,11 +9,12 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.4 1996/08/19 08:19:50 tholo Exp $"; +static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.5 1996/09/15 09:30:46 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include #include +#include #include static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ diff --git a/src/lib/libc/net/rcmdsh.c b/src/lib/libc/net/rcmdsh.c index fe49a5a21b..39338c2c74 100644 --- a/src/lib/libc/net/rcmdsh.c +++ b/src/lib/libc/net/rcmdsh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcmdsh.c,v 1.2 1996/09/01 20:28:22 millert Exp $ */ +/* $OpenBSD: rcmdsh.c,v 1.3 1996/09/15 09:31:17 tholo Exp $ */ /* * This is an rcmd() replacement originally by @@ -6,7 +6,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.2 1996/09/01 20:28:22 millert Exp $"; +static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.3 1996/09/15 09:31:17 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -19,17 +19,19 @@ static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.2 1996/09/01 20:28:22 millert Exp $ #include #include #include +#include /* * This is a replacement rcmd() function that uses the rsh(1) * program in place of a direct rcmd(3) function call so as to * avoid having to be root. Note that rport is ignored. */ +/* ARGSUSED */ int rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) char **ahost; - u_short rport; - char *locuser, *remuser, *cmd; + int rport; + const char *locuser, *remuser, *cmd; char *rshprog; { struct hostent *hp; @@ -109,12 +111,12 @@ rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) (void) fprintf(stderr, "rcmdsh: execlp %s failed: %s\n", rshprog, strerror(errno)); _exit(255); - } else if (cpid > 0) { + } else { /* Parent. close sp[1], return sp[0]. */ (void) close(sp[1]); /* Reap child. */ (void) wait(NULL); return(sp[0]); } - /*NOTREACHED*/ + /* NOTREACHED */ } diff --git a/src/lib/libc/net/res_debug.c b/src/lib/libc/net/res_debug.c index e8fc192c51..ae6c030a1f 100644 --- a/src/lib/libc/net/res_debug.c +++ b/src/lib/libc/net/res_debug.c @@ -52,7 +52,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: res_debug.c,v 1.3 1996/08/19 08:29:44 tholo Exp $"; +static char rcsid[] = "$OpenBSD: res_debug.c,v 1.4 1996/09/15 09:31:18 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -601,7 +601,7 @@ __p_rr(cp, msg, file) case T_UINFO: putc('\t', file); - fputs(cp, file); + fputs((char *) cp, file); cp += dlen; break; diff --git a/src/lib/libc/net/res_init.c b/src/lib/libc/net/res_init.c index cb60d4c0df..355c9ce1b0 100644 --- a/src/lib/libc/net/res_init.c +++ b/src/lib/libc/net/res_init.c @@ -52,7 +52,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: res_init.c,v 1.6 1996/08/27 03:32:53 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: res_init.c,v 1.7 1996/09/15 09:31:19 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -112,8 +112,6 @@ res_init() int haveenv = 0; int havesearch = 0; int nsort = 0; - int dots; - u_long mask; _res.nsaddr.sin_len = sizeof(struct sockaddr_in); _res.nsaddr.sin_family = AF_INET; @@ -344,6 +342,7 @@ res_init() return (0); } +/* ARGSUSED */ static void res_setoptions(options, source) char *options, *source; diff --git a/src/lib/libc/net/res_mkquery.c b/src/lib/libc/net/res_mkquery.c index 90ffb9966a..02b64e9886 100644 --- a/src/lib/libc/net/res_mkquery.c +++ b/src/lib/libc/net/res_mkquery.c @@ -52,7 +52,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.3 1996/08/19 08:29:47 tholo Exp $"; +static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.4 1996/09/15 09:31:20 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -66,6 +66,7 @@ static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.3 1996/08/19 08:29:47 tholo E * Form all types of queries. * Returns the size of the result or -1. */ +/* ARGSUSED */ int res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) int op; /* opcode of query */ @@ -80,7 +81,9 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) register HEADER *hp; register u_char *cp; register int n; +#ifdef ALLOW_UPDATES struct rrec *newrr = (struct rrec *) newrr_in; +#endif /* ALLOW_UPDATES */ u_char *dnptrs[10], **dpp, **lastdnptr; #ifdef DEBUG diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index bdae6f00a3..54a802b0c9 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c @@ -8,7 +8,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: malloc.c,v 1.10 1996/09/11 03:04:43 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: malloc.c,v 1.11 1996/09/15 09:31:49 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -813,7 +813,7 @@ malloc_bytes(size) ; /* Find that bit, and tweak it */ - k = ffs(*lp) - 1; + k = ffs((unsigned)*lp) - 1; *lp ^= 1<sense) + while ((b += size) < t && cmp(q, b) >sense) if (++i == 6) { big = 1; goto EXPONENTIAL; @@ -168,7 +168,7 @@ EXPONENTIAL: for (i = size; ; i <<= 1) goto FASTCASE; } else b = p; -SLOWCASE: while (t > b+size) { + while (t > b+size) { i = (((t - b) / size) >> 1) * size; if ((*cmp)(q, p = b + i) <= sense) t = p; diff --git a/src/lib/libc/stdlib/random.c b/src/lib/libc/stdlib/random.c index de7cc3cf44..46b67b5ec7 100644 --- a/src/lib/libc/stdlib/random.c +++ b/src/lib/libc/stdlib/random.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: random.c,v 1.3 1996/08/19 08:33:46 tholo Exp $"; +static char *rcsid = "$OpenBSD: random.c,v 1.4 1996/09/15 09:31:51 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -193,13 +193,12 @@ srandom(x) u_int x; { register long int test; - register int i, j; + register int i; ldiv_t val; if (rand_type == TYPE_0) state[0] = x; else { - j = 1; state[0] = x; for (i = 1; i < rand_deg; i++) { /* diff --git a/src/lib/libc/stdlib/system.c b/src/lib/libc/stdlib/system.c index 91f98888af..3e1b047393 100644 --- a/src/lib/libc/stdlib/system.c +++ b/src/lib/libc/stdlib/system.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: system.c,v 1.2 1996/08/19 08:33:54 tholo Exp $"; +static char *rcsid = "$OpenBSD: system.c,v 1.3 1996/09/15 09:31:52 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -52,11 +52,13 @@ system(command) sig_t intsave, quitsave; int omask; int pstat; - char *argp[] = {"sh", "-c", (char *) command, NULL}; + char *argp[] = {"sh", "-c", NULL, NULL}; if (!command) /* just checking... */ return(1); + argp[2] = (char *)command; + omask = sigblock(sigmask(SIGCHLD)); switch(pid = vfork()) { case -1: /* error */ diff --git a/src/lib/libc/string/__strerror.c b/src/lib/libc/string/__strerror.c index c27cb8492b..619bebf229 100644 --- a/src/lib/libc/string/__strerror.c +++ b/src/lib/libc/string/__strerror.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: __strerror.c,v 1.3 1996/08/19 08:33:55 tholo Exp $"; +static char *rcsid = "$OpenBSD: __strerror.c,v 1.4 1996/09/15 09:31:53 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #ifdef NLS @@ -64,7 +64,7 @@ __strerror(num, buf) register unsigned int errnum; #ifdef NLS - nl_catd catd ; + nl_catd catd; catd = catopen("libc", 0); #endif -- cgit v1.2.3-55-g6feb