diff options
author | tholo <> | 1996-09-15 09:31:53 +0000 |
---|---|---|
committer | tholo <> | 1996-09-15 09:31:53 +0000 |
commit | 27b62657a94b21845fcea14320c285cb5b1a2800 (patch) | |
tree | 947900ef381c1a838cf05f934ed5349615aac605 /src/lib/libc/stdlib | |
parent | 5db356f3a7b6b461177c41660da527087e8d4399 (diff) | |
download | openbsd-27b62657a94b21845fcea14320c285cb5b1a2800.tar.gz openbsd-27b62657a94b21845fcea14320c285cb5b1a2800.tar.bz2 openbsd-27b62657a94b21845fcea14320c285cb5b1a2800.zip |
Remove dead code
Remove unused variables
Silence some warnings
lint(1) is your friend
Diffstat (limited to '')
-rw-r--r-- | src/lib/libc/stdlib/malloc.c | 4 | ||||
-rw-r--r-- | src/lib/libc/stdlib/merge.c | 6 | ||||
-rw-r--r-- | src/lib/libc/stdlib/random.c | 5 | ||||
-rw-r--r-- | src/lib/libc/stdlib/system.c | 6 |
4 files changed, 11 insertions, 10 deletions
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 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #if defined(LIBC_SCCS) && !defined(lint) | 10 | #if defined(LIBC_SCCS) && !defined(lint) |
11 | static char rcsid[] = "$OpenBSD: malloc.c,v 1.10 1996/09/11 03:04:43 deraadt Exp $"; | 11 | static char rcsid[] = "$OpenBSD: malloc.c,v 1.11 1996/09/15 09:31:49 tholo Exp $"; |
12 | #endif /* LIBC_SCCS and not lint */ | 12 | #endif /* LIBC_SCCS and not lint */ |
13 | 13 | ||
14 | /* | 14 | /* |
@@ -813,7 +813,7 @@ malloc_bytes(size) | |||
813 | ; | 813 | ; |
814 | 814 | ||
815 | /* Find that bit, and tweak it */ | 815 | /* Find that bit, and tweak it */ |
816 | k = ffs(*lp) - 1; | 816 | k = ffs((unsigned)*lp) - 1; |
817 | *lp ^= 1<<k; | 817 | *lp ^= 1<<k; |
818 | 818 | ||
819 | /* If there are no more free, remove from free-list */ | 819 | /* If there are no more free, remove from free-list */ |
diff --git a/src/lib/libc/stdlib/merge.c b/src/lib/libc/stdlib/merge.c index 8c73cd238b..0a1015ad9d 100644 --- a/src/lib/libc/stdlib/merge.c +++ b/src/lib/libc/stdlib/merge.c | |||
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #if defined(LIBC_SCCS) && !defined(lint) | 37 | #if defined(LIBC_SCCS) && !defined(lint) |
38 | static char *rcsid = "$OpenBSD: merge.c,v 1.2 1996/08/19 08:33:38 tholo Exp $"; | 38 | static char *rcsid = "$OpenBSD: merge.c,v 1.3 1996/09/15 09:31:50 tholo Exp $"; |
39 | #endif /* LIBC_SCCS and not lint */ | 39 | #endif /* LIBC_SCCS and not lint */ |
40 | 40 | ||
41 | /* | 41 | /* |
@@ -147,7 +147,7 @@ mergesort(base, nmemb, size, cmp) | |||
147 | sense = 0; | 147 | sense = 0; |
148 | } | 148 | } |
149 | if (!big) { /* here i = 0 */ | 149 | if (!big) { /* here i = 0 */ |
150 | LINEAR: while ((b += size) < t && cmp(q, b) >sense) | 150 | while ((b += size) < t && cmp(q, b) >sense) |
151 | if (++i == 6) { | 151 | if (++i == 6) { |
152 | big = 1; | 152 | big = 1; |
153 | goto EXPONENTIAL; | 153 | goto EXPONENTIAL; |
@@ -168,7 +168,7 @@ EXPONENTIAL: for (i = size; ; i <<= 1) | |||
168 | goto FASTCASE; | 168 | goto FASTCASE; |
169 | } else | 169 | } else |
170 | b = p; | 170 | b = p; |
171 | SLOWCASE: while (t > b+size) { | 171 | while (t > b+size) { |
172 | i = (((t - b) / size) >> 1) * size; | 172 | i = (((t - b) / size) >> 1) * size; |
173 | if ((*cmp)(q, p = b + i) <= sense) | 173 | if ((*cmp)(q, p = b + i) <= sense) |
174 | t = p; | 174 | 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 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #if defined(LIBC_SCCS) && !defined(lint) | 34 | #if defined(LIBC_SCCS) && !defined(lint) |
35 | static char *rcsid = "$OpenBSD: random.c,v 1.3 1996/08/19 08:33:46 tholo Exp $"; | 35 | static char *rcsid = "$OpenBSD: random.c,v 1.4 1996/09/15 09:31:51 tholo Exp $"; |
36 | #endif /* LIBC_SCCS and not lint */ | 36 | #endif /* LIBC_SCCS and not lint */ |
37 | 37 | ||
38 | #include <stdio.h> | 38 | #include <stdio.h> |
@@ -193,13 +193,12 @@ srandom(x) | |||
193 | u_int x; | 193 | u_int x; |
194 | { | 194 | { |
195 | register long int test; | 195 | register long int test; |
196 | register int i, j; | 196 | register int i; |
197 | ldiv_t val; | 197 | ldiv_t val; |
198 | 198 | ||
199 | if (rand_type == TYPE_0) | 199 | if (rand_type == TYPE_0) |
200 | state[0] = x; | 200 | state[0] = x; |
201 | else { | 201 | else { |
202 | j = 1; | ||
203 | state[0] = x; | 202 | state[0] = x; |
204 | for (i = 1; i < rand_deg; i++) { | 203 | for (i = 1; i < rand_deg; i++) { |
205 | /* | 204 | /* |
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 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #if defined(LIBC_SCCS) && !defined(lint) | 34 | #if defined(LIBC_SCCS) && !defined(lint) |
35 | static char *rcsid = "$OpenBSD: system.c,v 1.2 1996/08/19 08:33:54 tholo Exp $"; | 35 | static char *rcsid = "$OpenBSD: system.c,v 1.3 1996/09/15 09:31:52 tholo Exp $"; |
36 | #endif /* LIBC_SCCS and not lint */ | 36 | #endif /* LIBC_SCCS and not lint */ |
37 | 37 | ||
38 | #include <sys/types.h> | 38 | #include <sys/types.h> |
@@ -52,11 +52,13 @@ system(command) | |||
52 | sig_t intsave, quitsave; | 52 | sig_t intsave, quitsave; |
53 | int omask; | 53 | int omask; |
54 | int pstat; | 54 | int pstat; |
55 | char *argp[] = {"sh", "-c", (char *) command, NULL}; | 55 | char *argp[] = {"sh", "-c", NULL, NULL}; |
56 | 56 | ||
57 | if (!command) /* just checking... */ | 57 | if (!command) /* just checking... */ |
58 | return(1); | 58 | return(1); |
59 | 59 | ||
60 | argp[2] = (char *)command; | ||
61 | |||
60 | omask = sigblock(sigmask(SIGCHLD)); | 62 | omask = sigblock(sigmask(SIGCHLD)); |
61 | switch(pid = vfork()) { | 63 | switch(pid = vfork()) { |
62 | case -1: /* error */ | 64 | case -1: /* error */ |