summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-07-12 18:57:58 +0000
committerjkh <jkh@FreeBSD.org>1996-07-12 18:57:58 +0000
commitc4d4a99d31762beef936f34571330923e9300da9 (patch)
treec116431af8e1f042b25e0f70c63c437cf7ff8d63 /lib/libc/gen
parent6657f01bfd009bbf4ec0481a17712259abf8ea77 (diff)
downloadFreeBSD-src-c4d4a99d31762beef936f34571330923e9300da9.zip
FreeBSD-src-c4d4a99d31762beef936f34571330923e9300da9.tar.gz
General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/closedir.c2
-rw-r--r--lib/libc/gen/exec.c8
-rw-r--r--lib/libc/gen/fnmatch.c2
-rw-r--r--lib/libc/gen/fts-compat.c14
-rw-r--r--lib/libc/gen/fts.c14
-rw-r--r--lib/libc/gen/getcwd.c2
-rw-r--r--lib/libc/gen/getgrouplist.c2
-rw-r--r--lib/libc/gen/getnetgrent.c4
-rw-r--r--lib/libc/gen/getpass.c1
-rw-r--r--lib/libc/gen/getpwent.c10
-rw-r--r--lib/libc/gen/getttyent.c6
-rw-r--r--lib/libc/gen/initgroups.c1
-rw-r--r--lib/libc/gen/nlist.c2
-rw-r--r--lib/libc/gen/popen.c2
-rw-r--r--lib/libc/gen/pwcache.c2
-rw-r--r--lib/libc/gen/raise.c1
-rw-r--r--lib/libc/gen/rewinddir.c2
-rw-r--r--lib/libc/gen/seekdir.c2
-rw-r--r--lib/libc/gen/setproctitle.c3
-rw-r--r--lib/libc/gen/siginterrupt.c1
-rw-r--r--lib/libc/gen/sigsetops.c5
-rw-r--r--lib/libc/gen/syslog.c4
-rw-r--r--lib/libc/gen/timezone.c30
-rw-r--r--lib/libc/gen/ttyname.c4
-rw-r--r--lib/libc/gen/ttyslot.c6
-rw-r--r--lib/libc/gen/unvis.c2
-rw-r--r--lib/libc/gen/vis.c2
27 files changed, 76 insertions, 58 deletions
diff --git a/lib/libc/gen/closedir.c b/lib/libc/gen/closedir.c
index 3a4fc9d..6c46e70 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 6af8868..b62ae63 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 0c2ca13..96cd341 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 3915b00..8de23df 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 3915b00..8de23df 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 fbd445d..d3f5814 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 c65e1fa..702828e 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 9b9d0d9..69d2d94 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 658f5b6..b053d34 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 3dd7afb..1831458 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 83f97e8..2671015 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 da64187..b1ddd86 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 cbece18..7292452 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 0b8bda5..0d28046 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 05773bd..a4328ae 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 75ecaa1..2562c81 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 b46bcf3..2076ddd 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 48b4646..1934bcc 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 08efa99..1f9f4b5 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 3105d13..06960ab 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 e6acb77..c3bd870 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 1949332..a355eb2 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 370493b..fe3ce23 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 39c640e..7ec5429 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 066f2f9..2f72ebb 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 ebeb771..32405df 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 66954e7..61aa836 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);
OpenPOWER on IntegriCloud