diff options
author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-07-12 18:57:58 +0000 |
---|---|---|
committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-07-12 18:57:58 +0000 |
commit | 51295a4d3e4c551df85249433c490208dc7fd23d (patch) | |
tree | c116431af8e1f042b25e0f70c63c437cf7ff8d63 /lib/libc | |
parent | af7a29993083b1562f01c87bb774fbe4fc3579e7 (diff) |
General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
Notes
Notes:
svn path=/head/; revision=17141
Diffstat (limited to 'lib/libc')
76 files changed, 383 insertions, 321 deletions
diff --git a/lib/libc/amd64/gen/isinf.c b/lib/libc/amd64/gen/isinf.c index c32844933fbe..a121edaa3b56 100644 --- a/lib/libc/amd64/gen/isinf.c +++ b/lib/libc/amd64/gen/isinf.c @@ -30,15 +30,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: isinf.c,v 1.2 1995/01/23 01:27:00 davidg Exp $ */ #if defined(LIBC_RCS) && !defined(lint) -static const char rcsid[] = "$Id$"; +static const char rcsid[] = "$Id: isinf.c,v 1.2 1995/01/23 01:27:00 davidg Exp $"; #endif /* LIBC_RCS and not lint */ #include <sys/types.h> +int isnan(d) double d; { @@ -52,6 +53,7 @@ isnan(d) return(p->exp == 2047 && (p->manh || p->manl)); } +int isinf(d) double d; { diff --git a/lib/libc/compat-43/creat.c b/lib/libc/compat-43/creat.c index 31d60b8f8cf1..a4f123423f3b 100644 --- a/lib/libc/compat-43/creat.c +++ b/lib/libc/compat-43/creat.c @@ -37,6 +37,7 @@ static char sccsid[] = "@(#)creat.c 8.1 (Berkeley) 6/2/93"; #include <fcntl.h> +int #if __STDC__ creat(const char *path, mode_t mode) #else diff --git a/lib/libc/compat-43/getwd.c b/lib/libc/compat-43/getwd.c index f105150e2466..9f0e63369d97 100644 --- a/lib/libc/compat-43/getwd.c +++ b/lib/libc/compat-43/getwd.c @@ -47,7 +47,7 @@ getwd(buf) { char *p; - if (p = getcwd(buf, MAXPATHLEN)) + if ( (p = getcwd(buf, MAXPATHLEN)) ) return(p); (void)strcpy(buf, strerror(errno)); return((char *)NULL); diff --git a/lib/libc/compat-43/killpg.c b/lib/libc/compat-43/killpg.c index f9b790151cfd..ac3ba6e57530 100644 --- a/lib/libc/compat-43/killpg.c +++ b/lib/libc/compat-43/killpg.c @@ -42,6 +42,7 @@ static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93"; /* * Backwards-compatible killpg(). */ +int #if __STDC__ killpg(pid_t pgid, int sig) #else diff --git a/lib/libc/compat-43/setpgrp.c b/lib/libc/compat-43/setpgrp.c index df63ebd12626..dc0dd3fcb5b1 100644 --- a/lib/libc/compat-43/setpgrp.c +++ b/lib/libc/compat-43/setpgrp.c @@ -38,6 +38,7 @@ static char sccsid[] = "@(#)setpgrp.c 8.1 (Berkeley) 6/2/93"; #include <sys/types.h> #include <unistd.h> +int #if __STDC__ setpgrp(pid_t pid, pid_t pgid) #else diff --git a/lib/libc/compat-43/sigcompat.c b/lib/libc/compat-43/sigcompat.c index 69b18709228c..56550d223bf7 100644 --- a/lib/libc/compat-43/sigcompat.c +++ b/lib/libc/compat-43/sigcompat.c @@ -38,6 +38,7 @@ static char sccsid[] = "@(#)sigcompat.c 8.1 (Berkeley) 6/2/93"; #include <sys/param.h> #include <signal.h> +int sigvec(signo, sv, osv) int signo; struct sigvec *sv, *osv; @@ -52,6 +53,7 @@ sigvec(signo, sv, osv) return (ret); } +int sigsetmask(mask) int mask; { @@ -63,6 +65,7 @@ sigsetmask(mask) return (omask); } +int sigblock(mask) int mask; { @@ -74,6 +77,7 @@ sigblock(mask) return (omask); } +int sigpause(mask) int mask; { diff --git a/lib/libc/db/btree/bt_open.c b/lib/libc/db/btree/bt_open.c index f052249777d6..5fc316872dd5 100644 --- a/lib/libc/db/btree/bt_open.c +++ b/lib/libc/db/btree/bt_open.c @@ -125,7 +125,7 @@ __bt_open(fname, flags, mode, openinfo, dflags) */ if (b.psize && (b.psize < MINPSIZE || b.psize > MAX_PAGE_OFFSET + 1 || - b.psize & sizeof(indx_t) - 1)) + b.psize & (sizeof(indx_t) - 1) )) goto einval; /* Minimum number of keys per page; absolute minimum is 2. */ @@ -245,7 +245,7 @@ __bt_open(fname, flags, mode, openinfo, dflags) if (m.magic != BTREEMAGIC || m.version != BTREEVERSION) goto eftype; if (m.psize < MINPSIZE || m.psize > MAX_PAGE_OFFSET + 1 || - m.psize & sizeof(indx_t) - 1) + m.psize & (sizeof(indx_t) - 1) ) goto eftype; if (m.flags & ~SAVEMETA) goto eftype; @@ -278,8 +278,8 @@ __bt_open(fname, flags, mode, openinfo, dflags) t->bt_psize = b.psize; /* Set the cache size; must be a multiple of the page size. */ - if (b.cachesize && b.cachesize & b.psize - 1) - b.cachesize += (~b.cachesize & b.psize - 1) + 1; + if (b.cachesize && b.cachesize & (b.psize - 1) ) + b.cachesize += (~b.cachesize & (b.psize - 1) ) + 1; if (b.cachesize < b.psize * MINCACHE) b.cachesize = b.psize * MINCACHE; diff --git a/lib/libc/db/hash/hash.c b/lib/libc/db/hash/hash.c index 68176e404ff4..7d000dc97c6f 100644 --- a/lib/libc/db/hash/hash.c +++ b/lib/libc/db/hash/hash.c @@ -875,7 +875,7 @@ hash_realloc(p_ptr, oldsize, newsize) { register void *p; - if (p = malloc(newsize)) { + if ( (p = malloc(newsize)) ) { memmove(p, *p_ptr, oldsize); memset((char *)p + oldsize, 0, newsize - oldsize); free(*p_ptr); diff --git a/lib/libc/db/hash/hash_bigkey.c b/lib/libc/db/hash/hash_bigkey.c index 578314a6455e..0cee07e1072c 100644 --- a/lib/libc/db/hash/hash_bigkey.c +++ b/lib/libc/db/hash/hash_bigkey.c @@ -590,7 +590,7 @@ __big_split(hashp, op, np, big_keyp, addr, obucket, ret) return (-1); change = (__call_hash(hashp, key.data, key.size) != obucket); - if (ret->next_addr = __find_last_page(hashp, &big_keyp)) { + if ( (ret->next_addr = __find_last_page(hashp, &big_keyp)) ) { if (!(ret->nextp = __get_buf(hashp, ret->next_addr, big_keyp, 0))) return (-1);; diff --git a/lib/libc/gen/closedir.c b/lib/libc/gen/closedir.c index 3a4fc9de8bd2..6c46e70167fd 100644 --- a/lib/libc/gen/closedir.c +++ b/lib/libc/gen/closedir.c @@ -40,6 +40,8 @@ static char sccsid[] = "@(#)closedir.c 8.1 (Berkeley) 6/10/93"; #include <stdlib.h> #include <unistd.h> +extern void _reclaim_telldir __P(( const DIR * )); + /* * close a directory. */ diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c index 6af8868cd71b..b62ae63e6fd0 100644 --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -105,7 +105,7 @@ execl(name, arg, va_alist) #else va_start(ap); #endif - if (argv = buildargv(ap, arg, NULL)) + if ( (argv = buildargv(ap, arg, NULL)) ) (void)execve(name, argv, environ); va_end(ap); sverrno = errno; @@ -133,7 +133,7 @@ execle(name, arg, va_alist) #else va_start(ap); #endif - if (argv = buildargv(ap, arg, &envp)) + if ( (argv = buildargv(ap, arg, &envp)) ) (void)execve(name, argv, envp); va_end(ap); sverrno = errno; @@ -161,7 +161,7 @@ execlp(name, arg, va_alist) #else va_start(ap); #endif - if (argv = buildargv(ap, arg, NULL)) + if ( (argv = buildargv(ap, arg, NULL)) ) (void)execvp(name, argv); va_end(ap); sverrno = errno; @@ -204,7 +204,7 @@ execvp(name, argv) cur = path = strdup(path); eacces = etxtbsy = 0; - while (p = strsep(&cur, ":")) { + while ( (p = strsep(&cur, ":")) ) { /* * It's a SHELL path -- double, leading and trailing colons * mean the current directory. diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c index 0c2ca13d16d6..96cd341f14d0 100644 --- a/lib/libc/gen/fnmatch.c +++ b/lib/libc/gen/fnmatch.c @@ -147,7 +147,7 @@ rangematch(pattern, test, flags) * consistency with the regular expression syntax. * J.T. Conklin (conklin@ngai.kaleida.com) */ - if (negate = (*pattern == '!' || *pattern == '^')) + if ( (negate = (*pattern == '!' || *pattern == '^')) ) ++pattern; for (ok = 0; (c = *pattern++) != ']';) { diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c index 3915b008b953..8de23dfaa4f2 100644 --- a/lib/libc/gen/fts-compat.c +++ b/lib/libc/gen/fts-compat.c @@ -56,7 +56,7 @@ static int fts_palloc __P((FTS *, size_t)); static FTSENT *fts_sort __P((FTS *, FTSENT *, int)); static u_short fts_stat __P((FTS *, FTSENT *, int)); -#define ISDOT(a) (a[0] == '.' && (!a[1] || a[1] == '.' && !a[2])) +#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])) ) #define ISSET(opt) (sp->fts_options & opt) #define SET(opt) (sp->fts_options |= opt) @@ -304,7 +304,7 @@ fts_read(sp) if (p->fts_info == FTS_D) { /* If skipped or crossed mount point, do post-order visit. */ if (instr == FTS_SKIP || - ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) { + (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) ) { if (p->fts_flags & FTS_SYMFOLLOW) (void)close(p->fts_symfd); if (sp->fts_child) { @@ -354,7 +354,7 @@ fts_read(sp) /* Move to the next node on this level. */ next: tmp = p; - if (p = p->fts_link) { + if ( (p = p->fts_link) ) { free(tmp); /* @@ -640,7 +640,7 @@ fts_build(sp, type) /* Read the directory, attaching each entry to the `link' pointer. */ adjaddr = NULL; - for (head = tail = NULL, nitems = 0; dp = readdir(dirp);) { + for (head = tail = NULL, nitems = 0; (dp = readdir(dirp)); ) { if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name)) continue; @@ -680,8 +680,8 @@ mem1: saved_errno = errno; p->fts_accpath = cur->fts_accpath; } else if (nlinks == 0 #ifdef DT_DIR - || nlinks > 0 && - dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN + || (nlinks > 0 && + dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN) #endif ) { p->fts_accpath = @@ -909,7 +909,7 @@ fts_lfree(head) register FTSENT *p; /* Free a linked list of structures. */ - while (p = head) { + while ( (p = head) ) { head = head->fts_link; free(p); } diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c index 3915b008b953..8de23dfaa4f2 100644 --- a/lib/libc/gen/fts.c +++ b/lib/libc/gen/fts.c @@ -56,7 +56,7 @@ static int fts_palloc __P((FTS *, size_t)); static FTSENT *fts_sort __P((FTS *, FTSENT *, int)); static u_short fts_stat __P((FTS *, FTSENT *, int)); -#define ISDOT(a) (a[0] == '.' && (!a[1] || a[1] == '.' && !a[2])) +#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])) ) #define ISSET(opt) (sp->fts_options & opt) #define SET(opt) (sp->fts_options |= opt) @@ -304,7 +304,7 @@ fts_read(sp) if (p->fts_info == FTS_D) { /* If skipped or crossed mount point, do post-order visit. */ if (instr == FTS_SKIP || - ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) { + (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) ) { if (p->fts_flags & FTS_SYMFOLLOW) (void)close(p->fts_symfd); if (sp->fts_child) { @@ -354,7 +354,7 @@ fts_read(sp) /* Move to the next node on this level. */ next: tmp = p; - if (p = p->fts_link) { + if ( (p = p->fts_link) ) { free(tmp); /* @@ -640,7 +640,7 @@ fts_build(sp, type) /* Read the directory, attaching each entry to the `link' pointer. */ adjaddr = NULL; - for (head = tail = NULL, nitems = 0; dp = readdir(dirp);) { + for (head = tail = NULL, nitems = 0; (dp = readdir(dirp)); ) { if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name)) continue; @@ -680,8 +680,8 @@ mem1: saved_errno = errno; p->fts_accpath = cur->fts_accpath; } else if (nlinks == 0 #ifdef DT_DIR - || nlinks > 0 && - dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN + || (nlinks > 0 && + dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN) #endif ) { p->fts_accpath = @@ -909,7 +909,7 @@ fts_lfree(head) register FTSENT *p; /* Free a linked list of structures. */ - while (p = head) { + while ( (p = head) ) { head = head->fts_link; free(p); } diff --git a/lib/libc/gen/getcwd.c b/lib/libc/gen/getcwd.c index fbd445d7dcca..d3f58140c2e2 100644 --- a/lib/libc/gen/getcwd.c +++ b/lib/libc/gen/getcwd.c @@ -47,7 +47,7 @@ static char sccsid[] = "@(#)getcwd.c 8.1 (Berkeley) 6/4/93"; #define ISDOT(dp) \ (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \ - dp->d_name[1] == '.' && dp->d_name[2] == '\0')) + (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) char * getcwd(pt, size) diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c index c65e1fa6eb9a..702828e67a2e 100644 --- a/lib/libc/gen/getgrouplist.c +++ b/lib/libc/gen/getgrouplist.c @@ -68,7 +68,7 @@ getgrouplist(uname, agroup, groups, grpcnt) * Scan the group file to find additional groups. */ setgrent(); - while (grp = getgrent()) { + while ( (grp = getgrent()) ) { for (i = 0; i < ngroups; i++) { if (grp->gr_gid == groups[i]) goto skip; diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c index 9b9d0d98db12..69d2d94d7b2b 100644 --- a/lib/libc/gen/getnetgrent.c +++ b/lib/libc/gen/getnetgrent.c @@ -280,7 +280,7 @@ int len; { char *ptr = list; - while (ptr = strstr(ptr, group)) { + while ( (ptr = strstr(ptr, group)) ) { ptr += strlen(group); @@ -317,7 +317,7 @@ int *rotation; */ int innetgr(group, host, user, dom) - char *group, *host, *user, *dom; + const char *group, *host, *user, *dom; { char *hst, *usr, *dm; #ifdef YP diff --git a/lib/libc/gen/getpass.c b/lib/libc/gen/getpass.c index 658f5b6d6ab3..b053d34eba5c 100644 --- a/lib/libc/gen/getpass.c +++ b/lib/libc/gen/getpass.c @@ -83,7 +83,6 @@ getpass(prompt) register int ch; register char *p; FILE *outfp; - long omask; static char buf[_PASSWORD_LEN + 1]; /* diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 3dd7afbda1fb..18314586f241 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -49,6 +49,10 @@ static char sccsid[] = "@(#)getpwent.c 8.1 (Berkeley) 6/4/93"; #include <limits.h> #include <grp.h> +extern void setnetgrent __P(( char * )); +extern int getnetgrent __P(( char **, char **, char ** )); +extern int innetgr __P(( const char *, const char *, const char *, const char * )); + static struct passwd _pw_passwd; /* password structure */ static DB *_pw_db; /* password database */ static int _pw_keynum; /* key counter */ @@ -237,7 +241,7 @@ endpwent() #endif } -static +static int __initdb() { static int warned; @@ -273,7 +277,7 @@ __initdb() return(0); } -static +static int __hashpw(key) DBT *key; { @@ -289,7 +293,7 @@ __hashpw(key) return(0); t = line; -#define EXPAND(e) e = t; while (*t++ = *p++); +#define EXPAND(e) e = t; while ( (*t++ = *p++) ); EXPAND(_pw_passwd.pw_name); EXPAND(_pw_passwd.pw_passwd); bcopy(p, (char *)&_pw_passwd.pw_uid, sizeof(int)); diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c index 83f97e8b96e5..267101505638 100644 --- a/lib/libc/gen/getttyent.c +++ b/lib/libc/gen/getttyent.c @@ -50,7 +50,7 @@ getttynam(tty) register struct ttyent *t; setttyent(); - while (t = getttyent()) + while ( (t = getttyent()) ) if (!strcmp(tty, t->ty_name)) break; endttyent(); @@ -120,7 +120,7 @@ getttyent() tty.ty_comment = p; if (*p == 0) tty.ty_comment = 0; - if (p = index(p, '\n')) + if ( (p = index(p, '\n')) ) *p = '\0'; return (&tty); } @@ -180,7 +180,7 @@ setttyent() if (tf) { rewind(tf); return (1); - } else if (tf = fopen(_PATH_TTYS, "r")) + } else if ( (tf = fopen(_PATH_TTYS, "r")) ) return (1); return (0); } diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c index da64187d1c2d..b1ddd866e08c 100644 --- a/lib/libc/gen/initgroups.c +++ b/lib/libc/gen/initgroups.c @@ -39,6 +39,7 @@ static char sccsid[] = "@(#)initgroups.c 8.1 (Berkeley) 6/4/93"; #include <stdio.h> #include <err.h> +#include <unistd.h> int initgroups(uname, agroup) diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c index cbece1889383..72924520d0bc 100644 --- a/lib/libc/gen/nlist.c +++ b/lib/libc/gen/nlist.c @@ -46,6 +46,8 @@ static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93"; #include <string.h> #include <unistd.h> +int __fdnlist __P(( int, struct nlist * )); + int nlist(name, list) const char *name; diff --git a/lib/libc/gen/popen.c b/lib/libc/gen/popen.c index 0b8bda554ca9..0d280461c1fb 100644 --- a/lib/libc/gen/popen.c +++ b/lib/libc/gen/popen.c @@ -64,7 +64,7 @@ popen(program, type) FILE *iop; int pdes[2], pid; - if (*type != 'r' && *type != 'w' || type[1]) + if ( (*type != 'r' && *type != 'w') || type[1]) return (NULL); if ((cur = malloc(sizeof(struct pid))) == NULL) diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c index 05773bd7e105..a4328aeafea8 100644 --- a/lib/libc/gen/pwcache.c +++ b/lib/libc/gen/pwcache.c @@ -44,7 +44,7 @@ static char sccsid[] = "@(#)pwcache.c 8.1 (Berkeley) 6/4/93"; #include <utmp.h> #define NCACHE 64 /* power of 2 */ -#define MASK NCACHE - 1 /* bits to store with */ +#define MASK (NCACHE - 1) /* bits to store with */ char * user_from_uid(uid, nouser) diff --git a/lib/libc/gen/raise.c b/lib/libc/gen/raise.c index 75ecaa1cd16e..2562c8188826 100644 --- a/lib/libc/gen/raise.c +++ b/lib/libc/gen/raise.c @@ -38,6 +38,7 @@ static char sccsid[] = "@(#)raise.c 8.1 (Berkeley) 6/4/93"; #include <signal.h> #include <unistd.h> +int raise(s) int s; { diff --git a/lib/libc/gen/rewinddir.c b/lib/libc/gen/rewinddir.c index b46bcf3e1429..2076dddea4be 100644 --- a/lib/libc/gen/rewinddir.c +++ b/lib/libc/gen/rewinddir.c @@ -38,6 +38,8 @@ static char sccsid[] = "@(#)rewinddir.c 8.1 (Berkeley) 6/8/93"; #include <sys/types.h> #include <dirent.h> +extern void _seekdir __P(( DIR *, long )); + void rewinddir(dirp) DIR *dirp; diff --git a/lib/libc/gen/seekdir.c b/lib/libc/gen/seekdir.c index 48b46461ac88..1934bcc38a8e 100644 --- a/lib/libc/gen/seekdir.c +++ b/lib/libc/gen/seekdir.c @@ -38,6 +38,8 @@ static char sccsid[] = "@(#)seekdir.c 8.1 (Berkeley) 6/4/93"; #include <sys/param.h> #include <dirent.h> +extern void _seekdir __P(( DIR *, long )); + /* * Seek to an entry in a directory. * _seekdir is in telldir.c so that it can share opaque data structures. diff --git a/lib/libc/gen/setproctitle.c b/lib/libc/gen/setproctitle.c index 08efa993a68b..1f9f4b51ac7f 100644 --- a/lib/libc/gen/setproctitle.c +++ b/lib/libc/gen/setproctitle.c @@ -14,7 +14,7 @@ * 3. Absolutely no warranty of function or purpose is made by the author * Peter Wemm. * - * $Id: setproctitle.c,v 1.1 1995/12/26 22:50:08 peter Exp $ + * $Id: setproctitle.c,v 1.2 1996/02/24 14:37:29 peter Exp $ */ #include <sys/types.h> @@ -67,7 +67,6 @@ setproctitle(fmt, va_alist) va_dcl #endif { - char *p; static char buf[SPT_BUFSIZE]; static char *ps_argv[2]; va_list ap; diff --git a/lib/libc/gen/siginterrupt.c b/lib/libc/gen/siginterrupt.c index 3105d13fe29c..06960abe4b7b 100644 --- a/lib/libc/gen/siginterrupt.c +++ b/lib/libc/gen/siginterrupt.c @@ -41,6 +41,7 @@ static char sccsid[] = "@(#)siginterrupt.c 8.1 (Berkeley) 6/4/93"; * Set signal state to prevent restart of system calls * after an instance of the indicated signal. */ +int siginterrupt(sig, flag) int sig, flag; { diff --git a/lib/libc/gen/sigsetops.c b/lib/libc/gen/sigsetops.c index e6acb77cb85a..c3bd8701ef6c 100644 --- a/lib/libc/gen/sigsetops.c +++ b/lib/libc/gen/sigsetops.c @@ -45,6 +45,7 @@ static char sccsid[] = "@(#)sigsetops.c 8.1 (Berkeley) 6/4/93"; #undef sigdelset #undef sigismember +int sigemptyset(set) sigset_t *set; { @@ -52,6 +53,7 @@ sigemptyset(set) return (0); } +int sigfillset(set) sigset_t *set; { @@ -59,6 +61,7 @@ sigfillset(set) return (0); } +int sigaddset(set, signo) sigset_t *set; int signo; @@ -67,6 +70,7 @@ sigaddset(set, signo) return (0); } +int sigdelset(set, signo) sigset_t *set; int signo; @@ -75,6 +79,7 @@ sigdelset(set, signo) return (0); } +int sigismember(set, signo) const sigset_t *set; int signo; diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c index 1949332ee58b..a355eb2ca9de 100644 --- a/lib/libc/gen/syslog.c +++ b/lib/libc/gen/syslog.c @@ -36,7 +36,7 @@ static char sccsid[] = "From: @(#)syslog.c 8.4 (Berkeley) 3/18/94"; */ static const char rcsid[] = - "$Id: syslog.c,v 1.7 1995/10/22 14:37:08 phk Exp $"; + "$Id: syslog.c,v 1.8 1996/03/02 19:56:16 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -202,7 +202,7 @@ vsyslog(pri, fmt, ap) } /* Substitute error message for %m. */ - for ( ; ch = *fmt; ++fmt) + for ( ; (ch = *fmt); ++fmt) if (ch == '%' && fmt[1] == 'm') { ++fmt; fputs(strerror(saved_errno), fmt_fp); diff --git a/lib/libc/gen/timezone.c b/lib/libc/gen/timezone.c index 370493b38779..fe3ce23dfb44 100644 --- a/lib/libc/gen/timezone.c +++ b/lib/libc/gen/timezone.c @@ -62,8 +62,8 @@ timezone(zone, dst) register char *beg, *end; - if (beg = getenv("TZNAME")) { /* set in environment */ - if (end = index(beg, ',')) { /* "PST,PDT" */ + if ( (beg = getenv("TZNAME")) ) { /* set in environment */ + if ( (end = index(beg, ',')) ) {/* "PST,PDT" */ if (dst) return(++end); *end = '\0'; @@ -82,22 +82,22 @@ static struct zone { char *stdzone; char *dlzone; } zonetab[] = { - -1*60, "MET", "MET DST", /* Middle European */ - -2*60, "EET", "EET DST", /* Eastern European */ - 4*60, "AST", "ADT", /* Atlantic */ - 5*60, "EST", "EDT", /* Eastern */ - 6*60, "CST", "CDT", /* Central */ - 7*60, "MST", "MDT", /* Mountain */ - 8*60, "PST", "PDT", /* Pacific */ + {-1*60, "MET", "MET DST"}, /* Middle European */ + {-2*60, "EET", "EET DST"}, /* Eastern European */ + {4*60, "AST", "ADT"}, /* Atlantic */ + {5*60, "EST", "EDT"}, /* Eastern */ + {6*60, "CST", "CDT"}, /* Central */ + {7*60, "MST", "MDT"}, /* Mountain */ + {8*60, "PST", "PDT"}, /* Pacific */ #ifdef notdef /* there's no way to distinguish this from WET */ - 0, "GMT", 0, /* Greenwich */ + {0, "GMT", 0}, /* Greenwich */ #endif - 0*60, "WET", "WET DST", /* Western European */ - -10*60, "EST", "EST", /* Aust: Eastern */ - -10*60+30, "CST", "CST", /* Aust: Central */ - -8*60, "WST", 0, /* Aust: Western */ - -1 + {0*60, "WET", "WET DST"}, /* Western European */ + {-10*60,"EST", "EST"}, /* Aust: Eastern */ + {-10*60+30,"CST", "CST"}, /* Aust: Central */ + {-8*60, "WST", 0}, /* Aust: Western */ + {-1} }; /* diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c index 39c640ee5eae..7ec542942fa9 100644 --- a/lib/libc/gen/ttyname.c +++ b/lib/libc/gen/ttyname.c @@ -177,7 +177,7 @@ ttyname(fd) if (fstat(fd, &sb) || !S_ISCHR(sb.st_mode)) return (NULL); - if (db = dbopen(_PATH_DEVDB, O_RDONLY, 0, DB_HASH, NULL)) { + if ( (db = dbopen(_PATH_DEVDB, O_RDONLY, 0, DB_HASH, NULL)) ) { memset(&bkey, 0, sizeof(bkey)); bkey.type = S_IFCHR; bkey.dev = sb.st_rdev; @@ -206,7 +206,7 @@ oldttyname(fd, sb) if ((dp = opendir(_PATH_DEV)) == NULL) return (NULL); - while (dirp = readdir(dp)) { + while ( (dirp = readdir(dp)) ) { if (dirp->d_fileno != sb->st_ino) continue; bcopy(dirp->d_name, buf + sizeof(_PATH_DEV) - 1, diff --git a/lib/libc/gen/ttyslot.c b/lib/libc/gen/ttyslot.c index 066f2f9f855b..2f72ebbcc8e6 100644 --- a/lib/libc/gen/ttyslot.c +++ b/lib/libc/gen/ttyslot.c @@ -51,12 +51,12 @@ ttyslot() setttyent(); for (cnt = 0; cnt < 3; ++cnt) - if (name = ttyname(cnt)) { - if (p = rindex(name, '/')) + if ( (name = ttyname(cnt)) ) { + if ( (p = rindex(name, '/')) ) ++p; else p = name; - for (slot = 1; ttyp = getttyent(); ++slot) + for (slot = 1; (ttyp = getttyent()); ++slot) if (!strcmp(ttyp->ty_name, p)) { endttyent(); return(slot); diff --git a/lib/libc/gen/unvis.c b/lib/libc/gen/unvis.c index ebeb771b235a..32405dfa3ff3 100644 --- a/lib/libc/gen/unvis.c +++ b/lib/libc/gen/unvis.c @@ -224,7 +224,7 @@ strunvis(dst, src) char *start = dst; int state = 0; - while (c = *src++) { + while ( (c = *src++) ) { again: switch (unvis(dst, c, &state, 0)) { case UNVIS_VALID: diff --git a/lib/libc/gen/vis.c b/lib/libc/gen/vis.c index 66954e7cd57e..61aa836cd111 100644 --- a/lib/libc/gen/vis.c +++ b/lib/libc/gen/vis.c @@ -159,7 +159,7 @@ strvis(dst, src, flag) register char c; char *start; - for (start = dst; c = *src;) + for (start = dst; (c = *src); ) dst = vis(dst, c, flag, *++src); *dst = '\0'; return (dst - start); diff --git a/lib/libc/i386/gen/isinf.c b/lib/libc/i386/gen/isinf.c index c32844933fbe..a121edaa3b56 100644 --- a/lib/libc/i386/gen/isinf.c +++ b/lib/libc/i386/gen/isinf.c @@ -30,15 +30,16 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: isinf.c,v 1.2 1995/01/23 01:27:00 davidg Exp $ */ #if defined(LIBC_RCS) && !defined(lint) -static const char rcsid[] = "$Id$"; +static const char rcsid[] = "$Id: isinf.c,v 1.2 1995/01/23 01:27:00 davidg Exp $"; #endif /* LIBC_RCS and not lint */ #include <sys/types.h> +int isnan(d) double d; { @@ -52,6 +53,7 @@ isnan(d) return(p->exp == 2047 && (p->manh || p->manl)); } +int isinf(d) double d; { diff --git a/lib/libc/net/ether_addr.c b/lib/libc/net/ether_addr.c index 934a76bcbc34..2d2101dfe5cd 100644 --- a/lib/libc/net/ether_addr.c +++ b/lib/libc/net/ether_addr.c @@ -35,7 +35,7 @@ * Center for Telecommunications Research * Columbia University, New York City * - * $Id: ether_addr.c,v 1.2 1995/08/07 03:42:14 wpaul Exp $ + * $Id: ether_addr.c,v 1.3 1996/03/16 21:25:59 wpaul Exp $ */ @@ -90,11 +90,20 @@ struct ether_addr *ether_aton(a) { int i; static struct ether_addr o; + unsigned int o0, o1, o2, o3, o4, o5; + + i = sscanf(a, "%x:%x:%x:%x:%x:%x", &o0, &o1, &o2, &o3, &o4, &o5); - i = sscanf(a, "%x:%x:%x:%x:%x:%x", o.octet[0], o.octet[1], o.octet[2], - o.octet[3], o.octet[4], o.octet[5]); if (i != 6) return (NULL); + + o.octet[0]=o0; + o.octet[1]=o1; + o.octet[2]=o2; + o.octet[3]=o3; + o.octet[4]=o4; + o.octet[5]=o5; + return ((struct ether_addr *)&o); } diff --git a/lib/libc/net/gethostbydns.c b/lib/libc/net/gethostbydns.c index 46213f817f94..e7e09abe7bfc 100644 --- a/lib/libc/net/gethostbydns.c +++ b/lib/libc/net/gethostbydns.c @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: gethostbydns.c,v 1.7 1995/10/22 14:39:02 phk Exp $"; +static char rcsid[] = "$Id: gethostbydns.c,v 1.8 1996/01/13 09:03:40 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -73,6 +73,8 @@ static char rcsid[] = "$Id: gethostbydns.c,v 1.7 1995/10/22 14:39:02 phk Exp $"; #include "res_config.h" +extern void _res_close __P((void)); + #define MAXALIASES 35 #define MAXADDRS 35 @@ -85,8 +87,6 @@ static struct hostent host; static char *host_aliases[MAXALIASES]; static char hostbuf[8*1024]; static struct in_addr host_addr; -static FILE *hostf = NULL; -static int stayopen = 0; #ifdef RESOLVSORT static void addrsort __P((char **, int)); diff --git a/lib/libc/net/gethostbyht.c b/lib/libc/net/gethostbyht.c index 9f1fa4c7acc2..a4b220301a26 100644 --- a/lib/libc/net/gethostbyht.c +++ b/lib/libc/net/gethostbyht.c @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: gethostbyht.c,v 1.2 1995/05/30 05:40:44 rgrimes Exp $"; +static char rcsid[] = "$Id: gethostbyht.c,v 1.3 1996/01/13 09:03:45 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -135,7 +135,7 @@ again: cp++; host.h_name = cp; q = host.h_aliases = host_aliases; - if (cp = strpbrk(cp, " \t")) + if ( (cp = strpbrk(cp, " \t")) ) *cp++ = '\0'; while (cp && *cp) { if (*cp == ' ' || *cp == '\t') { @@ -144,7 +144,7 @@ again: } if (q < &host_aliases[MAXALIASES - 1]) *q++ = cp; - if (cp = strpbrk(cp, " \t")) + if ( (cp = strpbrk(cp, " \t")) ) *cp++ = '\0'; } *q = NULL; @@ -160,7 +160,7 @@ _gethostbyhtname(name) register char **cp; sethostent(0); - while (p = gethostent()) { + while ( (p = gethostent()) ) { if (strcasecmp(p->h_name, name) == 0) break; for (cp = p->h_aliases; *cp != 0; cp++) @@ -180,7 +180,7 @@ _gethostbyhtaddr(addr, len, type) register struct hostent *p; sethostent(0); - while (p = gethostent()) + while ( (p = gethostent()) ) if (p->h_addrtype == type && !bcmp(p->h_addr, addr, len)) break; endhostent(); diff --git a/lib/libc/net/gethostbynis.c b/lib/libc/net/gethostbynis.c index f01f1052f36e..2f012b8e257f 100644 --- a/lib/libc/net/gethostbynis.c +++ b/lib/libc/net/gethostbynis.c @@ -24,8 +24,8 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $"; -static char rcsid[] = "$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $"; +static char sccsid[] = "@(#)$Id: gethostbynis.c,v 1.2 1996/03/16 21:25:58 wpaul Exp $"; +static char rcsid[] = "$Id: gethostbynis.c,v 1.2 1996/03/16 21:25:58 wpaul Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -34,6 +34,7 @@ static char rcsid[] = "$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $"; #include <arpa/inet.h> #include <netdb.h> #include <stdio.h> +#include <stdlib.h> #include <ctype.h> #include <errno.h> #include <string.h> diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c index 54f78d01fa82..fff18cbe81bb 100644 --- a/lib/libc/net/gethostnamadr.c +++ b/lib/libc/net/gethostnamadr.c @@ -24,8 +24,8 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $"; -static char rcsid[] = "$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $"; +static char sccsid[] = "@(#)$Id: gethostnamadr.c,v 1.7 1995/05/30 05:40:45 rgrimes Exp $"; +static char rcsid[] = "$Id: gethostnamadr.c,v 1.7 1995/05/30 05:40:45 rgrimes Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -38,6 +38,11 @@ static char rcsid[] = "$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $ #include <errno.h> #include <string.h> +extern void _sethosthtent __P(( int )); +extern void _endhosthtent __P(( void )); +extern void _sethostdnsent __P(( int )); +extern void _endhostdnsent __P(( void )); + extern struct hostent * _gethostbyhtname __P((const char *)); extern struct hostent * _gethostbydnsname __P((const char *)); extern struct hostent * _gethostbynisname __P((const char *)); diff --git a/lib/libc/net/getnetbydns.c b/lib/libc/net/getnetbydns.c index 4464fedf4991..14fe5d69777f 100644 --- a/lib/libc/net/getnetbydns.c +++ b/lib/libc/net/getnetbydns.c @@ -60,7 +60,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: getnetbydns.c,v 1.4 1995/10/22 14:39:04 phk Exp $"; +static char rcsid[] = "$Id: getnetbydns.c,v 1.5 1996/01/13 09:03:51 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -80,6 +80,7 @@ static char rcsid[] = "$Id: getnetbydns.c,v 1.4 1995/10/22 14:39:04 phk Exp $"; #include "res_config.h" +extern void _res_close __P((void)); extern int h_errno; #define BYADDR 0 diff --git a/lib/libc/net/getnetbyht.c b/lib/libc/net/getnetbyht.c index 24ca2ed11805..a9707dfce272 100644 --- a/lib/libc/net/getnetbyht.c +++ b/lib/libc/net/getnetbyht.c @@ -141,7 +141,7 @@ _getnetbyhtname(name) register char **cp; setnetent(_net_stayopen); - while (p = getnetent()) { + while ( (p = getnetent()) ) { if (strcasecmp(p->n_name, name) == 0) break; for (cp = p->n_aliases; *cp != 0; cp++) @@ -162,7 +162,7 @@ _getnetbyhtaddr(net, type) register struct netent *p; setnetent(_net_stayopen); - while (p = getnetent()) + while ( (p = getnetent()) ) if (p->n_addrtype == type && p->n_net == net) break; if (!_net_stayopen) diff --git a/lib/libc/net/getnetnamadr.c b/lib/libc/net/getnetnamadr.c index 5d99c8f9c9d8..b522d75c0deb 100644 --- a/lib/libc/net/getnetnamadr.c +++ b/lib/libc/net/getnetnamadr.c @@ -24,8 +24,8 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char sccsid[] = "@(#)$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $"; -static char rcsid[] = "$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $"; +static char sccsid[] = "@(#)$Id: getnetnamadr.c,v 1.4 1995/05/30 05:40:48 rgrimes Exp $"; +static char rcsid[] = "$Id: getnetnamadr.c,v 1.4 1995/05/30 05:40:48 rgrimes Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -38,6 +38,13 @@ static char rcsid[] = "$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $" #include <errno.h> #include <string.h> +extern void _setnetent __P(( int )); +extern void _endnetent __P(( void )); +extern void _setnethtent __P(( int )); +extern void _endnethtent __P(( void )); +extern void _setnetdnsent __P(( int )); +extern void _endnetdnsent __P(( void )); + extern struct netent * _getnetbyhtname __P((const char *)); extern struct netent * _getnetbydnsname __P((const char *)); extern struct netent * _getnetbynisname __P((const char *)); diff --git a/lib/libc/net/getproto.c b/lib/libc/net/getproto.c index 92f562bebfa9..46f46d38e18a 100644 --- a/lib/libc/net/getproto.c +++ b/lib/libc/net/getproto.c @@ -46,7 +46,7 @@ getprotobynumber(proto) register struct protoent *p; setprotoent(_proto_stayopen); - while (p = getprotoent()) + while ( (p = getprotoent()) ) if (p->p_proto == proto) break; if (!_proto_stayopen) diff --git a/lib/libc/net/getprotoname.c b/lib/libc/net/getprotoname.c index 3ee6754bb362..0832acf08a86 100644 --- a/lib/libc/net/getprotoname.c +++ b/lib/libc/net/getprotoname.c @@ -48,7 +48,7 @@ getprotobyname(name) register char **cp; setprotoent(_proto_stayopen); - while (p = getprotoent()) { + while ( (p = getprotoent()) ) { if (strcmp(p->p_name, name) == 0) break; for (cp = p->p_aliases; *cp != 0; cp++) diff --git a/lib/libc/net/getservbyname.c b/lib/libc/net/getservbyname.c index fcff7cf6b7ee..124f5ac18173 100644 --- a/lib/libc/net/getservbyname.c +++ b/lib/libc/net/getservbyname.c @@ -56,7 +56,7 @@ getservbyname(name, proto) #endif setservent(_serv_stayopen); - while (p = getservent()) { + while ( (p = getservent()) ) { if (strcmp(name, p->s_name) == 0) goto gotname; for (cp = p->s_aliases; *cp; cp++) diff --git a/lib/libc/net/getservbyport.c b/lib/libc/net/getservbyport.c index a24f8df64132..ef9a2e858a4d 100644 --- a/lib/libc/net/getservbyport.c +++ b/lib/libc/net/getservbyport.c @@ -56,7 +56,7 @@ getservbyport(port, proto) #endif setservent(_serv_stayopen); - while (p = getservent()) { + while ( (p = getservent()) ) { if (p->s_port != port) continue; if (proto == 0 || strcmp(p->s_proto, proto) == 0) diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c index 6797b5afec98..d28f40c4f0da 100644 --- a/lib/libc/net/getservent.c +++ b/lib/libc/net/getservent.c @@ -48,6 +48,8 @@ static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93"; static int serv_stepping_yp = 0; #endif +extern int _yp_check __P(( char ** )); + #define MAXALIASES 35 static FILE *servf = NULL; diff --git a/lib/libc/net/inet_network.c b/lib/libc/net/inet_network.c index c3a96a64e54e..6da2e8bc4d61 100644 --- a/lib/libc/net/inet_network.c +++ b/lib/libc/net/inet_network.c @@ -60,7 +60,7 @@ again: base = 8, cp++; if (*cp == 'x' || *cp == 'X') base = 16, cp++; - while (c = *cp) { + while ( (c = *cp) ) { if (isdigit(c)) { val = (val * base) + (c - '0'); cp++; diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index 3d6c64914da1..7e396c094cdb 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -57,6 +57,8 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94"; #include <rpcsvc/ypclnt.h> #endif +extern int innetgr __P(( const char *, const char *, const char *, const char * )); + #define max(a, b) ((a > b) ? a : b) int __ivaliduser __P((FILE *, u_long, const char *, const char *)); diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c index fbe5e95b28a6..523aa1956821 100644 --- a/lib/libc/net/res_comp.c +++ b/lib/libc/net/res_comp.c @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: res_comp.c,v 1.3 1995/05/30 05:40:54 rgrimes Exp $"; +static char rcsid[] = "$Id: res_comp.c,v 1.4 1996/01/07 09:14:54 peter Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -95,7 +95,7 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length) /* * fetch next label in domain name */ - while (n = *cp++) { + while ( (n = *cp++) ) { /* * Check for indirection */ @@ -298,7 +298,7 @@ dn_find(exp_dn, msg, dnptrs, lastdnptr) for (cpp = dnptrs; cpp < lastdnptr; cpp++) { dn = exp_dn; sp = cp = *cpp; - while (n = *cp++) { + while ( (n = *cp++) ) { /* * check for indirection */ diff --git a/lib/libc/net/res_debug.c b/lib/libc/net/res_debug.c index fdcb1b8f99be..ad65fc7728aa 100644 --- a/lib/libc/net/res_debug.c +++ b/lib/libc/net/res_debug.c @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: res_debug.c,v 1.6 1996/01/07 09:14:55 peter Exp $"; +static char rcsid[] = "$Id: res_debug.c,v 1.7 1996/02/06 20:35:48 wollman Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -171,7 +171,7 @@ do_rrset(msg, len, cp, cnt, pflag, file, hs) * Print answer records. */ sflag = (_res.pfcode & pflag); - if (n = ntohs(cnt)) { + if ( (n = ntohs(cnt)) ) { if ((!_res.pfcode) || ((sflag) && (_res.pfcode & RES_PRF_HEAD1))) fprintf(file, hs); @@ -286,7 +286,7 @@ __fp_nquery(msg, len, file) /* * Print question records. */ - if (n = ntohs(hp->qdcount)) { + if ( (n = ntohs(hp->qdcount)) ) { if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES)) fprintf(file, ";; QUESTIONS:\n"); while (--n >= 0) { @@ -490,7 +490,7 @@ __p_rr(cp, msg, file) case T_HINFO: case T_ISDN: cp2 = cp + dlen; - if (n = *cp++) { + if ( (n = *cp++) ) { fprintf(file, "\t%.*s", n, cp); cp += n; } @@ -549,7 +549,7 @@ __p_rr(cp, msg, file) (void) fputs("\t\"", file); cp2 = cp1 + dlen; while (cp < cp2) { - if (n = (unsigned char) *cp++) { + if ( (n = (unsigned char) *cp++) ) { for (c = n; c > 0 && cp < cp2; c--) if ((*cp == '\n') || (*cp == '"')) { (void) putc('\\', file); diff --git a/lib/libc/net/res_send.c b/lib/libc/net/res_send.c index 88df3055a61a..eb1b321f3fff 100644 --- a/lib/libc/net/res_send.c +++ b/lib/libc/net/res_send.c @@ -53,7 +53,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93"; -static char rcsid[] = "$Id: res_send.c,v 1.6 1995/08/21 09:15:40 bde Exp $"; +static char rcsid[] = "$Id: res_send.c,v 1.7 1996/01/07 09:15:02 peter Exp $"; #endif /* LIBC_SCCS and not lint */ /* change this to "0" @@ -716,7 +716,7 @@ res_send(buf, buflen, ans, anssiz) * This routine is not expected to be user visible. */ void -_res_close() +_res_close(void) { if (s >= 0) { (void) close(s); diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c index 8df18aea5259..1110810dea0a 100644 --- a/lib/libc/nls/msgcat.c +++ b/lib/libc/nls/msgcat.c @@ -1,4 +1,4 @@ -/* $Id: msgcat.c,v 1.3 1995/06/17 03:02:21 ache Exp $ */ +/* $Id: msgcat.c,v 1.4 1995/10/22 14:39:22 phk Exp $ */ /*********************************************************** Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts. @@ -312,13 +312,13 @@ int type; if (strncmp(header.magic, MCMagic, MCMagicLen) != 0) CORRUPT(); if (header.majorVer != MCMajorVer) { - fprintf(stderr, "%s: %s is version %d, we need %d.\n", ERRNAME, + fprintf(stderr, "%s: %s is version %ld, we need %ld.\n", ERRNAME, catpath, header.majorVer, MCMajorVer); return(0); } if (header.numSets <= 0) { - fprintf(stderr, "%s: %s has %d sets!\n", ERRNAME, catpath, + fprintf(stderr, "%s: %s has %ld sets!\n", ERRNAME, catpath, header.numSets); return(0); } diff --git a/lib/libc/nls/msgcat.h b/lib/libc/nls/msgcat.h index 4fabb591529b..354ca1e35b8f 100644 --- a/lib/libc/nls/msgcat.h +++ b/lib/libc/nls/msgcat.h @@ -1,4 +1,4 @@ -/* $Id: msgcat.h,v 1.1 1995/03/30 12:47:27 jkh Exp $ */ +/* $Id: msgcat.h,v 1.2 1995/05/30 05:41:00 rgrimes Exp $ */ /* -*-c++-*- */ @@ -66,7 +66,7 @@ up-to-date. Many thanks. #define MCLastMsg 0 #define MCLastSet 0 -#define MCMajorVer 1 +#define MCMajorVer 1L #define MCMinorVer 0 /* diff --git a/lib/libc/regex/cclass.h b/lib/libc/regex/cclass.h index a29a92ee9c46..cabe7faf223e 100644 --- a/lib/libc/regex/cclass.h +++ b/lib/libc/regex/cclass.h @@ -43,28 +43,28 @@ static struct cclass { char *chars; char *multis; } cclasses[] = { - "alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ -0123456789", "", - "alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", - "", - "blank", " \t", "", - "cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\ -\25\26\27\30\31\32\33\34\35\36\37\177", "", - "digit", "0123456789", "", - "graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ + {"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ +0123456789", ""}, + {"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", + ""}, + {"blank", " \t", ""}, + {"cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\ +\25\26\27\30\31\32\33\34\35\36\37\177", ""}, + {"digit", "0123456789", ""}, + {"graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ 0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - "", - "lower", "abcdefghijklmnopqrstuvwxyz", - "", - "print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ + ""}, + {"lower", "abcdefghijklmnopqrstuvwxyz", + ""}, + {"print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\ 0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ", - "", - "punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", - "", - "space", "\t\n\v\f\r ", "", - "upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - "", - "xdigit", "0123456789ABCDEFabcdef", - "", - NULL, 0, "" + ""}, + {"punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", + ""}, + {"space", "\t\n\v\f\r ", ""}, + {"upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + ""}, + {"xdigit", "0123456789ABCDEFabcdef", + ""}, + {NULL, 0, ""} }; diff --git a/lib/libc/regex/cname.h b/lib/libc/regex/cname.h index c1632ebb1f56..72bbe5ece1f0 100644 --- a/lib/libc/regex/cname.h +++ b/lib/libc/regex/cname.h @@ -42,100 +42,100 @@ static struct cname { char *name; char code; } cnames[] = { - "NUL", '\0', - "SOH", '\001', - "STX", '\002', - "ETX", '\003', - "EOT", '\004', - "ENQ", '\005', - "ACK", '\006', - "BEL", '\007', - "alert", '\007', - "BS", '\010', - "backspace", '\b', - "HT", '\011', - "tab", '\t', - "LF", '\012', - "newline", '\n', - "VT", '\013', - "vertical-tab", '\v', - "FF", '\014', - "form-feed", '\f', - "CR", '\015', - "carriage-return", '\r', - "SO", '\016', - "SI", '\017', - "DLE", '\020', - "DC1", '\021', - "DC2", '\022', - "DC3", '\023', - "DC4", '\024', - "NAK", '\025', - "SYN", '\026', - "ETB", '\027', - "CAN", '\030', - "EM", '\031', - "SUB", '\032', - "ESC", '\033', - "IS4", '\034', - "FS", '\034', - "IS3", '\035', - "GS", '\035', - "IS2", '\036', - "RS", '\036', - "IS1", '\037', - "US", '\037', - "space", ' ', - "exclamation-mark", '!', - "quotation-mark", '"', - "number-sign", '#', - "dollar-sign", '$', - "percent-sign", '%', - "ampersand", '&', - "apostrophe", '\'', - "left-parenthesis", '(', - "right-parenthesis", ')', - "asterisk", '*', - "plus-sign", '+', - "comma", ',', - "hyphen", '-', - "hyphen-minus", '-', - "period", '.', - "full-stop", '.', - "slash", '/', - "solidus", '/', - "zero", '0', - "one", '1', - "two", '2', - "three", '3', - "four", '4', - "five", '5', - "six", '6', - "seven", '7', - "eight", '8', - "nine", '9', - "colon", ':', - "semicolon", ';', - "less-than-sign", '<', - "equals-sign", '=', - "greater-than-sign", '>', - "question-mark", '?', - "commercial-at", '@', - "left-square-bracket", '[', - "backslash", '\\', - "reverse-solidus", '\\', - "right-square-bracket", ']', - "circumflex", '^', - "circumflex-accent", '^', - "underscore", '_', - "low-line", '_', - "grave-accent", '`', - "left-brace", '{', - "left-curly-bracket", '{', - "vertical-line", '|', - "right-brace", '}', - "right-curly-bracket", '}', - "tilde", '~', - "DEL", '\177', - NULL, 0, + {"NUL", '\0'}, + {"SOH", '\001'}, + {"STX", '\002'}, + {"ETX", '\003'}, + {"EOT", '\004'}, + {"ENQ", '\005'}, + {"ACK", '\006'}, + {"BEL", '\007'}, + {"alert", '\007'}, + {"BS", '\010'}, + {"backspace", '\b'}, + {"HT", '\011'}, + {"tab", '\t'}, + {"LF", '\012'}, + {"newline", '\n'}, + {"VT", '\013'}, + {"vertical-tab", '\v'}, + {"FF", '\014'}, + {"form-feed", '\f'}, + {"CR", '\015'}, + {"carriage-return", '\r'}, + {"SO", '\016'}, + {"SI", '\017'}, + {"DLE", '\020'}, + {"DC1", '\021'}, + {"DC2", '\022'}, + {"DC3", '\023'}, + {"DC4", '\024'}, + {"NAK", '\025'}, + {"SYN", '\026'}, + {"ETB", '\027'}, + {"CAN", '\030'}, + {"EM", '\031'}, + {"SUB", '\032'}, + {"ESC", '\033'}, + {"IS4", '\034'}, + {"FS", '\034'}, + {"IS3", '\035'}, + {"GS", '\035'}, + {"IS2", '\036'}, + {"RS", '\036'}, + {"IS1", '\037'}, + {"US", '\037'}, + {"space", ' '}, + {"exclamation-mark", '!'}, + {"quotation-mark", '"'}, + {"number-sign", '#'}, + {"dollar-sign", '$'}, + {"percent-sign", '%'}, + {"ampersand", '&'}, + {"apostrophe", '\''}, + {"left-parenthesis", '('}, + {"right-parenthesis", ')'}, + {"asterisk", '*'}, + {"plus-sign", '+'}, + {"comma", ','}, + {"hyphen", '-'}, + {"hyphen-minus", '-'}, + {"period", '.'}, + {"full-stop", '.'}, + {"slash", '/'}, + {"solidus", '/'}, + {"zero", '0'}, + {"one", '1'}, + {"two", '2'}, + {"three", '3'}, + {"four", '4'}, + {"five", '5'}, + {"six", '6'}, + {"seven", '7'}, + {"eight", '8'}, + {"nine", '9'}, + {"colon", ':'}, + {"semicolon", ';'}, + {"less-than-sign", '<'}, + {"equals-sign", '='}, + {"greater-than-sign", '>'}, + {"question-mark", '?'}, + {"commercial-at", '@'}, + {"left-square-bracket", '['}, + {"backslash", '\\'}, + {"reverse-solidus", '\\'}, + {"right-square-bracket",']'}, + {"circumflex", '^'}, + {"circumflex-accent", '^'}, + {"underscore", '_'}, + {"low-line", '_'}, + {"grave-accent", '`'}, + {"left-brace", '{'}, + {"left-curly-bracket", '{'}, + {"vertical-line", '|'}, + {"right-brace", '}'}, + {"right-curly-bracket", '}'}, + {"tilde", '~'}, + {"DEL", '\177'}, + {NULL, 0} }; diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c index 8b54837c7316..e7917b9f8159 100644 --- a/lib/libc/regex/engine.c +++ b/lib/libc/regex/engine.c @@ -148,8 +148,8 @@ int eflags; struct match mv; register struct match *m = &mv; register char *dp; - const register sopno gf = g->firststate+1; /* +1 for OEND */ - const register sopno gl = g->laststate; + register const sopno gf = g->firststate+1; /* +1 for OEND */ + register const sopno gl = g->laststate; char *start; char *stop; diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index 10412aada61d..f7962eae7143 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -103,9 +103,11 @@ static int freezeset __P((struct parse *p, cset *cs)); static int firstch __P((struct parse *p, cset *cs)); static int nch __P((struct parse *p, cset *cs)); static void mcadd __P((struct parse *p, cset *cs, char *cp)); +#if used static void mcsub __P((cset *cs, char *cp)); static int mcin __P((cset *cs, char *cp)); static char *mcfind __P((cset *cs, char *cp)); +#endif static void mcinvert __P((struct parse *p, cset *cs)); static void mccase __P((struct parse *p, cset *cs)); static int isinsets __P((struct re_guts *g, int c)); @@ -295,7 +297,7 @@ int stop; /* character this ERE should end at */ conc = HERE(); while (MORE() && (c = PEEK()) != '|' && c != stop) p_ere_exp(p); - REQUIRE(HERE() != conc, REG_EMPTY); /* require nonempty */ + (void)REQUIRE(HERE() != conc, REG_EMPTY); /* require nonempty */ if (!EAT('|')) break; /* NOTE BREAK OUT */ @@ -342,7 +344,7 @@ register struct parse *p; pos = HERE(); switch (c) { case '(': - REQUIRE(MORE(), REG_EPAREN); + (void)REQUIRE(MORE(), REG_EPAREN); p->g->nsub++; subno = p->g->nsub; if (subno < NPAREN) @@ -355,7 +357,7 @@ register struct parse *p; assert(p->pend[subno] != 0); } EMIT(ORPAREN, subno); - MUSTEAT(')', REG_EPAREN); + (void)MUSTEAT(')', REG_EPAREN); break; #ifndef POSIX_MISTAKE case ')': /* happens only if no current unmatched ( */ @@ -398,12 +400,12 @@ register struct parse *p; p_bracket(p); break; case '\\': - REQUIRE(MORE(), REG_EESCAPE); + (void)REQUIRE(MORE(), REG_EESCAPE); c = GETNEXT(); ordinary(p, c); break; case '{': /* okay as ordinary except if digit follows */ - REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT); + (void)REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT); /* FALLTHROUGH */ default: ordinary(p, c); @@ -419,7 +421,7 @@ register struct parse *p; return; /* no repetition, we're done */ NEXT(); - REQUIRE(!wascaret, REG_BADRPT); + (void)REQUIRE(!wascaret, REG_BADRPT); switch (c) { case '*': /* implemented as +? */ /* this case does not require the (y|) trick, noKLUDGE */ @@ -446,7 +448,7 @@ register struct parse *p; if (EAT(',')) { if (isdigit(PEEK())) { count2 = p_count(p); - REQUIRE(count <= count2, REG_BADBR); + (void)REQUIRE(count <= count2, REG_BADBR); } else /* single number with comma */ count2 = INFINITY; } else /* just a single number */ @@ -455,7 +457,7 @@ register struct parse *p; if (!EAT('}')) { /* error heuristics */ while (MORE() && PEEK() != '}') NEXT(); - REQUIRE(MORE(), REG_EBRACE); + (void)REQUIRE(MORE(), REG_EBRACE); SETERROR(REG_BADBR); } break; @@ -478,7 +480,7 @@ static void p_str(p) register struct parse *p; { - REQUIRE(MORE(), REG_EMPTY); + (void)REQUIRE(MORE(), REG_EMPTY); while (MORE()) ordinary(p, GETNEXT()); } @@ -521,7 +523,7 @@ register int end2; /* second terminating character */ p->g->neol++; } - REQUIRE(HERE() != start, REG_EMPTY); /* require nonempty */ + (void)REQUIRE(HERE() != start, REG_EMPTY); /* require nonempty */ } /* @@ -546,7 +548,7 @@ int starordinary; /* is a leading * an ordinary character? */ assert(MORE()); /* caller should have ensured this */ c = GETNEXT(); if (c == '\\') { - REQUIRE(MORE(), REG_EESCAPE); + (void)REQUIRE(MORE(), REG_EESCAPE); c = BACKSL | (unsigned char)GETNEXT(); } switch (c) { @@ -576,7 +578,7 @@ int starordinary; /* is a leading * an ordinary character? */ assert(p->pend[subno] != 0); } EMIT(ORPAREN, subno); - REQUIRE(EATTWO('\\', ')'), REG_EPAREN); + (void)REQUIRE(EATTWO('\\', ')'), REG_EPAREN); break; case BACKSL|')': /* should not get here -- must be user */ case BACKSL|'}': @@ -606,7 +608,7 @@ int starordinary; /* is a leading * an ordinary character? */ p->g->backrefs = 1; break; case '*': - REQUIRE(starordinary, REG_BADRPT); + (void)REQUIRE(starordinary, REG_BADRPT); /* FALLTHROUGH */ default: ordinary(p, c &~ BACKSL); @@ -624,7 +626,7 @@ int starordinary; /* is a leading * an ordinary character? */ if (EAT(',')) { if (MORE() && isdigit(PEEK())) { count2 = p_count(p); - REQUIRE(count <= count2, REG_BADBR); + (void)REQUIRE(count <= count2, REG_BADBR); } else /* single number with comma */ count2 = INFINITY; } else /* just a single number */ @@ -633,7 +635,7 @@ int starordinary; /* is a leading * an ordinary character? */ if (!EATTWO('\\', '}')) { /* error heuristics */ while (MORE() && !SEETWO('\\', '}')) NEXT(); - REQUIRE(MORE(), REG_EBRACE); + (void)REQUIRE(MORE(), REG_EBRACE); SETERROR(REG_BADBR); } } else if (c == (unsigned char)'$') /* $ (but not \$) ends it */ @@ -658,7 +660,7 @@ register struct parse *p; ndigits++; } - REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR); + (void)REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR); return(count); } @@ -698,7 +700,7 @@ register struct parse *p; p_b_term(p, cs); if (EAT('-')) CHadd(cs, '-'); - MUSTEAT(']', REG_EBRACK); + (void)MUSTEAT(']', REG_EBRACK); if (p->error != 0) /* don't mess things up further */ return; @@ -769,21 +771,21 @@ register cset *cs; switch (c) { case ':': /* character class */ NEXT2(); - REQUIRE(MORE(), REG_EBRACK); + (void)REQUIRE(MORE(), REG_EBRACK); c = PEEK(); - REQUIRE(c != '-' && c != ']', REG_ECTYPE); + (void)REQUIRE(c != '-' && c != ']', REG_ECTYPE); p_b_cclass(p, cs); - REQUIRE(MORE(), REG_EBRACK); - REQUIRE(EATTWO(':', ']'), REG_ECTYPE); + (void)REQUIRE(MORE(), REG_EBRACK); + (void)REQUIRE(EATTWO(':', ']'), REG_ECTYPE); break; case '=': /* equivalence class */ NEXT2(); - REQUIRE(MORE(), REG_EBRACK); + (void)REQUIRE(MORE(), REG_EBRACK); c = PEEK(); - REQUIRE(c != '-' && c != ']', REG_ECOLLATE); + (void)REQUIRE(c != '-' && c != ']', REG_ECOLLATE); p_b_eclass(p, cs); - REQUIRE(MORE(), REG_EBRACK); - REQUIRE(EATTWO('=', ']'), REG_ECOLLATE); + (void)REQUIRE(MORE(), REG_EBRACK); + (void)REQUIRE(EATTWO('=', ']'), REG_ECOLLATE); break; default: /* symbol, ordinary character, or range */ /* xxx revision needed for multichar stuff */ @@ -798,7 +800,7 @@ register cset *cs; } else finish = start; /* xxx what about signed chars here... */ - REQUIRE(start <= finish, REG_ERANGE); + (void)REQUIRE(start <= finish, REG_ERANGE); for (i = start; i <= finish; i++) CHadd(cs, i); break; @@ -866,13 +868,13 @@ register struct parse *p; { register char value; - REQUIRE(MORE(), REG_EBRACK); + (void)REQUIRE(MORE(), REG_EBRACK); if (!EATTWO('[', '.')) return(GETNEXT()); /* collating symbol */ value = p_b_coll_elem(p, '.'); - REQUIRE(EATTWO('.', ']'), REG_ECOLLATE); + (void)REQUIRE(EATTWO('.', ']'), REG_ECOLLATE); return(value); } @@ -1264,6 +1266,7 @@ register char *cp; cs->multis[cs->smultis - 1] = '\0'; } +#if used /* - mcsub - subtract a collating element from a cset == static void mcsub(register cset *cs, register char *cp); @@ -1321,6 +1324,7 @@ register char *cp; return(p); return(NULL); } +#endif /* - mcinvert - invert the list of collating elements in a cset diff --git a/lib/libc/regex/regerror.c b/lib/libc/regex/regerror.c index 212f709cf73f..1ed6771ffecc 100644 --- a/lib/libc/regex/regerror.c +++ b/lib/libc/regex/regerror.c @@ -88,23 +88,23 @@ static struct rerr { char *name; char *explain; } rerrs[] = { - REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match", - REG_BADPAT, "REG_BADPAT", "invalid regular expression", - REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element", - REG_ECTYPE, "REG_ECTYPE", "invalid character class", - REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)", - REG_ESUBREG, "REG_ESUBREG", "invalid backreference number", - REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced", - REG_EPAREN, "REG_EPAREN", "parentheses not balanced", - REG_EBRACE, "REG_EBRACE", "braces not balanced", - REG_BADBR, "REG_BADBR", "invalid repetition count(s)", - REG_ERANGE, "REG_ERANGE", "invalid character range", - REG_ESPACE, "REG_ESPACE", "out of memory", - REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid", - REG_EMPTY, "REG_EMPTY", "empty (sub)expression", - REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug", - REG_INVARG, "REG_INVARG", "invalid argument to regex routine", - 0, "", "*** unknown regexp error code ***", + {REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"}, + {REG_BADPAT, "REG_BADPAT", "invalid regular expression"}, + {REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"}, + {REG_ECTYPE, "REG_ECTYPE", "invalid character class"}, + {REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)"}, + {REG_ESUBREG, "REG_ESUBREG", "invalid backreference number"}, + {REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced"}, + {REG_EPAREN, "REG_EPAREN", "parentheses not balanced"}, + {REG_EBRACE, "REG_EBRACE", "braces not balanced"}, + {REG_BADBR, "REG_BADBR", "invalid repetition count(s)"}, + {REG_ERANGE, "REG_ERANGE", "invalid character range"}, + {REG_ESPACE, "REG_ESPACE", "out of memory"}, + {REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid"}, + {REG_EMPTY, "REG_EMPTY", "empty (sub)expression"}, + {REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"}, + {REG_INVARG, "REG_INVARG", "invalid argument to regex routine"}, + {0, "", "*** unknown regexp error code ***"} }; /* diff --git a/lib/libc/stdlib/atoi.c b/lib/libc/stdlib/atoi.c index a13c0e20ade1..48e508aef8fd 100644 --- a/lib/libc/stdlib/atoi.c +++ b/lib/libc/stdlib/atoi.c @@ -38,6 +38,7 @@ static char sccsid[] = "@(#)atoi.c 8.1 (Berkeley) 6/4/93"; #include <stdlib.h> #include <stddef.h> +int atoi(str) const char *str; { diff --git a/lib/libc/stdlib/calloc.c b/lib/libc/stdlib/calloc.c index d7c8e0732416..7a836030d5b0 100644 --- a/lib/libc/stdlib/calloc.c +++ b/lib/libc/stdlib/calloc.c @@ -46,7 +46,7 @@ calloc(num, size) register void *p; size *= num; - if (p = malloc(size)) + if ( (p = malloc(size)) ) bzero(p, size); return(p); } diff --git a/lib/libc/stdlib/getsubopt.c b/lib/libc/stdlib/getsubopt.c index afd577ad933a..bc055b881fa7 100644 --- a/lib/libc/stdlib/getsubopt.c +++ b/lib/libc/stdlib/getsubopt.c @@ -46,6 +46,7 @@ static char sccsid[] = "@(#)getsubopt.c 8.1 (Berkeley) 6/4/93"; */ char *suboptarg; +int getsubopt(optionp, tokens, valuep) register char **optionp, **valuep; register char * const *tokens; diff --git a/lib/libc/stdlib/setenv.c b/lib/libc/stdlib/setenv.c index 4a28f25ef93e..d9812771e700 100644 --- a/lib/libc/stdlib/setenv.c +++ b/lib/libc/stdlib/setenv.c @@ -46,6 +46,7 @@ char *__findenv __P((const char *, int *)); * Set the value of the environmental variable "name" to be * "value". If rewrite is set, replace any current value. */ +int setenv(name, value, rewrite) register const char *name; register const char *value; @@ -63,7 +64,7 @@ setenv(name, value, rewrite) if (!rewrite) return (0); if (strlen(c) >= l_value) { /* old larger; copy over */ - while (*c++ = *value++); + while ( (*c++ = *value++) ); return (0); } } else { /* create new slot */ @@ -93,7 +94,7 @@ setenv(name, value, rewrite) malloc((size_t)((int)(c - name) + l_value + 2)))) return (-1); for (c = environ[offset]; (*c = *name++) && *c != '='; ++c); - for (*c++ = '='; *c++ = *value++;); + for (*c++ = '='; (*c++ = *value++); ); return (0); } diff --git a/lib/libc/stdlib/strtod.c b/lib/libc/stdlib/strtod.c index 0ccd6fd3419b..27fb49985f94 100644 --- a/lib/libc/stdlib/strtod.c +++ b/lib/libc/stdlib/strtod.c @@ -382,7 +382,7 @@ Balloc int x; Bigint *rv; - if (rv = freelist[k]) { + if ( (rv = freelist[k]) ) { freelist[k] = rv->next; } else { x = 1 << k; @@ -628,7 +628,7 @@ mult xc0 = c->x; #ifdef Pack_32 for (; xb < xbe; xb++, xc0++) { - if (y = *xb & 0xffff) { + if ( (y = *xb & 0xffff) ) { x = xa; xc = xc0; carry = 0; @@ -641,7 +641,7 @@ mult } while (x < xae); *xc = carry; } - if (y = *xb >> 16) { + if ( (y = *xb >> 16) ) { x = xa; xc = xc0; carry = 0; @@ -690,7 +690,7 @@ pow5mult int i; static int p05[3] = { 5, 25, 125 }; - if (i = k & 3) + if ( (i = k & 3) ) b = multadd(b, p05[i-1], 0); if (!(k >>= 2)) @@ -752,7 +752,7 @@ lshift *x1++ = *x << k | z; z = *x++ >> k1; } while (x < xe); - if (*x1 = z) + if ( (*x1 = z) ) ++n1; } #else @@ -918,7 +918,7 @@ ulp } else { word0(a) = 0; L -= Exp_shift; - word1(a) = L >= 31 ? 1 : 1 << 31 - L; + word1(a) = L >= 31 ? 1 : 1 << (31 - L); } } #endif @@ -953,16 +953,16 @@ b2d *e = 32 - k; #ifdef Pack_32 if (k < Ebits) { - d0 = Exp_1 | y >> Ebits - k; + d0 = Exp_1 | (y >> (Ebits - k)); w = xa > xa0 ? *--xa : 0; - d1 = y << (32-Ebits) + k | w >> Ebits - k; + d1 = (y << ((32-Ebits) + k)) | (w >> (Ebits - k)); goto ret_d; } z = xa > xa0 ? *--xa : 0; if (k -= Ebits) { - d0 = Exp_1 | y << k | z >> 32 - k; + d0 = Exp_1 | (y << k) | (z >> (32 - k)); y = xa > xa0 ? *--xa : 0; - d1 = z << k | y >> 32 - k; + d1 = (z << k) | (y >> (32 - k)); } else { d0 = Exp_1 | y; d1 = z; @@ -1029,13 +1029,13 @@ d2b z |= Exp_msk11; #endif #else - if (de = (int)(d0 >> Exp_shift)) + if ( (de = (int)(d0 >> Exp_shift)) ) z |= Exp_msk1; #endif #ifdef Pack_32 - if (y = d1) { - if (k = lo0bits(&y)) { - x[0] = y | z << 32 - k; + if ( (y = d1) ) { + if ( (k = lo0bits(&y)) ) { + x[0] = y | (z << (32 - k)); z >>= k; } else @@ -1371,9 +1371,9 @@ strtod /* Get starting approximation = rv * 10**e1 */ if (e1 > 0) { - if (i = e1 & 15) + if ( (i = e1 & 15) ) rv *= tens[i]; - if (e1 &= ~15) { + if ( (e1 &= ~15) ) { if (e1 > DBL_MAX_10_EXP) { ovfl: errno = ERANGE; @@ -1413,9 +1413,9 @@ strtod } } else if (e1 < 0) { e1 = -e1; - if (i = e1 & 15) + if ( (i = e1 & 15) ) rv /= tens[i]; - if (e1 &= ~15) { + if ( (e1 &= ~15) ) { e1 >>= 4; for (j = 0; e1 > 1; j++, e1 >>= 1) if (e1 & 1) @@ -1946,13 +1946,13 @@ __dtoa #ifdef Sudden_Underflow i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)); #else - if (i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1))) { + if ( (i = (int)((word0(d) >> Exp_shift1) & (Exp_mask>>Exp_shift1))) ) { #endif d2 = d; word0(d2) &= Frac_mask1; word0(d2) |= Exp_11; #ifdef IBM - if (j = 11 - hi0bits(word0(d2) & Frac_mask)) + if ( (j = 11 - hi0bits(word0(d2) & Frac_mask)) ) d2 /= 1 << j; #endif @@ -1989,8 +1989,8 @@ __dtoa /* d is denormalized */ i = bbits + be + (Bias + (P-1) - 1); - x = i > 32 ? word0(d) << 64 - i | word1(d) >> i - 32 - : word1(d) << 32 - i; + x = i > 32 ? ((word0(d) << (64 - i)) | (word1(d) >> (i - 32))) + : (word1(d) << (32 - i)); d2 = x; word0(d2) -= 31*Exp_msk1; /* adjust exponent */ i -= (Bias + (P-1) - 1) + 1; @@ -2087,7 +2087,7 @@ __dtoa ds *= bigtens[i]; } d /= ds; - } else if (j1 = -k) { + } else if ( (j1 = -k) ) { d *= tens[j1 & 0xf]; for (j = j1 >> 4; j; j >>= 1, i++) if (j & 1) { @@ -2186,7 +2186,7 @@ __dtoa *s++ = '0' + (int)L; if (i == ilim) { d += d; - if (d > ds || d == ds && L & 1) { + if (d > ds || (d == ds && L & 1)) { bump_up: while (*--s == '9') if (s == s0) { @@ -2250,7 +2250,7 @@ __dtoa Bfree(b); b = b1; } - if (j = b5 - m5) + if ( (j = b5 - m5) ) b = pow5mult(b, j); } else b = pow5mult(b, b5); @@ -2283,10 +2283,10 @@ __dtoa * can do shifts and ors to compute the numerator for q. */ #ifdef Pack_32 - if (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f) + if ( (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f) ) i = 32 - i; #else - if (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf) + if ( (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf) ) i = 16 - i; #endif if (i > 4) { @@ -2359,15 +2359,15 @@ __dtoa goto ret; } #endif - if (j < 0 || j == 0 && !mode + if (j < 0 || (j == 0 && !mode #ifndef ROUND_BIASED && !(word1(d) & 1) #endif - ) { + )) { if (j1 > 0) { b = lshift(b, 1); j1 = cmp(b, S); - if ((j1 > 0 || j1 == 0 && dig & 1) + if ((j1 > 0 || (j1 == 0 && dig & 1)) && dig++ == '9') goto round_9_up; } @@ -2406,7 +2406,7 @@ __dtoa b = lshift(b, 1); j = cmp(b, S); - if (j > 0 || j == 0 && dig & 1) { + if (j > 0 || (j == 0 && dig & 1)) { roundoff: while (*--s == '9') if (s == s0) { diff --git a/lib/libc/stdlib/strtol.c b/lib/libc/stdlib/strtol.c index 3e6ec70d26d9..18e39729929f 100644 --- a/lib/libc/stdlib/strtol.c +++ b/lib/libc/stdlib/strtol.c @@ -112,7 +112,7 @@ strtol(nptr, endptr, base) break; if (c >= base) break; - if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1; diff --git a/lib/libc/stdlib/strtoll.c b/lib/libc/stdlib/strtoll.c index a5720df447d4..26667496f32d 100644 --- a/lib/libc/stdlib/strtoll.c +++ b/lib/libc/stdlib/strtoll.c @@ -119,7 +119,7 @@ strtoq(nptr, endptr, base) break; if (c >= base) break; - if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1; diff --git a/lib/libc/stdlib/strtoq.c b/lib/libc/stdlib/strtoq.c index a5720df447d4..26667496f32d 100644 --- a/lib/libc/stdlib/strtoq.c +++ b/lib/libc/stdlib/strtoq.c @@ -119,7 +119,7 @@ strtoq(nptr, endptr, base) break; if (c >= base) break; - if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1; diff --git a/lib/libc/stdlib/strtoul.c b/lib/libc/stdlib/strtoul.c index 0bf6b82ef085..304150a546a4 100644 --- a/lib/libc/stdlib/strtoul.c +++ b/lib/libc/stdlib/strtoul.c @@ -90,7 +90,7 @@ strtoul(nptr, endptr, base) break; if (c >= base) break; - if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1; diff --git a/lib/libc/stdlib/strtoull.c b/lib/libc/stdlib/strtoull.c index 16dda0be3971..7656a3c53b14 100644 --- a/lib/libc/stdlib/strtoull.c +++ b/lib/libc/stdlib/strtoull.c @@ -97,7 +97,7 @@ strtouq(nptr, endptr, base) break; if (c >= base) break; - if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1; diff --git a/lib/libc/stdlib/strtouq.c b/lib/libc/stdlib/strtouq.c index 16dda0be3971..7656a3c53b14 100644 --- a/lib/libc/stdlib/strtouq.c +++ b/lib/libc/stdlib/strtouq.c @@ -97,7 +97,7 @@ strtouq(nptr, endptr, base) break; if (c >= base) break; - if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim) + if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim)) any = -1; else { any = 1; diff --git a/lib/libc/stdtime/strftime.c b/lib/libc/stdtime/strftime.c index 21f275683413..5e272be23b7d 100644 --- a/lib/libc/stdtime/strftime.c +++ b/lib/libc/stdtime/strftime.c @@ -17,7 +17,7 @@ #ifdef LIBC_RCS static const char rcsid[] = - "$Id: strftime.c,v 1.7 1996/05/27 04:10:27 scrappy Exp $"; + "$Id: strftime.c,v 1.8 1996/05/27 06:54:01 scrappy Exp $"; #endif #ifndef lint @@ -60,7 +60,6 @@ struct lc_time_T { }; static struct lc_time_T localebuf; -static struct lc_time_T * _loc P((void)); static int using_locale; #define Locale (using_locale ? &localebuf : &C_time_locale) diff --git a/lib/libc/string/strcoll.c b/lib/libc/string/strcoll.c index c8fff23f74ec..405a78bf5a21 100644 --- a/lib/libc/string/strcoll.c +++ b/lib/libc/string/strcoll.c @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: strcoll.c,v 1.4 1995/04/16 22:43:45 ache Exp $ + * $Id: strcoll.c,v 1.5 1996/06/09 14:56:06 ache Exp $ */ #include <stdlib.h> @@ -51,8 +51,8 @@ strcoll(s, s2) return (-1); else if (islower(*us1) && isupper(*us2)) return (1); - *us1++; - *us2++; + us1++; + us2++; } return (tolower(*us1) - tolower(*us2)); } diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c index 955439460ea1..72f57e9217a7 100644 --- a/lib/libc/yp/yplib.c +++ b/lib/libc/yp/yplib.c @@ -28,7 +28,7 @@ */ #ifndef LINT -static char *rcsid = "$Id: yplib.c,v 1.21 1996/06/03 13:19:10 jraynard Exp $"; +static char *rcsid = "$Id: yplib.c,v 1.22 1996/06/04 17:35:15 jraynard Exp $"; #endif #include <sys/param.h> @@ -217,7 +217,7 @@ _yp_dobind(dom, ypdb) struct ypbind_resp ypbr; struct timeval tv; struct sockaddr_in clnt_sin; - int clnt_sock, lfd, fd; + int clnt_sock, fd; pid_t gpid; CLIENT *client; int new = 0, r; |