diff options
author | 1996-09-15 09:30:42 +0000 | |
---|---|---|
committer | 1996-09-15 09:30:42 +0000 | |
commit | c8f91e0d750eb1dd5aa79a93a20a522c47067c28 (patch) | |
tree | 151e2a572b80f59c243874a0738c218470cf1bc0 /lib/libc/stdlib | |
parent | print debugging flags in usage(); idea from freebsd (diff) | |
download | wireguard-openbsd-c8f91e0d750eb1dd5aa79a93a20a522c47067c28.tar.xz wireguard-openbsd-c8f91e0d750eb1dd5aa79a93a20a522c47067c28.zip |
Remove dead code
Remove unused variables
Silence some warnings
lint(1) is your friend
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 4 | ||||
-rw-r--r-- | lib/libc/stdlib/merge.c | 6 | ||||
-rw-r--r-- | lib/libc/stdlib/random.c | 5 | ||||
-rw-r--r-- | lib/libc/stdlib/system.c | 6 |
4 files changed, 11 insertions, 10 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index bdae6f00a32..54a802b0c95 100644 --- a/lib/libc/stdlib/malloc.c +++ b/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<<k; /* If there are no more free, remove from free-list */ diff --git a/lib/libc/stdlib/merge.c b/lib/libc/stdlib/merge.c index 8c73cd238b4..0a1015ad9dd 100644 --- a/lib/libc/stdlib/merge.c +++ b/lib/libc/stdlib/merge.c @@ -35,7 +35,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: merge.c,v 1.2 1996/08/19 08:33:38 tholo Exp $"; +static char *rcsid = "$OpenBSD: merge.c,v 1.3 1996/09/15 09:31:50 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -147,7 +147,7 @@ mergesort(base, nmemb, size, cmp) sense = 0; } if (!big) { /* here i = 0 */ -LINEAR: while ((b += size) < t && cmp(q, b) >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/lib/libc/stdlib/random.c b/lib/libc/stdlib/random.c index de7cc3cf440..46b67b5ec76 100644 --- a/lib/libc/stdlib/random.c +++ b/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 <stdio.h> @@ -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/lib/libc/stdlib/system.c b/lib/libc/stdlib/system.c index 91f98888af0..3e1b047393f 100644 --- a/lib/libc/stdlib/system.c +++ b/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 <sys/types.h> @@ -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 */ |