Fixed gcc -Wall warnings
authorChristos Zoulas <christos@ucbvax.Berkeley.EDU>
Sun, 23 May 1993 10:06:52 +0000 (02:06 -0800)
committerChristos Zoulas <christos@ucbvax.Berkeley.EDU>
Sun, 23 May 1993 10:06:52 +0000 (02:06 -0800)
SCCS-vsn: bin/csh/alloc.c 5.14
SCCS-vsn: bin/csh/char.c 5.9
SCCS-vsn: bin/csh/char.h 5.8
SCCS-vsn: bin/csh/const.c 5.7
SCCS-vsn: bin/csh/csh.c 5.38
SCCS-vsn: bin/csh/csh.h 5.25
SCCS-vsn: bin/csh/dir.c 5.20
SCCS-vsn: bin/csh/dir.h 5.6
SCCS-vsn: bin/csh/dol.c 5.20
SCCS-vsn: bin/csh/err.c 5.13
SCCS-vsn: bin/csh/exec.c 5.22
SCCS-vsn: bin/csh/exp.c 5.16
SCCS-vsn: bin/csh/extern.h 5.15
SCCS-vsn: bin/csh/file.c 5.24
SCCS-vsn: bin/csh/func.c 5.39
SCCS-vsn: bin/csh/glob.c 5.40
SCCS-vsn: bin/csh/hist.c 5.11
SCCS-vsn: bin/csh/init.c 5.16
SCCS-vsn: bin/csh/lex.c 5.28
SCCS-vsn: bin/csh/misc.c 5.19
SCCS-vsn: bin/csh/parse.c 5.13
SCCS-vsn: bin/csh/pathnames.h 5.8
SCCS-vsn: bin/csh/proc.c 5.29
SCCS-vsn: bin/csh/proc.h 5.8
SCCS-vsn: bin/csh/sem.c 5.23
SCCS-vsn: bin/csh/set.c 5.20
SCCS-vsn: bin/csh/str.c 5.13
SCCS-vsn: bin/csh/time.c 5.16

28 files changed:
usr/src/bin/csh/alloc.c
usr/src/bin/csh/char.c
usr/src/bin/csh/char.h
usr/src/bin/csh/const.c
usr/src/bin/csh/csh.c
usr/src/bin/csh/csh.h
usr/src/bin/csh/dir.c
usr/src/bin/csh/dir.h
usr/src/bin/csh/dol.c
usr/src/bin/csh/err.c
usr/src/bin/csh/exec.c
usr/src/bin/csh/exp.c
usr/src/bin/csh/extern.h
usr/src/bin/csh/file.c
usr/src/bin/csh/func.c
usr/src/bin/csh/glob.c
usr/src/bin/csh/hist.c
usr/src/bin/csh/init.c
usr/src/bin/csh/lex.c
usr/src/bin/csh/misc.c
usr/src/bin/csh/parse.c
usr/src/bin/csh/pathnames.h
usr/src/bin/csh/proc.c
usr/src/bin/csh/proc.h
usr/src/bin/csh/sem.c
usr/src/bin/csh/set.c
usr/src/bin/csh/str.c
usr/src/bin/csh/time.c

index 9273883..5df79f8 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)alloc.c    5.13 (Berkeley) %G%";
+static char sccsid[] = "@(#)alloc.c    5.14 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -94,5 +94,5 @@ showall(v, t)
 {
     memtop = (char *) sbrk(0);
     (void) fprintf(cshout, "Allocated memory from 0x%lx to 0x%lx (%ld).\n",
 {
     memtop = (char *) sbrk(0);
     (void) fprintf(cshout, "Allocated memory from 0x%lx to 0x%lx (%ld).\n",
-           membot, memtop, memtop - membot);
+           (unsigned long) membot, (unsigned long) memtop, memtop - membot);
 }
 }
index 652f7e7..2f19218 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)char.c     5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)char.c     5.9 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "char.h"
 #endif /* not lint */
 
 #include "char.h"
index d8900ba..4f1dfed 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)char.h      5.7 (Berkeley) %G%
+ *     @(#)char.h      5.8 (Berkeley) %G%
  */
 
 #include <ctype.h>
  */
 
 #include <ctype.h>
index 243957e..0cf30d1 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)const.c    5.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)const.c    5.7 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
index 216cf9e..89aba0e 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)csh.c      5.37 (Berkeley) %G%";
+static char sccsid[] = "@(#)csh.c      5.38 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -395,7 +395,7 @@ main(argc, argv)
      * Note that in only the login shell is it likely that parent may have set
      * signals to be ignored
      */
      * Note that in only the login shell is it likely that parent may have set
      * signals to be ignored
      */
-    if (loginsh || intact || intty && isatty(SHOUT))
+    if (loginsh || intact || (intty && isatty(SHOUT)))
        setintr = 1;
     settell();
     /*
        setintr = 1;
     settell();
     /*
@@ -764,7 +764,7 @@ rechist()
         * If $savehist is just set, we use the value of $history
         * else we use the value in $savehist
         */
         * If $savehist is just set, we use the value of $history
         * else we use the value in $savehist
         */
-       if (shist = adrof(STRsavehist)) {
+       if ((shist = adrof(STRsavehist)) != NULL) {
            if (shist->vec[0][0] != '\0')
                (void) Strcpy(hbuf, shist->vec[0]);
            else if ((shist = adrof(STRhistory)) && shist->vec[0][0] != '\0')
            if (shist->vec[0][0] != '\0')
                (void) Strcpy(hbuf, shist->vec[0]);
            else if ((shist = adrof(STRhistory)) && shist->vec[0][0] != '\0')
@@ -890,9 +890,9 @@ pintr1(wantnl)
     if (gointr) {
        gotolab(gointr);
        timflg = 0;
     if (gointr) {
        gotolab(gointr);
        timflg = 0;
-       if (v = pargv)
+       if ((v = pargv) != NULL)
            pargv = 0, blkfree(v);
            pargv = 0, blkfree(v);
-       if (v = gargv)
+       if ((v = gargv) != NULL)
            gargv = 0, blkfree(v);
        reset();
     }
            gargv = 0, blkfree(v);
        reset();
     }
@@ -994,7 +994,7 @@ process(catch)
         * Echo not only on VERBOSE, but also with history expansion. If there
         * is a lexical error then we forego history echo.
         */
         * Echo not only on VERBOSE, but also with history expansion. If there
         * is a lexical error then we forego history echo.
         */
-       if (lex(&paraml) && !seterr && intty || adrof(STRverbose)) {
+       if ((lex(&paraml) && !seterr && intty) || adrof(STRverbose)) {
            prlex(csherr, &paraml);
        }
 
            prlex(csherr, &paraml);
        }
 
@@ -1011,7 +1011,7 @@ process(catch)
         * PWP: entry of items in the history list while in a while loop is done
         * elsewhere...
         */
         * PWP: entry of items in the history list while in a while loop is done
         * elsewhere...
         */
-       if (enterhist || catch && intty && !whyles)
+       if (enterhist || (catch && intty && !whyles))
            savehist(&paraml);
 
        /*
            savehist(&paraml);
 
        /*
@@ -1109,7 +1109,7 @@ mailchk()
        new = stb.st_mtime > time0.tv_sec;
        if (stb.st_size == 0 || stb.st_atime > stb.st_mtime ||
            (stb.st_atime < chktim && stb.st_mtime < chktim) ||
        new = stb.st_mtime > time0.tv_sec;
        if (stb.st_size == 0 || stb.st_atime > stb.st_mtime ||
            (stb.st_atime < chktim && stb.st_mtime < chktim) ||
-           loginsh && !new)
+           (loginsh && !new))
            continue;
        if (cnt == 1)
            (void) fprintf(cshout, "You have %smail.\n", new ? "new " : "");
            continue;
        if (cnt == 1)
            (void) fprintf(cshout, "You have %smail.\n", new ? "new " : "");
@@ -1137,7 +1137,7 @@ gethdir(home)
      * Is it us?
      */
     if (*home == '\0') {
      * Is it us?
      */
     if (*home == '\0') {
-       if (h = value(STRhome)) {
+       if ((h = value(STRhome)) != NULL) {
            (void) Strcpy(home, h);
            return 0;
        }
            (void) Strcpy(home, h);
            return 0;
        }
@@ -1145,7 +1145,7 @@ gethdir(home)
            return 1;
     }
 
            return 1;
     }
 
-    if (pw = getpwnam(short2str(home))) {
+    if ((pw = getpwnam(short2str(home))) != NULL) {
        (void) Strcpy(home, str2short(pw->pw_dir));
        return 0;
     }
        (void) Strcpy(home, str2short(pw->pw_dir));
        return 0;
     }
index 46426d8..1055cb5 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)csh.h       5.24 (Berkeley) %G%
+ *     @(#)csh.h       5.25 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -45,6 +45,12 @@ typedef char Char;
 #define SAVE(a) (strsave(a))
 #endif
 
 #define SAVE(a) (strsave(a))
 #endif
 
+/*
+ * Make sure a variable is not stored in a register by taking its address
+ * This is used where variables might be clobbered by longjmp.
+ */
+#define UNREGISTER(a)  (void) &a
+
 typedef void *ioctl_t;         /* Third arg of ioctl */
 
 typedef void *ptr_t;
 typedef void *ioctl_t;         /* Third arg of ioctl */
 
 typedef void *ptr_t;
index a72f986..bbcba6b 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)dir.c      5.19 (Berkeley) %G%";
+static char sccsid[] = "@(#)dir.c      5.20 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -91,7 +91,7 @@ dinit(hp)
            /*
             * use PWD if we have it (for subshells)
             */
            /*
             * use PWD if we have it (for subshells)
             */
-           if (cwd = getenv("PWD")) {
+           if ((cwd = getenv("PWD")) != NULL) {
                if (stat(cwd, &shp) != -1 && swd.st_dev == shp.st_dev &&
                    swd.st_ino == shp.st_ino)
                    tcp = cwd;
                if (stat(cwd, &shp) != -1 && swd.st_dev == shp.st_dev &&
                    swd.st_ino == shp.st_ino)
                    tcp = cwd;
@@ -371,13 +371,13 @@ dgoto(cp)
        for (p = cp; *p++;)
            continue;
        dp = (Char *) xmalloc((size_t)((cwdlen + (p - cp) + 1) * sizeof(Char)));
        for (p = cp; *p++;)
            continue;
        dp = (Char *) xmalloc((size_t)((cwdlen + (p - cp) + 1) * sizeof(Char)));
-       for (p = dp, q = dcwd->di_name; *p++ = *q++;)
+       for (p = dp, q = dcwd->di_name; (*p++ = *q++) != '\0';)
            continue;
        if (cwdlen)
            p[-1] = '/';
        else
            p--;                /* don't add a / after root */
            continue;
        if (cwdlen)
            p[-1] = '/';
        else
            p--;                /* don't add a / after root */
-       for (q = cp; *p++ = *q++;)
+       for (q = cp; (*p++ = *q++) != '\0';)
            continue;
        xfree((ptr_t) cp);
        cp = dp;
            continue;
        xfree((ptr_t) cp);
        cp = dp;
@@ -425,10 +425,10 @@ dfollow(cp)
        Char    buf[MAXPATHLEN];
 
        for (cdp = c->vec; *cdp; cdp++) {
        Char    buf[MAXPATHLEN];
 
        for (cdp = c->vec; *cdp; cdp++) {
-           for (dp = buf, p = *cdp; *dp++ = *p++;)
+           for (dp = buf, p = *cdp; (*dp++ = *p++) != '\0';)
                continue;
            dp[-1] = '/';
                continue;
            dp[-1] = '/';
-           for (p = cp; *dp++ = *p++;)
+           for (p = cp; (*dp++ = *p++) != '\0';)
                continue;
            if (chdir(short2str(buf)) >= 0) {
                printd = 1;
                continue;
            if (chdir(short2str(buf)) >= 0) {
                printd = 1;
@@ -488,7 +488,7 @@ dopushd(v, t)
        /* NOTREACHED */
        return;
     }
        /* NOTREACHED */
        return;
     }
-    else if (dp = dfind(*v)) {
+    else if ((dp = dfind(*v)) != NULL) {
        char   *tmp;
 
        if (chdir(tmp = short2str(dp->di_name)) < 0)
        char   *tmp;
 
        if (chdir(tmp = short2str(dp->di_name)) < 0)
@@ -640,7 +640,7 @@ dcanon(cp, p)
        while (*++p == '/')     /* flush extra slashes */
            continue;
        if (p != ++sp)
        while (*++p == '/')     /* flush extra slashes */
            continue;
        if (p != ++sp)
-           for (p1 = sp, p2 = p; *p1++ = *p2++;)
+           for (p1 = sp, p2 = p; (*p1++ = *p2++) != '\0';)
                continue;
        p = sp;                 /* save start of component */
        slash = 0;
                continue;
        p = sp;                 /* save start of component */
        slash = 0;
@@ -658,7 +658,7 @@ dcanon(cp, p)
                *sp = '\0';
        else if (sp[0] == '.' && sp[1] == 0) {
            if (slash) {
                *sp = '\0';
        else if (sp[0] == '.' && sp[1] == 0) {
            if (slash) {
-               for (p1 = sp, p2 = p + 1; *p1++ = *p2++;)
+               for (p1 = sp, p2 = p + 1; (*p1++ = *p2++) != '\0';)
                    continue;
                p = --sp;
            }
                    continue;
                p = --sp;
            }
@@ -708,11 +708,11 @@ dcanon(cp, p)
                    /*
                     * Copy new path into newcp
                     */
                    /*
                     * Copy new path into newcp
                     */
-                   for (p2 = cp; *p1++ = *p2++;)
+                   for (p2 = cp; (*p1++ = *p2++) != '\0';)
                        continue;
                        continue;
-                   for (p1--, p2 = link; *p1++ = *p2++;)
+                   for (p1--, p2 = link; (*p1++ = *p2++) != '\0';)
                        continue;
                        continue;
-                   for (p1--, p2 = p; *p1++ = *p2++;)
+                   for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
                        continue;
                    /*
                     * Restart canonicalization at expanded "/xxx".
                        continue;
                    /*
                     * Restart canonicalization at expanded "/xxx".
@@ -728,9 +728,9 @@ dcanon(cp, p)
                    /*
                     * Copy new path into newcp
                     */
                    /*
                     * Copy new path into newcp
                     */
-                   for (p2 = link; *p1++ = *p2++;)
+                   for (p2 = link; (*p1++ = *p2++) != '\0';)
                        continue;
                        continue;
-                   for (p1--, p2 = p; *p1++ = *p2++;)
+                   for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
                        continue;
                    /*
                     * Restart canonicalization at beginning
                        continue;
                    /*
                     * Restart canonicalization at beginning
@@ -746,7 +746,7 @@ dcanon(cp, p)
                while (*--sp != '/')
                    continue;
            if (slash) {
                while (*--sp != '/')
                    continue;
            if (slash) {
-               for (p1 = sp + 1, p2 = p + 1; *p1++ = *p2++;)
+               for (p1 = sp + 1, p2 = p + 1; (*p1++ = *p2++) != '\0';)
                    continue;
                p = sp;
            }
                    continue;
                p = sp;
            }
@@ -799,11 +799,11 @@ dcanon(cp, p)
                    /*
                     * Copy new path into newcp
                     */
                    /*
                     * Copy new path into newcp
                     */
-                   for (p2 = cp; *p1++ = *p2++;)
+                   for (p2 = cp; (*p1++ = *p2++) != '\0';)
                        continue;
                        continue;
-                   for (p1--, p2 = link; *p1++ = *p2++;)
+                   for (p1--, p2 = link; (*p1++ = *p2++) != '\0';)
                        continue;
                        continue;
-                   for (p1--, p2 = p; *p1++ = *p2++;)
+                   for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
                        continue;
                    /*
                     * Restart canonicalization at expanded "/xxx".
                        continue;
                    /*
                     * Restart canonicalization at expanded "/xxx".
@@ -819,9 +819,9 @@ dcanon(cp, p)
                    /*
                     * Copy new path into newcp
                     */
                    /*
                     * Copy new path into newcp
                     */
-                   for (p2 = link; *p1++ = *p2++;)
+                   for (p2 = link; (*p1++ = *p2++) != '\0';)
                        continue;
                        continue;
-                   for (p1--, p2 = p; *p1++ = *p2++;)
+                   for (p1--, p2 = p; (*p1++ = *p2++) != '\0';)
                        continue;
                    /*
                     * Restart canonicalization at beginning
                        continue;
                    /*
                     * Restart canonicalization at beginning
@@ -871,7 +871,7 @@ dcanon(cp, p)
                sp = (Char *) - 1;
                break;
            }
                sp = (Char *) - 1;
                break;
            }
-           if (sp = Strrchr(p2, '/'))
+           if ((sp = Strrchr(p2, '/')) != NULL)
                *sp = '\0';
        }
        /*
                *sp = '\0';
        }
        /*
index 03d5eaa..8e8cd61 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)dir.h       5.5 (Berkeley) %G%
+ *     @(#)dir.h       5.6 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
index a60cbb1..e3e8600 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)dol.c      5.19 (Berkeley) %G%";
+static char sccsid[] = "@(#)dol.c      5.20 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -85,7 +85,7 @@ Dfix(t)
     if (noexec)
        return;
     /* Note that t_dcom isn't trimmed thus !...:q's aren't lost */
     if (noexec)
        return;
     /* Note that t_dcom isn't trimmed thus !...:q's aren't lost */
-    for (pp = t->t_dcom; p = *pp++;)
+    for (pp = t->t_dcom; (p = *pp++) != NULL;)
        for (; *p; p++) {
            if (cmap(*p, _DOL | QUOTES)) {      /* $, \, ', ", ` */
                Dfix2(t->t_dcom);       /* found one */
        for (; *p; p++) {
            if (cmap(*p, _DOL | QUOTES)) {      /* $, \, ', ", ` */
                Dfix2(t->t_dcom);       /* found one */
@@ -317,7 +317,7 @@ DgetC(flag)
     register int c;
 
 top:
     register int c;
 
 top:
-    if (c = Dpeekc) {
+    if ((c = Dpeekc) != '\0') {
        Dpeekc = 0;
        return (c);
     }
        Dpeekc = 0;
        return (c);
     }
@@ -333,7 +333,7 @@ quotspec:
        return (c);
     }
     if (dolp) {
        return (c);
     }
     if (dolp) {
-       if (c = *dolp++ & (QUOTE | TRIM))
+       if ((c = *dolp++ & (QUOTE | TRIM)) != '\0')
            goto quotspec;
        if (dolcnt > 0) {
            setDolp(*dolnxt++);
            goto quotspec;
        if (dolcnt > 0) {
            setDolp(*dolnxt++);
@@ -356,7 +356,7 @@ quotspec:
 }
 
 static Char *nulvec[] = {0};
 }
 
 static Char *nulvec[] = {0};
-static struct varent nulargv = {nulvec, STRargv, 0};
+static struct varent nulargv = {nulvec, STRargv, { NULL, NULL, NULL }, 0};
 
 static void
 dolerror(s)
 
 static void
 dolerror(s)
@@ -778,7 +778,7 @@ Dredc()
 {
     register int c;
 
 {
     register int c;
 
-    if (c = Dpeekrd) {
+    if ((c = Dpeekrd) != '\0') {
        Dpeekrd = 0;
        return (c);
     }
        Dpeekrd = 0;
        return (c);
     }
@@ -849,7 +849,7 @@ heredoc(term)
            c = readc(1);       /* 1 -> Want EOF returns */
            if (c < 0 || c == '\n')
                break;
            c = readc(1);       /* 1 -> Want EOF returns */
            if (c < 0 || c == '\n')
                break;
-           if (c &= TRIM) {
+           if ((c &= TRIM) != '\0') {
                *lbp++ = c;
                if (--lcnt < 0) {
                    setname("<<");
                *lbp++ = c;
                if (--lcnt < 0) {
                    setname("<<");
@@ -874,7 +874,7 @@ heredoc(term)
        if (quoted || noexec) {
            *lbp++ = '\n';
            *lbp = 0;
        if (quoted || noexec) {
            *lbp++ = '\n';
            *lbp = 0;
-           for (lbp = lbuf; c = *lbp++;) {
+           for (lbp = lbuf; (c = *lbp++) != '\0';) {
                *obp++ = c;
                if (--ocnt == 0) {
                    (void) write(0, short2str(obuf), BUFSIZ);
                *obp++ = c;
                if (--ocnt == 0) {
                    (void) write(0, short2str(obuf), BUFSIZ);
index 167e6fd..5348cd2 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)err.c      5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)err.c      5.13 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -354,9 +354,9 @@ stderror(id, va_alist)
        seterr = NULL;
     }
 
        seterr = NULL;
     }
 
-    if (v = pargv)
+    if ((v = pargv) != NULL)
        pargv = 0, blkfree(v);
        pargv = 0, blkfree(v);
-    if (v = gargv)
+    if ((v = gargv) != NULL)
        gargv = 0, blkfree(v);
 
     (void) fflush(cshout);
        gargv = 0, blkfree(v);
 
     (void) fflush(cshout);
index f449f69..42d0b71 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)exec.c     5.21 (Berkeley) %G%";
+static char sccsid[] = "@(#)exec.c     5.22 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -63,7 +63,7 @@ static Char *expath;          /* Path for exerr */
 #define HSHMUL         243
 static char xhash[HSHSIZ / 8];
 
 #define HSHMUL         243
 static char xhash[HSHSIZ / 8];
 
-#define hash(a, b)     ((a) * HSHMUL + (b) & HSHMASK)
+#define hash(a, b)     (((a) * HSHMUL + (b)) & HSHMASK)
 #define bit(h, b)      ((h)[(b) >> 3] & 1 << ((b) & 7))        /* bit test */
 #define bis(h, b)      ((h)[(b) >> 3] |= 1 << ((b) & 7))       /* bit set */
 static int hits, misses;
 #define bit(h, b)      ((h)[(b) >> 3] & 1 << ((b) & 7))        /* bit test */
 #define bis(h, b)      ((h)[(b) >> 3] |= 1 << ((b) & 7))       /* bit set */
 static int hits, misses;
@@ -441,7 +441,7 @@ dohash(v, t)
                continue;
            if (dp->d_name[0] == '.' &&
                (dp->d_name[1] == '\0' ||
                continue;
            if (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')))
                continue;
            hashval = hash(hashname(str2short(dp->d_name)), i);
            bis(xhash, hashval);
                continue;
            hashval = hash(hashname(str2short(dp->d_name)), i);
            bis(xhash, hashval);
@@ -608,7 +608,7 @@ dowhich(v, c)
     lex[2].word = STRret;
 
     while (*++v) {
     lex[2].word = STRret;
 
     while (*++v) {
-       if (vp = adrof1(*v, &aliases)) {
+       if ((vp = adrof1(*v, &aliases)) != NULL) {
            (void) fprintf(cshout, "%s: \t aliased to ", vis_str(*v));
            blkpr(cshout, vp->vec);
            (void) fputc('\n', cshout);
            (void) fprintf(cshout, "%s: \t aliased to ", vis_str(*v));
            blkpr(cshout, vp->vec);
            (void) fputc('\n', cshout);
@@ -675,7 +675,7 @@ tellmewhat(lex)
        }
     }
 
        }
     }
 
-    if (i = iscommand(strip(sp->word))) {
+    if ((i = iscommand(strip(sp->word))) != 0) {
        register Char **pv;
        register struct varent *v;
        bool    slash = any(short2str(sp->word), '/');
        register Char **pv;
        register struct varent *v;
        bool    slash = any(short2str(sp->word), '/');
index 6bf110d..60569ba 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)exp.c      5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)exp.c      5.16 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -195,7 +195,7 @@ exp2c(vp, ignore)
 #ifdef EDEBUG
     etracc("exp2c p1", p1, vp);
 #endif
 #ifdef EDEBUG
     etracc("exp2c p1", p1, vp);
 #endif
-    if (i = isa(**vp, EQOP)) {
+    if ((i = isa(**vp, EQOP)) != 0) {
        (*vp)++;
        if (i == EQMATCH || i == NOTEQMATCH)
            ignore |= NOGLOB;
        (*vp)++;
        if (i == EQMATCH || i == NOTEQMATCH)
            ignore |= NOGLOB;
@@ -243,7 +243,7 @@ exp3(vp, ignore)
 #ifdef EDEBUG
     etracc("exp3 p1", p1, vp);
 #endif
 #ifdef EDEBUG
     etracc("exp3 p1", p1, vp);
 #endif
-    if (i = isa(**vp, RELOP)) {
+    if ((i = isa(**vp, RELOP)) != 0) {
        (*vp)++;
        if (**vp && eq(**vp, STRequal))
            i |= 1, (*vp)++;
        (*vp)++;
        if (**vp && eq(**vp, STRequal))
            i |= 1, (*vp)++;
index d8c5f4d..728eee6 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)extern.h    5.14 (Berkeley) %G%
+ *     @(#)extern.h    5.15 (Berkeley) %G%
  */
 
 #include <sys/cdefs.h>
  */
 
 #include <sys/cdefs.h>
index 0946920..24196d5 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)file.c     5.23 (Berkeley) %G%";
+static char sccsid[] = "@(#)file.c     5.24 (Berkeley) %G%";
 #endif /* not lint */
 
 #ifdef FILEC
 #endif /* not lint */
 
 #ifdef FILEC
@@ -141,7 +141,7 @@ pushback(string)
     tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL | ECHOPRT | ECHOCTL);
     (void) tcsetattr(SHOUT, TCSANOW, &tty);
 
     tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL | ECHOPRT | ECHOCTL);
     (void) tcsetattr(SHOUT, TCSANOW, &tty);
 
-    for (p = string; c = *p; p++)
+    for (p = string; (c = *p) != '\0'; p++)
        (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c);
     (void) tcsetattr(SHOUT, TCSANOW, &tty_normal);
     (void) sigsetmask(omask);
        (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c);
     (void) tcsetattr(SHOUT, TCSANOW, &tty_normal);
     (void) sigsetmask(omask);
@@ -371,7 +371,7 @@ getentry(dir_fd, looking_for_lognames)
            return (NULL);
        return (str2short(pw->pw_name));
     }
            return (NULL);
        return (str2short(pw->pw_name));
     }
-    if (dirp = readdir(dir_fd))
+    if ((dirp = readdir(dir_fd)) != NULL)
        return (str2short(dirp->d_name));
     return (NULL);
 }
        return (str2short(dirp->d_name));
     return (NULL);
 }
@@ -435,7 +435,7 @@ tsearch(word, command, max_word_length)
 
 again:                         /* search for matches */
     name_length = Strlen(name);
 
 again:                         /* search for matches */
     name_length = Strlen(name);
-    for (numitems = 0; entry = getentry(dir_fd, looking_for_lognames);) {
+    for (numitems = 0; (entry = getentry(dir_fd, looking_for_lognames)) != NULL;) {
        if (!is_prefix(name, entry))
            continue;
        /* Don't match . files on null prefix match */
        if (!is_prefix(name, entry))
            continue;
        /* Don't match . files on null prefix match */
index c5ab9e3..18b41f1 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)func.c     5.38 (Berkeley) %G%";
+static char sccsid[] = "@(#)func.c     5.39 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -666,8 +666,8 @@ search(type, level, goal)
            if (lastchr(aword) != ':')
                break;
            aword[Strlen(aword) - 1] = 0;
            if (lastchr(aword) != ':')
                break;
            aword[Strlen(aword) - 1] = 0;
-           if (type == T_GOTO && eq(aword, goal) ||
-               type == T_SWITCH && eq(aword, STRdefault))
+           if ((type == T_GOTO && eq(aword, goal)) ||
+               (type == T_SWITCH && eq(aword, STRdefault)))
                level = -1;
            break;
 
                level = -1;
            break;
 
@@ -734,8 +734,8 @@ getword(wp)
                *wp++ = c;
                *wp = 0;        /* end the string b4 test */
            }
                *wp++ = c;
                *wp = 0;        /* end the string b4 test */
            }
-       } while ((d || !(kwd = keyword(owp)) && c != ' '
-                 && c != '\t') && c != '\n');
+       } while ((d || (!(kwd = keyword(owp)) && c != ' '
+                 && c != '\t')) && c != '\n');
     } while (wp == 0);
 
     /*
     } while (wp == 0);
 
     /*
@@ -895,10 +895,10 @@ xecho(sep, v)
     }
     if (sep == ' ' && *v && eq(*v, STRmn))
        nonl++, v++;
     }
     if (sep == ' ' && *v && eq(*v, STRmn))
        nonl++, v++;
-    while (cp = *v++) {
+    while ((cp = *v++) != NULL) {
        register int c;
 
        register int c;
 
-       while (c = *cp++)
+       while ((c = *cp++) != '\0')
            (void) vis_fputc(c | QUOTE, cshout);
 
        if (*v)
            (void) vis_fputc(c | QUOTE, cshout);
 
        if (*v)
@@ -1098,16 +1098,16 @@ static struct limits {
     int     limdiv;
     char   *limscale;
 }       limits[] = {
     int     limdiv;
     char   *limscale;
 }       limits[] = {
-    RLIMIT_CPU,                "cputime",      1,      "seconds",
-    RLIMIT_FSIZE,      "filesize",     1024,   "kbytes",
-    RLIMIT_DATA,       "datasize",     1024,   "kbytes",
-    RLIMIT_STACK,      "stacksize",    1024,   "kbytes",
-    RLIMIT_CORE,       "coredumpsize", 1024,   "kbytes",
-    RLIMIT_RSS,                "memoryuse",    1024,   "kbytes",
-    RLIMIT_MEMLOCK,    "memorylocked", 1024,   "kbytes",
-    RLIMIT_NPROC,      "maxproc",      1,      "",
-    RLIMIT_NOFILE,     "openfiles",    1,      "",
-    -1,                        NULL,           0,      NULL
+    { RLIMIT_CPU,      "cputime",      1,      "seconds" },
+    { RLIMIT_FSIZE,    "filesize",     1024,   "kbytes" },
+    { RLIMIT_DATA,     "datasize",     1024,   "kbytes" },
+    { RLIMIT_STACK,    "stacksize",    1024,   "kbytes" },
+    { RLIMIT_CORE,     "coredumpsize", 1024,   "kbytes" },
+    { RLIMIT_RSS,      "memoryuse",    1024,   "kbytes" },
+    { RLIMIT_MEMLOCK,  "memorylocked", 1024,   "kbytes" },
+    { RLIMIT_NPROC,    "maxproc",      1,      "" },
+    { RLIMIT_NOFILE,   "openfiles",    1,      "" },
+    { -1,              NULL,           0,      NULL }
 };
 
 static struct limits *findlim();
 };
 
 static struct limits *findlim();
@@ -1392,6 +1392,8 @@ doeval(v, t)
     int     oSHOUT;
     int     oSHERR;
 
     int     oSHOUT;
     int     oSHERR;
 
+    UNREGISTER(v);
+
     oevalvec = evalvec;
     oevalp = evalp;
     odidfds = didfds;
     oevalvec = evalvec;
     oevalp = evalp;
     odidfds = didfds;
index ab723cc..fd87444 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)glob.c     5.39 (Berkeley) %G%";
+static char sccsid[] = "@(#)glob.c     5.40 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -210,7 +210,7 @@ expbrace(nvp, elp, size)
        /* leave {} untouched for find */
        if (s[0] == '{' && (s[1] == '\0' || (s[1] == '}' && s[2] == '\0')))
            continue;
        /* leave {} untouched for find */
        if (s[0] == '{' && (s[1] == '\0' || (s[1] == '}' && s[2] == '\0')))
            continue;
-       if (b = Strchr(s, '{')) {
+       if ((b = Strchr(s, '{')) != NULL) {
            Char  **bl;
            int     len;
 
            Char  **bl;
            int     len;
 
@@ -270,7 +270,7 @@ globexpand(v)
     /*
      * Step 1: expand backquotes.
      */
     /*
      * Step 1: expand backquotes.
      */
-    while (s = *v++) {
+    while ((s = *v++) != NULL) {
        if (Strchr(s, '`')) {
            int     i;
 
        if (Strchr(s, '`')) {
            int     i;
 
@@ -512,7 +512,7 @@ rscan(t, f)
 {
     register Char *p;
 
 {
     register Char *p;
 
-    while (p = *t++)
+    while ((p = *t++) != NULL)
        while (*p)
            (*f) (*p++);
 }
        while (*p)
            (*f) (*p++);
 }
@@ -523,7 +523,7 @@ trim(t)
 {
     register Char *p;
 
 {
     register Char *p;
 
-    while (p = *t++)
+    while ((p = *t++) != NULL)
        while (*p)
            *p++ &= TRIM;
 }
        while (*p)
            *p++ &= TRIM;
 }
@@ -534,13 +534,13 @@ tglob(t)
 {
     register Char *p, c;
 
 {
     register Char *p, c;
 
-    while (p = *t++) {
+    while ((p = *t++) != NULL) {
        if (*p == '~' || *p == '=')
            gflag |= G_CSH;
        else if (*p == '{' &&
                 (p[1] == '\0' || (p[1] == '}' && p[2] == '\0')))
            continue;
        if (*p == '~' || *p == '=')
            gflag |= G_CSH;
        else if (*p == '{' &&
                 (p[1] == '\0' || (p[1] == '}' && p[2] == '\0')))
            continue;
-       while (c = *p++) {
+       while ((c = *p++) != '\0') {
            /*
             * eat everything inside the matching backquotes
             */
            /*
             * eat everything inside the matching backquotes
             */
@@ -830,9 +830,9 @@ pmatch(string, pattern)
            return (0);
        case '[':
            match = 0;
            return (0);
        case '[':
            match = 0;
-           if (negate_range = (*pattern == '^'))
+           if ((negate_range = (*pattern == '^')) != 0)
                pattern++;
                pattern++;
-           while (rangec = *pattern++) {
+           while ((rangec = *pattern++) != '\0') {
                if (rangec == ']')
                    break;
                if (match)
                if (rangec == ']')
                    break;
                if (match)
@@ -878,9 +878,9 @@ Gcat(s1, s2)
     }
     gargv[gargc] = 0;
     p = gargv[gargc - 1] = (Char *) xmalloc((size_t) n * sizeof(Char));
     }
     gargv[gargc] = 0;
     p = gargv[gargc - 1] = (Char *) xmalloc((size_t) n * sizeof(Char));
-    for (q = s1; *p++ = *q++;)
+    for (q = s1; (*p++ = *q++) != '\0';)
        continue;
        continue;
-    for (p--, q = s2; *p++ = *q++;)
+    for (p--, q = s2; (*p++ = *q++) != '\0';)
        continue;
 }
 
        continue;
 }
 
index ad7d4e7..17029b3 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)hist.c     5.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)hist.c     5.11 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -47,7 +47,7 @@ savehist(sp)
            histlen = histlen * 10 + *p++ - '0';
        }
     }
            histlen = histlen * 10 + *p++ - '0';
        }
     }
-    for (hp = &Histlist; np = hp->Hnext;)
+    for (hp = &Histlist; (np = hp->Hnext) != NULL;)
        if (eventno - np->Href >= histlen || histlen == 0)
            hp->Hnext = np->Hnext, hfree(np);
        else
        if (eventno - np->Href >= histlen || histlen == 0)
            hp->Hnext = np->Hnext, hfree(np);
        else
index fd0ba05..91c24e1 100644 (file)
@@ -6,7 +6,8 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)init.c     5.15 (Berkeley) %G%";
+/*###9 [cc] warning: `sccsid' defined but not used%%%*/
+static char sccsid[] = "@(#)init.c     5.16 (Berkeley) %G%";
 #endif /* not lint */
 
 #if __STDC__
 #endif /* not lint */
 
 #if __STDC__
@@ -22,87 +23,87 @@ static char sccsid[] = "@(#)init.c  5.15 (Berkeley) %G%";
 
 struct biltins bfunc[] =
 {
 
 struct biltins bfunc[] =
 {
-    "@",       dolet,          0, INF,
-    "alias",   doalias,        0, INF,
-    "alloc",   showall,        0, 1,
-    "bg",      dobg,           0, INF,
-    "break",   dobreak,        0, 0,
-    "breaksw",         doswbrk,        0, 0,
-    "case",    dozip,          0, 1,
-    "cd",      dochngd,        0, INF,
-    "chdir",   dochngd,        0, INF,
-    "continue", docontin,      0, 0,
-    "default",         dozip,          0, 0,
-    "dirs",    dodirs,         0, INF,
-    "echo",    doecho,         0, INF,
-    "else",    doelse,         0, INF,
-    "end",     doend,          0, 0,
-    "endif",   dozip,          0, 0,
-    "endsw",   dozip,          0, 0,
-    "eval",    doeval,         0, INF,
-    "exec",    execash,        1, INF,
-    "exit",    doexit,         0, INF,
-    "fg",      dofg,           0, INF,
-    "foreach",         doforeach,      3, INF,
-    "glob",    doglob,         0, INF,
-    "goto",    dogoto,         1, 1,
-    "hashstat", hashstat,      0, 0,
-    "history",         dohist,         0, 2,
-    "if",      doif,           1, INF,
-    "jobs",    dojobs,         0, 1,
-    "kill",    dokill,         1, INF,
-    "limit",   dolimit,        0, 3,
-    "linedit",         doecho,         0, INF,
-    "login",   dologin,        0, 1,
-    "logout",  dologout,       0, 0,
-    "nice",    donice,         0, INF,
-    "nohup",   donohup,        0, INF,
-    "notify",  donotify,       0, INF,
-    "onintr",  doonintr,       0, 2,
-    "popd",    dopopd,         0, INF,
-    "printf",  doprintf,       1, INF,
-    "pushd",   dopushd,        0, INF,
-    "rehash",  dohash,         0, 0,
-    "repeat",  dorepeat,       2, INF,
-    "set",     doset,          0, INF,
-    "setenv",  dosetenv,       0, 2,
-    "shift",   shift,          0, 1,
-    "source",  dosource,       1, 2,
-    "stop",    dostop,         1, INF,
-    "suspend",         dosuspend,      0, 0,
-    "switch",  doswitch,       1, INF,
-    "time",    dotime,         0, INF,
-    "umask",   doumask,        0, 1,
-    "unalias",         unalias,        1, INF,
-    "unhash",  dounhash,       0, 0,
-    "unlimit",         dounlimit,      0, INF,
-    "unset",   unset,          1, INF,
-    "unsetenv", dounsetenv,    1, INF,
-    "wait",    dowait,         0, 0,
-    "which",   dowhich,        1, INF,
-    "while",   dowhile,        1, INF,
+    { "@",             dolet,          0, INF  },
+    { "alias",                 doalias,        0, INF  },
+    { "alloc",                 showall,        0, 1    },
+    { "bg",            dobg,           0, INF  },
+    { "break",                 dobreak,        0, 0    },
+    { "breaksw",       doswbrk,        0, 0    },
+    { "case",          dozip,          0, 1    },
+    { "cd",            dochngd,        0, INF  },
+    { "chdir",                 dochngd,        0, INF  },
+    { "continue",      docontin,       0, 0    },
+    { "default",       dozip,          0, 0    },
+    { "dirs",          dodirs,         0, INF  },
+    { "echo",          doecho,         0, INF  },
+    { "else",          doelse,         0, INF  },
+    { "end",           doend,          0, 0    },
+    { "endif",                 dozip,          0, 0    },
+    { "endsw",                 dozip,          0, 0    },
+    { "eval",          doeval,         0, INF  },
+    { "exec",          execash,        1, INF  },
+    { "exit",          doexit,         0, INF  },
+    { "fg",            dofg,           0, INF  },
+    { "foreach",       doforeach,      3, INF  },
+    { "glob",          doglob,         0, INF  },
+    { "goto",          dogoto,         1, 1    },
+    { "hashstat",      hashstat,       0, 0    },
+    { "history",       dohist,         0, 2    },
+    { "if",            doif,           1, INF  },
+    { "jobs",          dojobs,         0, 1    },
+    { "kill",          dokill,         1, INF  },
+    { "limit",                 dolimit,        0, 3    },
+    { "linedit",       doecho,         0, INF  },
+    { "login",                 dologin,        0, 1    },
+    { "logout",        dologout,       0, 0    },
+    { "nice",          donice,         0, INF  },
+    { "nohup",                 donohup,        0, INF  },
+    { "notify",        donotify,       0, INF  },
+    { "onintr",        doonintr,       0, 2    },
+    { "popd",          dopopd,         0, INF  },
+    { "printf",                doprintf,       1, INF  },
+    { "pushd",                 dopushd,        0, INF  },
+    { "rehash",        dohash,         0, 0    },
+    { "repeat",        dorepeat,       2, INF  },
+    { "set",           doset,          0, INF  },
+    { "setenv",        dosetenv,       0, 2    },
+    { "shift",                 shift,          0, 1    },
+    { "source",        dosource,       1, 2    },
+    { "stop",          dostop,         1, INF  },
+    { "suspend",       dosuspend,      0, 0    },
+    { "switch",        doswitch,       1, INF  },
+    { "time",          dotime,         0, INF  },
+    { "umask",                 doumask,        0, 1    },
+    { "unalias",       unalias,        1, INF  },
+    { "unhash",        dounhash,       0, 0    },
+    { "unlimit",       dounlimit,      0, INF  },
+    { "unset",                 unset,          1, INF  },
+    { "unsetenv",      dounsetenv,     1, INF  },
+    { "wait",          dowait,         0, 0    },
+    { "which",         dowhich,        1, INF  },
+    { "while",                 dowhile,        1, INF  }
 };
 int     nbfunc = sizeof bfunc / sizeof *bfunc;
 
 struct srch srchn[] =
 {
 };
 int     nbfunc = sizeof bfunc / sizeof *bfunc;
 
 struct srch srchn[] =
 {
-    "@",       T_LET,
-    "break",   T_BREAK,
-    "breaksw",         T_BRKSW,
-    "case",    T_CASE,
-    "default",         T_DEFAULT,
-    "else",    T_ELSE,
-    "end",     T_END,
-    "endif",   T_ENDIF,
-    "endsw",   T_ENDSW,
-    "exit",    T_EXIT,
-    "foreach",         T_FOREACH,
-    "goto",    T_GOTO,
-    "if",      T_IF,
-    "label",   T_LABEL,
-    "set",     T_SET,
-    "switch",  T_SWITCH,
-    "while",   T_WHILE,
+    { "@",             T_LET           },
+    { "break",                 T_BREAK         },
+    { "breaksw",       T_BRKSW         },
+    { "case",          T_CASE          },
+    { "default",       T_DEFAULT       },
+    { "else",          T_ELSE          },
+    { "end",           T_END           },
+    { "endif",                 T_ENDIF         },
+    { "endsw",                 T_ENDSW         },
+    { "exit",          T_EXIT          },
+    { "foreach",       T_FOREACH       },
+    { "goto",          T_GOTO          },
+    { "if",            T_IF            },
+    { "label",                 T_LABEL         },
+    { "set",           T_SET           },
+    { "switch",        T_SWITCH        },
+    { "while",                 T_WHILE         }
 };
 int     nsrchn = sizeof srchn / sizeof *srchn;
 
 };
 int     nsrchn = sizeof srchn / sizeof *srchn;
 
index 8bf0a29..e19cbe0 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)lex.c      5.27 (Berkeley) %G%";
+static char sccsid[] = "@(#)lex.c      5.28 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -335,7 +335,7 @@ getC1(flag)
     register Char c;
 
     while (1) {
     register Char c;
 
     while (1) {
-       if (c = peekc) {
+       if ((c = peekc) != '\0') {
            peekc = 0;
            return (c);
        }
            peekc = 0;
            return (c);
        }
@@ -348,12 +348,12 @@ getC1(flag)
                return (c);
            }
        }
                return (c);
            }
        }
-       if (c = peekd) {
+       if ((c = peekd) != '\0') {
            peekd = 0;
            return (c);
        }
        if (exclp) {
            peekd = 0;
            return (c);
        }
        if (exclp) {
-           if (c = *exclp++)
+           if ((c = *exclp++) != '\0')
                return (c);
            if (exclnxt && --exclc >= 0) {
                exclnxt = exclnxt->next;
                return (c);
            if (exclnxt && --exclc >= 0) {
                exclnxt = exclnxt->next;
@@ -446,7 +446,7 @@ getdol()
 #endif
            /* we know that np < &name[4] */
            ep = &np[MAXVARLEN];
 #endif
            /* we know that np < &name[4] */
            ep = &np[MAXVARLEN];
-           while (c = getC(DOEXCL)) {
+           while ((c = getC(DOEXCL)) != '\0'){
                if (!Isdigit(c))
                    break;
                if (np < ep)
                if (!Isdigit(c))
                    break;
                if (np < ep)
@@ -459,7 +459,7 @@ getdol()
            /* we know that np < &name[4] */
            ep = &np[MAXVARLEN];
            toolong = 0;
            /* we know that np < &name[4] */
            ep = &np[MAXVARLEN];
            toolong = 0;
-           while (c = getC(DOEXCL)) {
+           while ((c = getC(DOEXCL)) != '\0') {
                /* Bugfix for ${v123x} from Chris Torek, DAS DEC-90. */
                if (!letter(c) && !Isdigit(c))
                    break;
                /* Bugfix for ${v123x} from Chris Torek, DAS DEC-90. */
                if (!letter(c) && !Isdigit(c))
                    break;
@@ -976,7 +976,7 @@ domod(cp, type)
     case 'x':
     case 'q':
        wp = Strsave(cp);
     case 'x':
     case 'q':
        wp = Strsave(cp);
-       for (xp = wp; c = *xp; xp++)
+       for (xp = wp; (c = *xp) != '\0'; xp++)
            if ((c != ' ' && c != '\t') || type == 'q')
                *xp |= QUOTE;
        return (wp);
            if ((c != ' ' && c != '\t') || type == 'q')
                *xp |= QUOTE;
        return (wp);
@@ -1301,7 +1301,7 @@ readc(wanteof)
     static  sincereal;
 
     aret = F_SEEK;
     static  sincereal;
 
     aret = F_SEEK;
-    if (c = peekread) {
+    if ((c = peekread) != '\0') {
        peekread = 0;
        return (c);
     }
        peekread = 0;
        return (c);
     }
@@ -1309,7 +1309,7 @@ top:
     aret = F_SEEK;
     if (alvecp) {
        aret = A_SEEK;
     aret = F_SEEK;
     if (alvecp) {
        aret = A_SEEK;
-       if (c = *alvecp++)
+       if ((c = *alvecp++) != '\0')
            return (c);
        if (alvec && *alvec) {
                alvecp = *alvec++;
            return (c);
        if (alvec && *alvec) {
                alvecp = *alvec++;
@@ -1322,7 +1322,7 @@ top:
        }
     }
     if (alvec) {
        }
     }
     if (alvec) {
-       if (alvecp = *alvec) {
+       if ((alvecp = *alvec) != '\0') {
            alvec++;
            goto top;
        }
            alvec++;
            goto top;
        }
@@ -1331,7 +1331,7 @@ top:
     }
     if (evalp) {
        aret = E_SEEK;
     }
     if (evalp) {
        aret = E_SEEK;
-       if (c = *evalp++)
+       if ((c = *evalp++) != '\0')
            return (c);
        if (evalvec && *evalvec) {
            evalp = *evalvec++;
            return (c);
        if (evalvec && *evalvec) {
            evalp = *evalvec++;
@@ -1345,7 +1345,7 @@ top:
            doneinp = 1;
            reset();
        }
            doneinp = 1;
            reset();
        }
-       if (evalp = *evalvec) {
+       if ((evalp = *evalvec) != '\0') {
            evalvec++;
            goto top;
        }
            evalvec++;
            goto top;
        }
index ce71b1b..3d01367 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)misc.c     5.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)misc.c     5.19 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -59,7 +59,7 @@ strsave(s)
     for (p = s; *p++;)
        continue;
     n = p = (char *) xmalloc((size_t) ((p - s) * sizeof(char)));
     for (p = s; *p++;)
        continue;
     n = p = (char *) xmalloc((size_t) ((p - s) * sizeof(char)));
-    while (*p++ = *s++)
+    while ((*p++ = *s++) != '\0')
        continue;
     return (n);
 }
        continue;
     return (n);
 }
@@ -106,7 +106,7 @@ blkcpy(oav, bv)
 {
     register Char **av = oav;
 
 {
     register Char **av = oav;
 
-    while (*av++ = *bv++)
+    while ((*av++ = *bv++) != NULL)
        continue;
     return (oav);
 }
        continue;
     return (oav);
 }
@@ -271,7 +271,7 @@ dcopy(i, j)
     register int i, j;
 {
 
     register int i, j;
 {
 
-    if (i == j || i < 0 || j < 0 && i > 2)
+    if (i == j || i < 0 || (j < 0 && i > 2))
        return (i);
     if (j >= 0) {
        (void) dup2(i, j);
        return (i);
     if (j >= 0) {
        (void) dup2(i, j);
@@ -354,7 +354,7 @@ strend(cp)
     return (cp);
 }
 
     return (cp);
 }
 
-#endif                         /* SHORT_STRINGS */
+#endif /* SHORT_STRINGS */
 
 Char   *
 strip(cp)
 
 Char   *
 strip(cp)
@@ -364,7 +364,7 @@ strip(cp)
 
     if (!cp)
        return (cp);
 
     if (!cp)
        return (cp);
-    while (*dp++ &= TRIM)
+    while ((*dp++ &= TRIM) != '\0')
        continue;
     return (cp);
 }
        continue;
     return (cp);
 }
index 3cd64fb..7d63190 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)parse.c    5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)parse.c    5.13 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -584,7 +584,7 @@ again:
                seterror(ERR_MISRED);
                continue;
            }
                seterror(ERR_MISRED);
                continue;
            }
-           if ((flags & POUT) && (flags & PERR) == 0 || t->t_drit)
+           if ((flags & POUT) && ((flags & PERR) == 0 || t->t_drit))
                seterror(ERR_OUTRED);
            else
                t->t_drit = Strsave(p->word);
                seterror(ERR_OUTRED);
            else
                t->t_drit = Strsave(p->word);
index d1a7cf1..7ecb189 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)pathnames.h 5.7 (Berkeley) %G%
+ *     @(#)pathnames.h 5.8 (Berkeley) %G%
  */
 
 #define        _PATH_BIN               "/bin"
  */
 
 #define        _PATH_BIN               "/bin"
index 940207c..1819a82 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)proc.c     5.28 (Berkeley) %G%";
+static char sccsid[] = "@(#)proc.c     5.29 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -706,7 +706,8 @@ pprint(pp, flag)
                             && (reason != SIGPIPE
                                 || (pp->p_flags & PPOU) == 0))) {
                        (void) fprintf(cshout, format,
                             && (reason != SIGPIPE
                                 || (pp->p_flags & PPOU) == 0))) {
                        (void) fprintf(cshout, format,
-                                      sys_siglist[pp->p_reason]);
+                                      sys_siglist[(unsigned char)
+                                                  pp->p_reason]);
                        hadnl = 0;
                    }
                    break;
                        hadnl = 0;
                    }
                    break;
index 712e83a..76c040b 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)proc.h      5.7 (Berkeley) %G%
+ *     @(#)proc.h      5.8 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
index f938cc8..d6c8bf0 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)sem.c      5.22 (Berkeley) %G%";
+static char sccsid[] = "@(#)sem.c      5.23 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -48,6 +48,10 @@ execute(t, wanttty, pipein, pipeout)
     static int onosigchld = 0;
     static int nosigchld = 0;
 
     static int onosigchld = 0;
     static int nosigchld = 0;
 
+    UNREGISTER(forked);
+    UNREGISTER(bifunc);
+    UNREGISTER(wanttty);
+
     if (t == 0)
        return;
 
     if (t == 0)
        return;
 
@@ -162,9 +166,9 @@ execute(t, wanttty, pipein, pipeout)
                       bifunc->bfunct == dopushd ||
                       bifunc->bfunct == dopopd))
            t->t_dflg &= ~(F_NICE);
                       bifunc->bfunct == dopushd ||
                       bifunc->bfunct == dopopd))
            t->t_dflg &= ~(F_NICE);
-       if (((t->t_dflg & F_TIME) || (t->t_dflg & F_NOFORK) == 0 &&
+       if (((t->t_dflg & F_TIME) || ((t->t_dflg & F_NOFORK) == 0 &&
             (!bifunc || t->t_dflg &
             (!bifunc || t->t_dflg &
-             (F_PIPEOUT | F_AMPERSAND | F_NICE | F_NOHUP))) ||
+             (F_PIPEOUT | F_AMPERSAND | F_NICE | F_NOHUP)))) ||
        /*
         * We have to fork for eval too.
         */
        /*
         * We have to fork for eval too.
         */
@@ -269,7 +273,7 @@ execute(t, wanttty, pipein, pipeout)
                        ignint =
                            (tpgrp == -1 &&
                             (t->t_dflg & F_NOINTERRUPT))
                        ignint =
                            (tpgrp == -1 &&
                             (t->t_dflg & F_NOINTERRUPT))
-                           || gointr && eq(gointr, STRminus);
+                           || (gointr && eq(gointr, STRminus));
                    pgrp = pcurrjob ? pcurrjob->p_jobid : getpid();
                    child++;
                    if (setintr) {
                    pgrp = pcurrjob ? pcurrjob->p_jobid : getpid();
                    child++;
                    if (setintr) {
@@ -421,11 +425,11 @@ int i;
 {
     register Char **v;
 
 {
     register Char **v;
 
-    if (v = gargv) {
+    if ((v = gargv) != NULL) {
        gargv = 0;
        xfree((ptr_t) v);
     }
        gargv = 0;
        xfree((ptr_t) v);
     }
-    if (v = pargv) {
+    if ((v = pargv) != NULL) {
        pargv = 0;
        xfree((ptr_t) v);
     }
        pargv = 0;
        xfree((ptr_t) v);
     }
index 027865d..15bcefe 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)set.c      5.19 (Berkeley) %G%";
+static char sccsid[] = "@(#)set.c      5.20 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -75,7 +75,7 @@ doset(v, t)
            hadsub++;
            p = getinx(p, &subscr);
        }
            hadsub++;
            p = getinx(p, &subscr);
        }
-       if (op = *p) {
+       if ((op = *p) != '\0') {
            *p++ = 0;
            if (*p == 0 && *v && **v == '(')
                p = *v++;
            *p++ = 0;
            if (*p == 0 && *v && **v == '(')
                p = *v++;
@@ -151,7 +151,7 @@ doset(v, t)
        else if (eq(vp, STRfilec))
            filec = 1;
 #endif
        else if (eq(vp, STRfilec))
            filec = 1;
 #endif
-    } while (p = *v++);
+    } while ((p = *v++) != NULL);
 }
 
 static Char *
 }
 
 static Char *
@@ -228,7 +228,7 @@ dolet(v, t)
        }
        if (*p == 0 && *v)
            p = *v++;
        }
        if (*p == 0 && *v)
            p = *v++;
-       if (op = *p)
+       if ((op = *p) != '\0')
            *p++ = 0;
        else
            stderror(ERR_NAME | ERR_ASSIGN);
            *p++ = 0;
        else
            stderror(ERR_NAME | ERR_ASSIGN);
@@ -279,7 +279,7 @@ dolet(v, t)
        xfree((ptr_t) vp);
        if (c != '=')
            xfree((ptr_t) p);
        xfree((ptr_t) vp);
        if (c != '=')
            xfree((ptr_t) p);
-    } while (p = *v++);
+    } while ((p = *v++) != NULL);
 }
 
 static Char *
 }
 
 static Char *
@@ -483,7 +483,7 @@ setq(name, vec, p)
     register f;
 
     f = 0;                     /* tree hangs off the header's left link */
     register f;
 
     f = 0;                     /* tree hangs off the header's left link */
-    while (c = p->v_link[f]) {
+    while ((c = p->v_link[f]) != NULL) {
        if ((f = *name - *c->v_name) == 0 &&
            (f = Strcmp(name, c->v_name)) == 0) {
            blkfree(c->vec);
        if ((f = *name - *c->v_name) == 0 &&
            (f = Strcmp(name, c->v_name)) == 0) {
            blkfree(c->vec);
@@ -531,7 +531,7 @@ unset1(v, head)
 
     while (*++v) {
        cnt = 0;
 
     while (*++v) {
        cnt = 0;
-       while (vp = madrof(*v, head->v_left))
+       while ((vp = madrof(*v, head->v_left)) != NULL)
            unsetv1(vp), cnt++;
        if (cnt == 0)
            setname(vis_str(*v));
            unsetv1(vp), cnt++;
        if (cnt == 0)
            setname(vis_str(*v));
@@ -583,7 +583,7 @@ unsetv1(p)
      */
     pp = p->v_parent;
     f = pp->v_right == p;
      */
     pp = p->v_parent;
     f = pp->v_right == p;
-    if (pp->v_link[f] = c)
+    if ((pp->v_link[f] = c) != NULL)
        c->v_parent = pp;
     /*
      * Free the deleted node, and rebalance.
        c->v_parent = pp;
     /*
      * Free the deleted node, and rebalance.
@@ -704,7 +704,7 @@ balance(p, f, d)
      * is the branch of p from which we have come; ff is the branch of pp which
      * is p.
      */
      * is the branch of p from which we have come; ff is the branch of pp which
      * is p.
      */
-    for (; pp = p->v_parent; p = pp, f = ff) {
+    for (; (pp = p->v_parent) != NULL; p = pp, f = ff) {
        ff = pp->v_right == p;
        if (f ^ d) {            /* right heavy */
            switch (p->v_bal) {
        ff = pp->v_right == p;
        if (f ^ d) {            /* right heavy */
            switch (p->v_bal) {
index c3ed6d8..0928e58 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)str.c      5.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)str.c      5.13 (Berkeley) %G%";
 #endif /* not lint */
 
 #define MALLOC_INCR    128
 #endif /* not lint */
 
 #define MALLOC_INCR    128
@@ -139,7 +139,7 @@ s_strcpy(dst, src)
     register Char *sdst;
 
     sdst = dst;
     register Char *sdst;
 
     sdst = dst;
-    while (*dst++ = *src++)
+    while ((*dst++ = *src++) != '\0')
        continue;
     return (sdst);
 }
        continue;
     return (sdst);
 }
@@ -175,7 +175,7 @@ s_strcat(dst, src)
     while (*dst++)
        continue;
     --dst;
     while (*dst++)
        continue;
     --dst;
-    while (*dst++ = *src++)
+    while ((*dst++ = *src++) != '\0')
        continue;
     return (sdst);
 }
        continue;
     return (sdst);
 }
@@ -309,7 +309,7 @@ s_strsave(s)
     for (p = s; *p++;)
        continue;
     n = p = (Char *) xmalloc((size_t) ((p - s) * sizeof(Char)));
     for (p = s; *p++;)
        continue;
     n = p = (Char *) xmalloc((size_t) ((p - s) * sizeof(Char)));
-    while (*p++ = *s++)
+    while ((*p++ = *s++) != '\0')
        continue;
     return (n);
 }
        continue;
     return (n);
 }
@@ -331,9 +331,9 @@ s_strspl(cp, dp)
        continue;
     ep = (Char *) xmalloc((size_t)
                          (((p - cp) + (q - dp) - 1) * sizeof(Char)));
        continue;
     ep = (Char *) xmalloc((size_t)
                          (((p - cp) + (q - dp) - 1) * sizeof(Char)));
-    for (p = ep, q = cp; *p++ = *q++;)
+    for (p = ep, q = cp; (*p++ = *q++) != '\0';)
        continue;
        continue;
-    for (p--, q = dp; *p++ = *q++;)
+    for (p--, q = dp; (*p++ = *q++) != '\0';)
        continue;
     return (ep);
 }
        continue;
     return (ep);
 }
index a0bcd49..9837146 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)time.c     5.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)time.c     5.16 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/types.h>
 #endif /* not lint */
 
 #include <sys/types.h>