From c3e8d031d343819028d4512cfa33136d84604d32 Mon Sep 17 00:00:00 2001 From: tholo <> Date: Sun, 15 Sep 1996 09:31:53 +0000 Subject: [PATCH] Remove dead code Remove unused variables Silence some warnings lint(1) is your friend --- src/lib/libc/crypt/md5crypt.c | 3 ++- 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 ++-- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/lib/libc/crypt/md5crypt.c b/src/lib/libc/crypt/md5crypt.c index 0efd81c3..3e3c681c 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/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index bdae6f00..54a802b0 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 de7cc3cf..46b67b5e 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 91f98888..3e1b0473 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 c27cb849..619bebf2 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