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 | |
| 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 'src/lib/libc')
| -rw-r--r-- | src/lib/libc/crypt/md5crypt.c | 3 | ||||
| -rw-r--r-- | src/lib/libc/net/rcmdsh.c | 14 | ||||
| -rw-r--r-- | src/lib/libc/net/res_debug.c | 4 | ||||
| -rw-r--r-- | src/lib/libc/net/res_init.c | 5 | ||||
| -rw-r--r-- | src/lib/libc/net/res_mkquery.c | 5 | ||||
| -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 | ||||
| -rw-r--r-- | src/lib/libc/string/__strerror.c | 4 | 
10 files changed, 31 insertions, 25 deletions
| 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 @@ | |||
| 9 | */ | 9 | */ | 
| 10 | 10 | ||
| 11 | #if defined(LIBC_SCCS) && !defined(lint) | 11 | #if defined(LIBC_SCCS) && !defined(lint) | 
| 12 | static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.4 1996/08/19 08:19:50 tholo Exp $"; | 12 | static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.5 1996/09/15 09:30:46 tholo Exp $"; | 
| 13 | #endif /* LIBC_SCCS and not lint */ | 13 | #endif /* LIBC_SCCS and not lint */ | 
| 14 | 14 | ||
| 15 | #include <unistd.h> | 15 | #include <unistd.h> | 
| 16 | #include <stdio.h> | 16 | #include <stdio.h> | 
| 17 | #include <string.h> | ||
| 17 | #include <md5.h> | 18 | #include <md5.h> | 
| 18 | 19 | ||
| 19 | static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ | 20 | 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 @@ | |||
| 1 | /* $OpenBSD: rcmdsh.c,v 1.2 1996/09/01 20:28:22 millert Exp $ */ | 1 | /* $OpenBSD: rcmdsh.c,v 1.3 1996/09/15 09:31:17 tholo Exp $ */ | 
| 2 | 2 | ||
| 3 | /* | 3 | /* | 
| 4 | * This is an rcmd() replacement originally by | 4 | * This is an rcmd() replacement originally by | 
| @@ -6,7 +6,7 @@ | |||
| 6 | */ | 6 | */ | 
| 7 | 7 | ||
| 8 | #if defined(LIBC_SCCS) && !defined(lint) | 8 | #if defined(LIBC_SCCS) && !defined(lint) | 
| 9 | static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.2 1996/09/01 20:28:22 millert Exp $"; | 9 | static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.3 1996/09/15 09:31:17 tholo Exp $"; | 
| 10 | #endif /* LIBC_SCCS and not lint */ | 10 | #endif /* LIBC_SCCS and not lint */ | 
| 11 | 11 | ||
| 12 | #include <sys/types.h> | 12 | #include <sys/types.h> | 
| @@ -19,17 +19,19 @@ static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.2 1996/09/01 20:28:22 millert Exp $ | |||
| 19 | #include <string.h> | 19 | #include <string.h> | 
| 20 | #include <pwd.h> | 20 | #include <pwd.h> | 
| 21 | #include <paths.h> | 21 | #include <paths.h> | 
| 22 | #include <unistd.h> | ||
| 22 | 23 | ||
| 23 | /* | 24 | /* | 
| 24 | * This is a replacement rcmd() function that uses the rsh(1) | 25 | * This is a replacement rcmd() function that uses the rsh(1) | 
| 25 | * program in place of a direct rcmd(3) function call so as to | 26 | * program in place of a direct rcmd(3) function call so as to | 
| 26 | * avoid having to be root. Note that rport is ignored. | 27 | * avoid having to be root. Note that rport is ignored. | 
| 27 | */ | 28 | */ | 
| 29 | /* ARGSUSED */ | ||
| 28 | int | 30 | int | 
| 29 | rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) | 31 | rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) | 
| 30 | char **ahost; | 32 | char **ahost; | 
| 31 | u_short rport; | 33 | int rport; | 
| 32 | char *locuser, *remuser, *cmd; | 34 | const char *locuser, *remuser, *cmd; | 
| 33 | char *rshprog; | 35 | char *rshprog; | 
| 34 | { | 36 | { | 
| 35 | struct hostent *hp; | 37 | struct hostent *hp; | 
| @@ -109,12 +111,12 @@ rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) | |||
| 109 | (void) fprintf(stderr, "rcmdsh: execlp %s failed: %s\n", | 111 | (void) fprintf(stderr, "rcmdsh: execlp %s failed: %s\n", | 
| 110 | rshprog, strerror(errno)); | 112 | rshprog, strerror(errno)); | 
| 111 | _exit(255); | 113 | _exit(255); | 
| 112 | } else if (cpid > 0) { | 114 | } else { | 
| 113 | /* Parent. close sp[1], return sp[0]. */ | 115 | /* Parent. close sp[1], return sp[0]. */ | 
| 114 | (void) close(sp[1]); | 116 | (void) close(sp[1]); | 
| 115 | /* Reap child. */ | 117 | /* Reap child. */ | 
| 116 | (void) wait(NULL); | 118 | (void) wait(NULL); | 
| 117 | return(sp[0]); | 119 | return(sp[0]); | 
| 118 | } | 120 | } | 
| 119 | /*NOTREACHED*/ | 121 | /* NOTREACHED */ | 
| 120 | } | 122 | } | 
| 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 @@ | |||
| 52 | */ | 52 | */ | 
| 53 | 53 | ||
| 54 | #if defined(LIBC_SCCS) && !defined(lint) | 54 | #if defined(LIBC_SCCS) && !defined(lint) | 
| 55 | static char rcsid[] = "$OpenBSD: res_debug.c,v 1.3 1996/08/19 08:29:44 tholo Exp $"; | 55 | static char rcsid[] = "$OpenBSD: res_debug.c,v 1.4 1996/09/15 09:31:18 tholo Exp $"; | 
| 56 | #endif /* LIBC_SCCS and not lint */ | 56 | #endif /* LIBC_SCCS and not lint */ | 
| 57 | 57 | ||
| 58 | #include <sys/param.h> | 58 | #include <sys/param.h> | 
| @@ -601,7 +601,7 @@ __p_rr(cp, msg, file) | |||
| 601 | 601 | ||
| 602 | case T_UINFO: | 602 | case T_UINFO: | 
| 603 | putc('\t', file); | 603 | putc('\t', file); | 
| 604 | fputs(cp, file); | 604 | fputs((char *) cp, file); | 
| 605 | cp += dlen; | 605 | cp += dlen; | 
| 606 | break; | 606 | break; | 
| 607 | 607 | ||
| 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 @@ | |||
| 52 | */ | 52 | */ | 
| 53 | 53 | ||
| 54 | #if defined(LIBC_SCCS) && !defined(lint) | 54 | #if defined(LIBC_SCCS) && !defined(lint) | 
| 55 | static char rcsid[] = "$OpenBSD: res_init.c,v 1.6 1996/08/27 03:32:53 deraadt Exp $"; | 55 | static char rcsid[] = "$OpenBSD: res_init.c,v 1.7 1996/09/15 09:31:19 tholo Exp $"; | 
| 56 | #endif /* LIBC_SCCS and not lint */ | 56 | #endif /* LIBC_SCCS and not lint */ | 
| 57 | 57 | ||
| 58 | #include <sys/param.h> | 58 | #include <sys/param.h> | 
| @@ -112,8 +112,6 @@ res_init() | |||
| 112 | int haveenv = 0; | 112 | int haveenv = 0; | 
| 113 | int havesearch = 0; | 113 | int havesearch = 0; | 
| 114 | int nsort = 0; | 114 | int nsort = 0; | 
| 115 | int dots; | ||
| 116 | u_long mask; | ||
| 117 | 115 | ||
| 118 | _res.nsaddr.sin_len = sizeof(struct sockaddr_in); | 116 | _res.nsaddr.sin_len = sizeof(struct sockaddr_in); | 
| 119 | _res.nsaddr.sin_family = AF_INET; | 117 | _res.nsaddr.sin_family = AF_INET; | 
| @@ -344,6 +342,7 @@ res_init() | |||
| 344 | return (0); | 342 | return (0); | 
| 345 | } | 343 | } | 
| 346 | 344 | ||
| 345 | /* ARGSUSED */ | ||
| 347 | static void | 346 | static void | 
| 348 | res_setoptions(options, source) | 347 | res_setoptions(options, source) | 
| 349 | char *options, *source; | 348 | 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 @@ | |||
| 52 | */ | 52 | */ | 
| 53 | 53 | ||
| 54 | #if defined(LIBC_SCCS) && !defined(lint) | 54 | #if defined(LIBC_SCCS) && !defined(lint) | 
| 55 | static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.3 1996/08/19 08:29:47 tholo Exp $"; | 55 | static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.4 1996/09/15 09:31:20 tholo Exp $"; | 
| 56 | #endif /* LIBC_SCCS and not lint */ | 56 | #endif /* LIBC_SCCS and not lint */ | 
| 57 | 57 | ||
| 58 | #include <sys/param.h> | 58 | #include <sys/param.h> | 
| @@ -66,6 +66,7 @@ static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.3 1996/08/19 08:29:47 tholo E | |||
| 66 | * Form all types of queries. | 66 | * Form all types of queries. | 
| 67 | * Returns the size of the result or -1. | 67 | * Returns the size of the result or -1. | 
| 68 | */ | 68 | */ | 
| 69 | /* ARGSUSED */ | ||
| 69 | int | 70 | int | 
| 70 | res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) | 71 | res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) | 
| 71 | int op; /* opcode of query */ | 72 | int op; /* opcode of query */ | 
| @@ -80,7 +81,9 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) | |||
| 80 | register HEADER *hp; | 81 | register HEADER *hp; | 
| 81 | register u_char *cp; | 82 | register u_char *cp; | 
| 82 | register int n; | 83 | register int n; | 
| 84 | #ifdef ALLOW_UPDATES | ||
| 83 | struct rrec *newrr = (struct rrec *) newrr_in; | 85 | struct rrec *newrr = (struct rrec *) newrr_in; | 
| 86 | #endif /* ALLOW_UPDATES */ | ||
| 84 | u_char *dnptrs[10], **dpp, **lastdnptr; | 87 | u_char *dnptrs[10], **dpp, **lastdnptr; | 
| 85 | 88 | ||
| 86 | #ifdef DEBUG | 89 | #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 @@ | |||
| 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 */ | 
| 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 @@ | |||
| 32 | */ | 32 | */ | 
| 33 | 33 | ||
| 34 | #if defined(LIBC_SCCS) && !defined(lint) | 34 | #if defined(LIBC_SCCS) && !defined(lint) | 
| 35 | static char *rcsid = "$OpenBSD: __strerror.c,v 1.3 1996/08/19 08:33:55 tholo Exp $"; | 35 | static char *rcsid = "$OpenBSD: __strerror.c,v 1.4 1996/09/15 09:31:53 tholo Exp $"; | 
| 36 | #endif /* LIBC_SCCS and not lint */ | 36 | #endif /* LIBC_SCCS and not lint */ | 
| 37 | 37 | ||
| 38 | #ifdef NLS | 38 | #ifdef NLS | 
| @@ -64,7 +64,7 @@ __strerror(num, buf) | |||
| 64 | register unsigned int errnum; | 64 | register unsigned int errnum; | 
| 65 | 65 | ||
| 66 | #ifdef NLS | 66 | #ifdef NLS | 
| 67 | nl_catd catd ; | 67 | nl_catd catd; | 
| 68 | catd = catopen("libc", 0); | 68 | catd = catopen("libc", 0); | 
| 69 | #endif | 69 | #endif | 
| 70 | 70 | ||
