summaryrefslogtreecommitdiffstats
path: root/bin/csh
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1997-08-07 21:42:17 +0000
committersteve <steve@FreeBSD.org>1997-08-07 21:42:17 +0000
commit8eb2ceeba6184065f9f56a6be00921df473d24f7 (patch)
tree14d11b65657d85fe0539351a66120ba544c4dda8 /bin/csh
parent717042838c948b136f885ba4c16e32cd1787b598 (diff)
downloadFreeBSD-src-8eb2ceeba6184065f9f56a6be00921df473d24f7.zip
FreeBSD-src-8eb2ceeba6184065f9f56a6be00921df473d24f7.tar.gz
Changes include: sccsid -> rcsid, bcopy -> memcpy, don't use the
register keyword, and -Wall cleaning. Obtained from: similar changes in NetBSD
Diffstat (limited to 'bin/csh')
-rw-r--r--bin/csh/Makefile22
-rw-r--r--bin/csh/alloc.c7
-rw-r--r--bin/csh/char.c7
-rw-r--r--bin/csh/const.c7
-rw-r--r--bin/csh/csh.c45
-rw-r--r--bin/csh/csh.h8
-rw-r--r--bin/csh/dir.c55
-rw-r--r--bin/csh/dol.c51
-rw-r--r--bin/csh/err.c9
-rw-r--r--bin/csh/exec.c57
-rw-r--r--bin/csh/exp.c95
-rw-r--r--bin/csh/file.c59
-rw-r--r--bin/csh/func.c105
-rw-r--r--bin/csh/glob.c33
-rw-r--r--bin/csh/hist.c21
-rw-r--r--bin/csh/init.c8
-rw-r--r--bin/csh/lex.c99
-rw-r--r--bin/csh/misc.c71
-rw-r--r--bin/csh/parse.c65
-rw-r--r--bin/csh/pathnames.h4
-rw-r--r--bin/csh/proc.c93
-rw-r--r--bin/csh/sem.c25
-rw-r--r--bin/csh/set.c98
-rw-r--r--bin/csh/str.c77
-rw-r--r--bin/csh/time.c25
25 files changed, 606 insertions, 540 deletions
diff --git a/bin/csh/Makefile b/bin/csh/Makefile
index 2bf842d..00c8c8f 100644
--- a/bin/csh/Makefile
+++ b/bin/csh/Makefile
@@ -1,5 +1,5 @@
+# $Id: Makefile,v 1.7 1997/02/22 14:01:36 peter Exp $
# @(#)Makefile 8.1 (Berkeley) 5/31/93
-# $Id$
#
# C Shell with process control; VM/UNIX VAX Makefile
# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
@@ -11,7 +11,7 @@ DFLAGS=-DBUILTIN -DFILEC -DNLS -DSHORT_STRINGS
CFLAGS+=-I${.CURDIR} -I. ${DFLAGS}
SRCS= alloc.c char.c const.c csh.c dir.c dol.c err.c exec.c exp.c file.c \
func.c glob.c hist.c init.c lex.c misc.c parse.c printf.c proc.c \
- sem.c set.c str.c time.c const.h err.h
+ sem.c set.c str.c time.c const.h errnum.h
.PATH: ${.CURDIR}/../../usr.bin/printf
MAN1= csh.1
@@ -19,17 +19,17 @@ MLINKS= csh.1 limit.1 csh.1 alias.1 csh.1 bg.1 csh.1 dirs.1 csh.1 fg.1 \
csh.1 foreach.1 csh.1 history.1 csh.1 jobs.1 csh.1 popd.1 \
csh.1 pushd.1 csh.1 rehash.1 csh.1 repeat.1 csh.1 suspend.1 \
csh.1 stop.1 csh.1 source.1
-CLEANFILES+=err.h const.h
+CLEANFILES+=const.h errnum.h
-const.h: err.h
+const.h: errnum.h
-err.h: err.c
- @rm -f $@
- @echo '/* Do not edit this file, make creates it. */' > $@
- @echo '#ifndef _h_sh_err' >> $@
- @echo '#define _h_sh_err' >> $@
- egrep 'ERR_' ${.CURDIR}/$*.c | egrep '^#define' >> $@
- @echo '#endif /* _h_sh_err */' >> $@
+errnum.h: err.c
+ @rm -f ${.TARGET}
+ @echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
+ @echo '#ifndef _h_sh_error' >> ${.TARGET}
+ @echo '#define _h_sh_error' >> ${.TARGET}
+ egrep 'ERR_' ${.ALLSRC} | egrep '^#define' >> ${.TARGET}
+ @echo '#endif /* _h_sh_error */' >> ${.TARGET}
const.h: const.c
@rm -f $@
diff --git a/bin/csh/alloc.c b/bin/csh/alloc.c
index 563c202..2fe836c 100644
--- a/bin/csh/alloc.c
+++ b/bin/csh/alloc.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)alloc.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: alloc.c,v 1.6 1997/02/22 14:01:37 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
diff --git a/bin/csh/char.c b/bin/csh/char.c
index 5e1a1e4..9ae8b21 100644
--- a/bin/csh/char.c
+++ b/bin/csh/char.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)char.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: char.c,v 1.4 1997/02/22 14:01:37 peter Exp $";
+#endif
#endif /* not lint */
#include "char.h"
diff --git a/bin/csh/const.c b/bin/csh/const.c
index dbfeed2..bf04f32 100644
--- a/bin/csh/const.c
+++ b/bin/csh/const.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)const.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: const.c,v 1.6 1997/02/22 14:01:39 peter Exp $";
+#endif
#endif /* not lint */
/*
diff --git a/bin/csh/csh.c b/bin/csh/csh.c
index a652a45..26a1c1d 100644
--- a/bin/csh/csh.c
+++ b/bin/csh/csh.c
@@ -29,18 +29,21 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
-static char copyright[] =
+static const char copyright[] =
"@(#) Copyright (c) 1980, 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
+#if 0
static char sccsid[] = "@(#)csh.c 8.2 (Berkeley) 10/12/93";
+#else
+static const char rcsid[] =
+ "$Id: csh.c,v 1.8 1997/02/22 14:01:41 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -114,10 +117,10 @@ main(argc, argv)
int argc;
char **argv;
{
- register Char *cp;
- register char *tcp;
- register int f;
- register char **tempv;
+ Char *cp;
+ char *tcp;
+ int f;
+ char **tempv;
struct sigvec osv;
cshin = stdin;
@@ -603,9 +606,9 @@ void
importpath(cp)
Char *cp;
{
- register int i = 0;
- register Char *dp;
- register Char **pv;
+ int i = 0;
+ Char *dp;
+ Char **pv;
int c;
for (dp = cp; *dp; dp++)
@@ -623,7 +626,7 @@ importpath(cp)
if ((c = *dp) == ':' || c == 0) {
*dp = 0;
if (*cp != '/' && (euid == 0 || uid == 0) &&
- (intact || intty && isatty(SHOUT)))
+ (intact || (intty && isatty(SHOUT))))
(void) fprintf(csherr,
"Warning: imported path contains relative components\n");
pv[i++] = Strsave(*cp ? cp : STRdot);
@@ -647,7 +650,7 @@ static int
srccat(cp, dp)
Char *cp, *dp;
{
- register Char *ep = Strspl(cp, dp);
+ Char *ep = Strspl(cp, dp);
char *ptr = short2str(ep);
xfree((ptr_t) ep);
@@ -662,7 +665,7 @@ srcfile(f, onlyown, flag)
char *f;
bool onlyown, flag;
{
- register int unit;
+ int unit;
if ((unit = open(f, O_RDONLY)) == -1)
return 0;
@@ -680,7 +683,7 @@ srcfile(f, onlyown, flag)
int insource;
static void
srcunit(unit, onlyown, hflg)
- register int unit;
+ int unit;
bool onlyown, hflg;
{
/* We have to push down a lot of state here */
@@ -731,7 +734,7 @@ srcunit(unit, onlyown, hflg)
if (setintr)
omask = sigblock(sigmask(SIGINT));
/* Setup the new values of the state stuff saved above */
- bcopy((char *) &B, (char *) &(saveB), sizeof(B));
+ memcpy((char *) &(saveB), (char *) &B, sizeof(B));
fbuf = NULL;
fseekp = feobp = fblocks = 0;
oSHIN = SHIN, SHIN = unit, arginp = 0, onelflg = 0;
@@ -756,7 +759,7 @@ srcunit(unit, onlyown, hflg)
if (setintr)
(void) sigsetmask(omask);
if (oSHIN >= 0) {
- register int i;
+ int i;
/* We made it to the new state... free up its storage */
/* This code could get run twice but xfree doesn't care */
@@ -765,7 +768,7 @@ srcunit(unit, onlyown, hflg)
xfree((ptr_t) fbuf);
/* Reset input arena */
- bcopy((char *) &(saveB), (char *) &B, sizeof(B));
+ memcpy((char *) &B, (char *) &(saveB), sizeof(B));
(void) close(SHIN), SHIN = oSHIN;
arginp = oarginp, onelflg = oonelflg;
@@ -1120,7 +1123,7 @@ dosource(v, t)
struct command *t;
{
- register Char *f;
+ Char *f;
bool hflg = 0;
Char buf[BUFSIZ];
@@ -1150,8 +1153,8 @@ dosource(v, t)
static void
mailchk()
{
- register struct varent *v;
- register Char **vp;
+ struct varent *v;
+ Char **vp;
time_t t;
int intvl, cnt;
struct stat stb;
@@ -1338,7 +1341,7 @@ defaultpath()
void
printprompt()
{
- register Char *cp;
+ Char *cp;
if (!whyles) {
for (cp = value(STRprompt); *cp; cp++)
diff --git a/bin/csh/csh.h b/bin/csh/csh.h
index 290262f..6e257d2 100644
--- a/bin/csh/csh.h
+++ b/bin/csh/csh.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)csh.h 8.1 (Berkeley) 5/31/93
- * $Id$
+ * $Id: csh.h,v 1.4 1997/02/22 14:01:41 peter Exp $
*/
/*
@@ -84,7 +84,7 @@ typedef void *ptr_t;
#include "const.h"
#include "char.h"
-#include "err.h"
+#include "errnum.h"
#define xmalloc(i) Malloc(i)
#define xrealloc(p, i) Realloc(p, i)
@@ -187,8 +187,8 @@ jmp_buf reslab;
#define setexit() (setjmp(reslab))
#define reset() longjmp(reslab, 1)
/* Should use structure assignment here */
-#define getexit(a) bcopy((char *)reslab, ((char *)(a)), sizeof reslab)
-#define resexit(a) bcopy((char *)(a), (char *)reslab, sizeof reslab)
+#define getexit(a) memcpy(((char *)(a)), (char *)reslab, sizeof reslab)
+#define resexit(a) memcpy((char *)reslab, (char *)(a), sizeof reslab)
Char *gointr; /* Label for an onintr transfer */
diff --git a/bin/csh/dir.c b/bin/csh/dir.c
index 49d4e8f..c9627ab 100644
--- a/bin/csh/dir.c
+++ b/bin/csh/dir.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)dir.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: dir.c,v 1.6 1997/02/22 14:01:42 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/param.h>
@@ -75,9 +78,9 @@ void
dinit(hp)
Char *hp;
{
- register char *tcp;
- register Char *cp;
- register struct directory *dp;
+ char *tcp;
+ Char *cp;
+ struct directory *dp;
char path[MAXPATHLEN];
static char *emsg = "csh: Trying to start from \"%s\"\n";
@@ -145,7 +148,7 @@ Char *dp;
* Don't call set() directly cause if the directory contains ` or
* other junk characters glob will fail.
*/
- register Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
+ Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
vec[0] = Strsave(dp);
vec[1] = 0;
@@ -203,7 +206,7 @@ dodirs(v, t)
static void
printdirs()
{
- register struct directory *dp;
+ struct directory *dp;
Char *s, *hp = value(STRhome);
int idx, len, cur;
@@ -240,7 +243,7 @@ printdirs()
void
dtildepr(home, dir)
- register Char *home, *dir;
+ Char *home, *dir;
{
if (!eq(home, STRslash) && prefix(home, dir))
@@ -340,8 +343,8 @@ dochngd(v, t)
Char **v;
struct command *t;
{
- register Char *cp;
- register struct directory *dp;
+ Char *cp;
+ struct directory *dp;
skipargs(&v, " [<dir>]");
printd = 0;
@@ -389,7 +392,7 @@ dgoto(cp)
Char *dp;
if (*cp != '/') {
- register Char *p, *q;
+ Char *p, *q;
int cwdlen;
for (p = dcwd->di_name; *p++;)
@@ -423,9 +426,9 @@ dgoto(cp)
*/
static Char *
dfollow(cp)
- register Char *cp;
+ Char *cp;
{
- register Char *dp;
+ Char *dp;
struct varent *c;
char ebuf[MAXPATHLEN];
int serrno;
@@ -449,7 +452,7 @@ dfollow(cp)
if (cp[0] != '/' && !prefix(STRdotsl, cp) && !prefix(STRdotdotsl, cp)
&& (c = adrof(STRcdpath))) {
Char **cdp;
- register Char *p;
+ Char *p;
Char buf[MAXPATHLEN];
for (cdp = c->vec; *cdp; cdp++) {
@@ -491,7 +494,7 @@ dopushd(v, t)
Char **v;
struct command *t;
{
- register struct directory *dp;
+ struct directory *dp;
skipargs(&v, " [<dir>|+<n>]");
printd = 1;
@@ -523,7 +526,7 @@ dopushd(v, t)
stderror(ERR_SYSTEM, tmp, strerror(errno));
}
else {
- register Char *ccp;
+ Char *ccp;
ccp = dfollow(*v);
dp = (struct directory *) xcalloc(sizeof(struct directory), 1);
@@ -542,11 +545,11 @@ dopushd(v, t)
*/
static struct directory *
dfind(cp)
- register Char *cp;
+ Char *cp;
{
- register struct directory *dp;
- register int i;
- register Char *ep;
+ struct directory *dp;
+ int i;
+ Char *ep;
if (*cp++ != '+')
return (0);
@@ -576,7 +579,7 @@ dopopd(v, t)
Char **v;
struct command *t;
{
- register struct directory *dp, *p = NULL;
+ struct directory *dp, *p = NULL;
skipargs(&v, " [+<n>]");
printd = 1;
@@ -614,7 +617,7 @@ dopopd(v, t)
*/
void
dfree(dp)
- register struct directory *dp;
+ struct directory *dp;
{
if (dp->di_count != 0) {
@@ -633,10 +636,10 @@ dfree(dp)
*/
Char *
dcanon(cp, p)
- register Char *cp, *p;
+ Char *cp, *p;
{
- register Char *sp;
- register Char *p1, *p2; /* general purpose */
+ Char *sp;
+ Char *p1, *p2; /* general purpose */
bool slash;
Char link[MAXPATHLEN];
@@ -923,7 +926,7 @@ dcanon(cp, p)
*/
static void
dnewcwd(dp)
- register struct directory *dp;
+ struct directory *dp;
{
dcwd = dp;
dset(dcwd->di_name);
diff --git a/bin/csh/dol.c b/bin/csh/dol.c
index 9bf6537..0286469 100644
--- a/bin/csh/dol.c
+++ b/bin/csh/dol.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)dol.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: dol.c,v 1.5 1997/02/22 14:01:47 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -105,10 +108,10 @@ static void Dtestq __P((int));
*/
void
Dfix(t)
- register struct command *t;
+ struct command *t;
{
- register Char **pp;
- register Char *p;
+ Char **pp;
+ Char *p;
if (noexec)
return;
@@ -130,7 +133,7 @@ Dfix(t)
*/
Char *
Dfix1(cp)
- register Char *cp;
+ Char *cp;
{
Char *Dv[2];
@@ -173,8 +176,8 @@ static Char *
Dpack(wbuf, wp)
Char *wbuf, *wp;
{
- register int c;
- register int i = MAXWLEN - (wp - wbuf);
+ int c;
+ int i = MAXWLEN - (wp - wbuf);
for (;;) {
c = DgetC(DODOL);
@@ -220,11 +223,11 @@ Dpack(wbuf, wp)
static int
Dword()
{
- register int c, c1;
+ int c, c1;
Char wbuf[BUFSIZ];
- register Char *wp = wbuf;
- register int i = MAXWLEN;
- register bool dolflg;
+ Char *wp = wbuf;
+ int i = MAXWLEN;
+ bool dolflg;
bool sofar = 0, done = 0;
while (!done) {
@@ -340,9 +343,9 @@ Dword()
*/
static int
DgetC(flag)
- register int flag;
+ int flag;
{
- register int c;
+ int c;
top:
if ((c = Dpeekc) != '\0') {
@@ -401,8 +404,8 @@ dolerror(s)
static void
Dgetdol()
{
- register Char *np;
- register struct varent *vp = NULL;
+ Char *np;
+ struct varent *vp = NULL;
Char name[4 * MAXVARLEN + 1];
int c, sc;
int subscr = 0, lwb = 1, upb = 0;
@@ -574,7 +577,7 @@ Dgetdol()
else if (*np != '-')
stderror(ERR_MISSING, '-');
else {
- register int i = upb;
+ int i = upb;
np++;
if (Isdigit(*np)) {
@@ -632,7 +635,7 @@ eatbrac:
static void
fixDolMod()
{
- register int c;
+ int c;
c = DgetC(0);
if (c == ':') {
@@ -691,9 +694,9 @@ fixDolMod()
static void
setDolp(cp)
- register Char *cp;
+ Char *cp;
{
- register Char *dp;
+ Char *dp;
int i;
if (dolnmod == 0 || dolmcnt == 0) {
@@ -804,7 +807,7 @@ unDredc(c)
static int
Dredc()
{
- register int c;
+ int c;
if ((c = Dpeekrd) != '\0') {
Dpeekrd = 0;
@@ -822,7 +825,7 @@ Dredc()
static void
Dtestq(c)
- register int c;
+ int c;
{
if (cmap(c, QUOTES))
@@ -839,11 +842,11 @@ void
heredoc(term)
Char *term;
{
- register int c;
+ int c;
Char *Dv[2];
Char obuf[BUFSIZ], lbuf[BUFSIZ], mbuf[BUFSIZ];
int ocnt, lcnt, mcnt;
- register Char *lbp, *obp, *mbp;
+ Char *lbp, *obp, *mbp;
Char **vp;
bool quoted;
char *tmp;
diff --git a/bin/csh/err.c b/bin/csh/err.c
index 77ae9e0..d878847 100644
--- a/bin/csh/err.c
+++ b/bin/csh/err.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: err.c,v 1.4 1997/02/22 14:01:48 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -342,7 +345,7 @@ stderror(id, va_alist)
#endif
{
va_list va;
- register Char **v;
+ Char **v;
int flags = id & ERR_FLAGS;
id &= ~ERR_FLAGS;
diff --git a/bin/csh/exec.c b/bin/csh/exec.c
index 4c3fb5e..1815eae 100644
--- a/bin/csh/exec.c
+++ b/bin/csh/exec.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: exec.c,v 1.6 1997/02/22 14:01:50 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -113,10 +116,10 @@ doexec(v, t)
Char **v;
struct command *t;
{
- register Char *dp, **pv, **av, *sav;
- register struct varent *pathv;
- register bool slash;
- register int hashval = 0, hashval1, i;
+ Char *dp, **pv, **av, *sav;
+ struct varent *pathv;
+ bool slash;
+ int hashval = 0, hashval1, i;
Char *blk[2];
/*
@@ -265,12 +268,12 @@ pexerr()
static void
texec(sf, st)
Char *sf;
- register Char **st;
+ Char **st;
{
- register char **t;
- register char *f;
- register struct varent *v;
- register Char **vp;
+ char **t;
+ char *f;
+ struct varent *v;
+ Char **vp;
Char *lastsh[2];
int fd;
unsigned char c;
@@ -361,7 +364,7 @@ texec(sf, st)
void
execash(t, kp)
Char **t;
- register struct command *kp;
+ struct command *kp;
{
int saveIN, saveOUT, saveDIAG, saveSTD;
int oSHIN;
@@ -446,8 +449,8 @@ dohash(v, t)
struct command *t;
{
DIR *dirp;
- register struct dirent *dp;
- register int cnt;
+ struct dirent *dp;
+ int cnt;
int i = 0;
struct varent *pathv = adrof(STRpath);
Char **pv;
@@ -504,9 +507,9 @@ hashstat(v, t)
*/
static int
hashname(cp)
- register Char *cp;
+ Char *cp;
{
- register long h = 0;
+ long h = 0;
while (*cp)
h = hash(h, *cp++);
@@ -517,11 +520,11 @@ static int
iscommand(name)
Char *name;
{
- register Char **pv;
- register Char *sav;
- register struct varent *v;
- register bool slash = any(short2str(name), '/');
- register int hashval = 0, hashval1, i;
+ Char **pv;
+ Char *sav;
+ struct varent *v;
+ bool slash = any(short2str(name), '/');
+ int hashval = 0, hashval1, i;
v = adrof(STRpath);
if (v == 0 || v->vec[0] == 0 || slash)
@@ -618,7 +621,7 @@ executable(dir, name, dir_ok)
/*ARGSUSED*/
void
dowhich(v, c)
- register Char **v;
+ Char **v;
struct command *c;
{
struct wordent lex[3];
@@ -652,9 +655,9 @@ static void
tellmewhat(lex)
struct wordent *lex;
{
- register int i;
- register struct biltins *bptr;
- register struct wordent *sp = lex->next;
+ int i;
+ struct biltins *bptr;
+ struct wordent *sp = lex->next;
bool aliased = 0;
Char *s0, *s1, *s2, *cmd;
Char qc;
@@ -706,8 +709,8 @@ tellmewhat(lex)
sp->word = cmd = globone(sp->word, G_IGNORE);
if ((i = iscommand(strip(sp->word))) != 0) {
- register Char **pv;
- register struct varent *v;
+ Char **pv;
+ struct varent *v;
bool slash = any(short2str(sp->word), '/');
v = adrof(STRpath);
diff --git a/bin/csh/exp.c b/bin/csh/exp.c
index ff484ce..8d163cf 100644
--- a/bin/csh/exp.c
+++ b/bin/csh/exp.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)exp.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: exp.c,v 1.4 1997/02/22 14:01:52 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -91,23 +94,23 @@ static void etraci __P((char *, int, Char ***));
int
expr(vp)
- register Char ***vp;
+ Char ***vp;
{
return (exp0(vp, 0));
}
int
exp0(vp, ignore)
- register Char ***vp;
+ Char ***vp;
bool ignore;
{
- register int p1 = exp1(vp, ignore);
+ int p1 = exp1(vp, ignore);
#ifdef EDEBUG
etraci("exp0 p1", p1, vp);
#endif
if (**vp && eq(**vp, STRor2)) {
- register int p2;
+ int p2;
(*vp)++;
p2 = exp0(vp, (ignore & IGNORE) || p1);
@@ -121,16 +124,16 @@ exp0(vp, ignore)
static int
exp1(vp, ignore)
- register Char ***vp;
+ Char ***vp;
bool ignore;
{
- register int p1 = exp2(vp, ignore);
+ int p1 = exp2(vp, ignore);
#ifdef EDEBUG
etraci("exp1 p1", p1, vp);
#endif
if (**vp && eq(**vp, STRand2)) {
- register int p2;
+ int p2;
(*vp)++;
p2 = exp1(vp, (ignore & IGNORE) || !p1);
@@ -144,16 +147,16 @@ exp1(vp, ignore)
static int
exp2(vp, ignore)
- register Char ***vp;
+ Char ***vp;
bool ignore;
{
- register int p1 = exp2a(vp, ignore);
+ int p1 = exp2a(vp, ignore);
#ifdef EDEBUG
etraci("exp3 p1", p1, vp);
#endif
if (**vp && eq(**vp, STRor)) {
- register int p2;
+ int p2;
(*vp)++;
p2 = exp2(vp, ignore);
@@ -167,16 +170,16 @@ exp2(vp, ignore)
static int
exp2a(vp, ignore)
- register Char ***vp;
+ Char ***vp;
bool ignore;
{
- register int p1 = exp2b(vp, ignore);
+ int p1 = exp2b(vp, ignore);
#ifdef EDEBUG
etraci("exp2a p1", p1, vp);
#endif
if (**vp && eq(**vp, STRcaret)) {
- register int p2;
+ int p2;
(*vp)++;
p2 = exp2a(vp, ignore);
@@ -190,16 +193,16 @@ exp2a(vp, ignore)
static int
exp2b(vp, ignore)
- register Char ***vp;
+ Char ***vp;
bool ignore;
{
- register int p1 = exp2c(vp, ignore);
+ int p1 = exp2c(vp, ignore);
#ifdef EDEBUG
etraci("exp2b p1", p1, vp);
#endif
if (**vp && eq(**vp, STRand)) {
- register int p2;
+ int p2;
(*vp)++;
p2 = exp2b(vp, ignore);
@@ -213,12 +216,12 @@ exp2b(vp, ignore)
static int
exp2c(vp, ignore)
- register Char ***vp;
+ Char ***vp;
bool ignore;
{
- register Char *p1 = exp3(vp, ignore);
- register Char *p2;
- register int i;
+ Char *p1 = exp3(vp, ignore);
+ Char *p2;
+ int i;
#ifdef EDEBUG
etracc("exp2c p1", p1, vp);
@@ -261,11 +264,11 @@ exp2c(vp, ignore)
static Char *
exp3(vp, ignore)
- register Char ***vp;
+ Char ***vp;
bool ignore;
{
- register Char *p1, *p2;
- register int i;
+ Char *p1, *p2;
+ int i;
p1 = exp3a(vp, ignore);
#ifdef EDEBUG
@@ -307,11 +310,11 @@ exp3(vp, ignore)
static Char *
exp3a(vp, ignore)
- register Char ***vp;
+ Char ***vp;
bool ignore;
{
- register Char *p1, *p2, *op;
- register int i;
+ Char *p1, *p2, *op;
+ int i;
p1 = exp4(vp, ignore);
#ifdef EDEBUG
@@ -337,18 +340,18 @@ exp3a(vp, ignore)
static Char *
exp4(vp, ignore)
- register Char ***vp;
+ Char ***vp;
bool ignore;
{
- register Char *p1, *p2;
- register int i = 0;
+ Char *p1, *p2;
+ int i = 0;
p1 = exp5(vp, ignore);
#ifdef EDEBUG
etracc("exp4 p1", p1, vp);
#endif
if (isa(**vp, ADDOP)) {
- register Char *op = *(*vp)++;
+ Char *op = *(*vp)++;
p2 = exp4(vp, ignore);
#ifdef EDEBUG
@@ -374,18 +377,18 @@ exp4(vp, ignore)
static Char *
exp5(vp, ignore)
- register Char ***vp;
+ Char ***vp;
bool ignore;
{
- register Char *p1, *p2;
- register int i = 0;
+ Char *p1, *p2;
+ int i = 0;
p1 = exp6(vp, ignore);
#ifdef EDEBUG
etracc("exp5 p1", p1, vp);
#endif
if (isa(**vp, MULOP)) {
- register Char *op = *(*vp)++;
+ Char *op = *(*vp)++;
p2 = exp5(vp, ignore);
#ifdef EDEBUG
@@ -421,11 +424,11 @@ exp5(vp, ignore)
static Char *
exp6(vp, ignore)
- register Char ***vp;
+ Char ***vp;
bool ignore;
{
int ccode, i = 0;
- register Char *cp, *dp, *ep;
+ Char *cp, *dp, *ep;
if (**vp == 0)
stderror(ERR_NAME | ERR_EXPRESSION);
@@ -461,7 +464,7 @@ exp6(vp, ignore)
return (putn(ccode));
}
if (eq(**vp, STRLbrace)) {
- register Char **v;
+ Char **v;
struct command faket;
Char *fakecom[2];
@@ -600,18 +603,18 @@ exp6(vp, ignore)
static void
evalav(v)
- register Char **v;
+ Char **v;
{
struct wordent paraml1;
- register struct wordent *hp = &paraml1;
+ struct wordent *hp = &paraml1;
struct command *t;
- register struct wordent *wdp = hp;
+ struct wordent *wdp = hp;
set(STRstatus, Strsave(STR0));
hp->prev = hp->next = hp;
hp->word = STRNULL;
while (*v) {
- register struct wordent *new =
+ struct wordent *new =
(struct wordent *) xcalloc(1, sizeof *wdp);
new->prev = wdp;
@@ -631,8 +634,8 @@ evalav(v)
static int
isa(cp, what)
- register Char *cp;
- register int what;
+ Char *cp;
+ int what;
{
if (cp == 0)
return ((what & RESTOP) != 0);
@@ -680,7 +683,7 @@ isa(cp, what)
static int
egetn(cp)
- register Char *cp;
+ Char *cp;
{
if (*cp && *cp != '-' && !Isdigit(*cp))
stderror(ERR_NAME | ERR_EXPRESSION);
diff --git a/bin/csh/file.c b/bin/csh/file.c
index f680263..5ef709c 100644
--- a/bin/csh/file.c
+++ b/bin/csh/file.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)file.c 8.2 (Berkeley) 3/19/94";
+#else
+static const char rcsid[] =
+ "$Id: file.c,v 1.6 1997/02/22 14:01:54 peter Exp $";
+#endif
#endif /* not lint */
#ifdef FILEC
@@ -160,7 +163,7 @@ static void
pushback(string)
Char *string;
{
- register Char *p;
+ Char *p;
struct termios tty, tty_normal;
int omask;
char c;
@@ -184,8 +187,8 @@ pushback(string)
*/
static void
catn(des, src, count)
- register Char *des, *src;
- register int count;
+ Char *des, *src;
+ int count;
{
while (--count >= 0 && *des)
des++;
@@ -201,8 +204,8 @@ catn(des, src, count)
*/
static void
copyn(des, src, count)
- register Char *des, *src;
- register int count;
+ Char *des, *src;
+ int count;
{
while (--count >= 0)
if ((*des++ = *src++) == 0)
@@ -251,7 +254,7 @@ print_by_column(dir, items, count)
Char *dir, *items[];
int count;
{
- register int i, rows, r, c, maxwidth = 0, columns;
+ int i, rows, r, c, maxwidth = 0, columns;
if (ioctl(SHOUT, TIOCGWINSZ, (ioctl_t) & win) < 0 || win.ws_col == 0)
win.ws_col = 80;
@@ -266,7 +269,7 @@ print_by_column(dir, items, count)
for (c = 0; c < columns; c++) {
i = c * rows + r;
if (i < count) {
- register int w;
+ int w;
(void) fprintf(cshout, "%s", vis_str(items[i]));
(void) fputc(dir ? filetype(dir, items[i]) : ' ', cshout);
@@ -292,8 +295,8 @@ static Char *
tilde(new, old)
Char *new, *old;
{
- register Char *o, *p;
- register struct passwd *pw;
+ Char *o, *p;
+ struct passwd *pw;
static Char person[40];
if (old[0] != '~')
@@ -375,7 +378,7 @@ static void
extract_dir_and_name(path, dir, name)
Char *path, *dir, *name;
{
- register Char *p;
+ Char *p;
p = Strrchr(path, '/');
if (p == NULL) {
@@ -393,8 +396,8 @@ getentry(dir_fd, looking_for_lognames)
DIR *dir_fd;
int looking_for_lognames;
{
- register struct passwd *pw;
- register struct dirent *dirp;
+ struct passwd *pw;
+ struct dirent *dirp;
if (looking_for_lognames) {
if ((pw = getpwent()) == NULL)
@@ -408,9 +411,9 @@ getentry(dir_fd, looking_for_lognames)
static void
free_items(items)
- register Char **items;
+ Char **items;
{
- register int i;
+ int i;
for (i = 0; items[i]; i++)
xfree((ptr_t) items[i]);
@@ -436,9 +439,9 @@ tsearch(word, command, max_word_length)
int max_word_length;
{
static Char **items = NULL;
- register DIR *dir_fd;
- register numitems = 0, ignoring = TRUE, nignored = 0;
- register name_length, looking_for_lognames;
+ DIR *dir_fd;
+ int numitems = 0, ignoring = TRUE, nignored = 0;
+ int name_length, looking_for_lognames;
Char tilded_dir[MAXPATHLEN + 1], dir[MAXPATHLEN + 1];
Char name[MAXNAMLEN + 1], extended_name[MAXNAMLEN + 1];
Char *entry;
@@ -547,8 +550,8 @@ recognize(extended_name, entry, name_length, numitems)
if (numitems == 1) /* 1st match */
copyn(extended_name, entry, MAXNAMLEN);
else { /* 2nd & subsequent matches */
- register Char *x, *ent;
- register int len = 0;
+ Char *x, *ent;
+ int len = 0;
x = extended_name;
for (ent = entry; *x && *x == *ent++; x++, len++)
@@ -567,7 +570,7 @@ recognize(extended_name, entry, name_length, numitems)
*/
static int
is_prefix(check, template)
- register Char *check, *template;
+ Char *check, *template;
{
do
if (*check == 0)
@@ -584,7 +587,7 @@ static int
is_suffix(check, template)
Char *check, *template;
{
- register Char *c, *t;
+ Char *c, *t;
for (c = check; *c++;)
continue;
@@ -603,7 +606,7 @@ tenex(inputline, inputline_size)
Char *inputline;
int inputline_size;
{
- register int numitems, num_read;
+ int numitems, num_read;
char tinputline[BUFSIZ];
@@ -613,8 +616,8 @@ tenex(inputline, inputline_size)
int i;
static Char delims[] = {' ', '\'', '"', '\t', ';', '&', '<',
'>', '(', ')', '|', '^', '%', '\0'};
- register Char *str_end, *word_start, last_Char, should_retype;
- register int space_left;
+ Char *str_end, *word_start, last_Char, should_retype;
+ int space_left;
COMMAND command;
for (i = 0; i < num_read; i++)
@@ -671,10 +674,10 @@ tenex(inputline, inputline_size)
static int
ignored(entry)
- register Char *entry;
+ Char *entry;
{
struct varent *vp;
- register Char **cp;
+ Char **cp;
if ((vp = adrof(STRfignore)) == NULL || (cp = vp->vec) == NULL)
return (FALSE);
diff --git a/bin/csh/func.c b/bin/csh/func.c
index 2d2a7fb..d3b4714 100644
--- a/bin/csh/func.c
+++ b/bin/csh/func.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)func.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: func.c,v 1.7 1997/02/22 14:01:55 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -72,8 +75,8 @@ struct biltins *
isbfunc(t)
struct command *t;
{
- register Char *cp = t->t_dcom[0];
- register struct biltins *bp, *bp1, *bp2;
+ Char *cp = t->t_dcom[0];
+ struct biltins *bp, *bp1, *bp2;
static struct biltins label = {"", dozip, 0, 0};
static struct biltins foregnd = {"%job", dofg1, 0, 0};
static struct biltins backgnd = {"%job &", dobg1, 0, 0};
@@ -96,7 +99,7 @@ isbfunc(t)
* one past the end.
*/
for (bp1 = bfunc, bp2 = bfunc + nbfunc; bp1 < bp2;) {
- register i;
+ int i;
bp = bp1 + ((bp2 - bp1) >> 1);
if ((i = *cp - *bp->bname) == 0 &&
@@ -112,8 +115,8 @@ isbfunc(t)
void
func(t, bp)
- register struct command *t;
- register struct biltins *bp;
+ struct command *t;
+ struct biltins *bp;
{
int i;
@@ -133,8 +136,8 @@ doonintr(v, t)
Char **v;
struct command *t;
{
- register Char *cp;
- register Char *vv = v[1];
+ Char *cp;
+ Char *vv = v[1];
if (parintr == SIG_IGN)
return;
@@ -194,8 +197,8 @@ doalias(v, t)
Char **v;
struct command *t;
{
- register struct varent *vp;
- register Char *p;
+ struct varent *vp;
+ Char *p;
v++;
p = *v++;
@@ -265,8 +268,8 @@ doif(v, kp)
Char **v;
struct command *kp;
{
- register int i;
- register Char **vv;
+ int i;
+ Char **vv;
v++;
i = expr(&v);
@@ -302,7 +305,7 @@ doif(v, kp)
*/
static void
reexecute(kp)
- register struct command *kp;
+ struct command *kp;
{
kp->t_dflg &= F_SAVE;
kp->t_dflg |= F_REPEAT;
@@ -339,7 +342,7 @@ void
gotolab(lab)
Char *lab;
{
- register struct whyle *wp;
+ struct whyle *wp;
/*
* While we still can, locate any unknown ends of existing loops. This
* obscure code is the WORST result of the fact that we don't really parse.
@@ -365,7 +368,7 @@ doswitch(v, t)
Char **v;
struct command *t;
{
- register Char *cp, *lp;
+ Char *cp, *lp;
v++;
if (!*v || *(*v++) != '(')
@@ -419,8 +422,8 @@ doforeach(v, t)
Char **v;
struct command *t;
{
- register Char *cp, *sp;
- register struct whyle *nwp;
+ Char *cp, *sp;
+ struct whyle *nwp;
v++;
sp = cp = strip(*v);
@@ -463,8 +466,8 @@ dowhile(v, t)
Char **v;
struct command *t;
{
- register int status;
- register bool again = whyles != 0 && SEEKEQ(&whyles->w_start, &lineloc) &&
+ int status;
+ bool again = whyles != 0 && SEEKEQ(&whyles->w_start, &lineloc) &&
whyles->w_fename == 0;
v++;
@@ -479,7 +482,7 @@ dowhile(v, t)
if (*v)
stderror(ERR_NAME | ERR_EXPRESSION);
if (!again) {
- register struct whyle *nwp =
+ struct whyle *nwp =
(struct whyle *) xcalloc(1, sizeof(*nwp));
nwp->w_start = lineloc;
@@ -564,8 +567,8 @@ dorepeat(v, kp)
Char **v;
struct command *kp;
{
- register int i;
- register sigset_t omask = 0;
+ int i;
+ sigset_t omask = 0;
i = getn(v[1]);
if (setintr)
@@ -593,10 +596,10 @@ doswbrk(v, t)
int
srchx(cp)
- register Char *cp;
+ Char *cp;
{
- register struct srch *sp, *sp1, *sp2;
- register i;
+ struct srch *sp, *sp1, *sp2;
+ int i;
/*
* Binary search Sp1 is the beginning of the current search range. Sp2 is
@@ -622,12 +625,12 @@ static Char *Sgoal;
static void
search(type, level, goal)
int type;
- register int level;
+ int level;
Char *goal;
{
Char wordbuf[BUFSIZ];
- register Char *aword = wordbuf;
- register Char *cp;
+ Char *aword = wordbuf;
+ Char *cp;
Stype = type;
Sgoal = goal;
@@ -722,10 +725,10 @@ search(type, level, goal)
static int
getword(wp)
- register Char *wp;
+ Char *wp;
{
- register int found = 0;
- register int c, d;
+ int found = 0;
+ int c, d;
int kwd = 0;
Char *owp = wp;
@@ -851,7 +854,7 @@ wfree()
btell(&o);
for (; whyles; whyles = nwp) {
- register struct whyle *wp = whyles;
+ struct whyle *wp = whyles;
nwp = wp->w_next;
/*
@@ -901,9 +904,9 @@ doglob(v, t)
static void
xecho(sep, v)
int sep;
- register Char **v;
+ Char **v;
{
- register Char *cp;
+ Char *cp;
int nonl = 0;
if (setintr)
@@ -924,7 +927,7 @@ xecho(sep, v)
if (sep == ' ' && *v && eq(*v, STRmn))
nonl++, v++;
while ((cp = *v++) != NULL) {
- register int c;
+ int c;
while ((c = *cp++) != '\0')
(void) vis_fputc(c | QUOTE, cshout);
@@ -952,7 +955,7 @@ dosetenv(v, t)
v++;
if ((vp = *v++) == 0) {
- register Char **ep;
+ Char **ep;
if (setintr)
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
@@ -1045,8 +1048,8 @@ void
Setenv(name, val)
Char *name, *val;
{
- register Char **ep = STR_environ;
- register Char *cp, *dp;
+ Char **ep = STR_environ;
+ Char *cp, *dp;
Char *blk[2];
Char **oep = ep;
@@ -1078,8 +1081,8 @@ static void
Unsetenv(name)
Char *name;
{
- register Char **ep = STR_environ;
- register Char *cp, *dp;
+ Char **ep = STR_environ;
+ Char *cp, *dp;
Char **oep = ep;
for (; *ep; ep++) {
@@ -1104,8 +1107,8 @@ doumask(v, t)
Char **v;
struct command *t;
{
- register Char *cp = v[1];
- register int i;
+ Char *cp = v[1];
+ int i;
if (cp == 0) {
i = umask(0);
@@ -1151,7 +1154,7 @@ static struct limits *
findlim(cp)
Char *cp;
{
- register struct limits *lp, *res;
+ struct limits *lp, *res;
res = (struct limits *) NULL;
for (lp = limits; lp->limconst >= 0; lp++)
@@ -1173,8 +1176,8 @@ dolimit(v, t)
Char **v;
struct command *t;
{
- register struct limits *lp;
- register RLIM_TYPE limit;
+ struct limits *lp;
+ RLIM_TYPE limit;
char hard = 0;
v++;
@@ -1199,10 +1202,10 @@ dolimit(v, t)
static RLIM_TYPE
getval(lp, v)
- register struct limits *lp;
+ struct limits *lp;
Char **v;
{
- register float f;
+ float f;
double atof();
Char *cp = *v++;
@@ -1283,7 +1286,7 @@ limtail(cp, str)
/*ARGSUSED*/
static void
plim(lp, hard)
- register struct limits *lp;
+ struct limits *lp;
Char hard;
{
struct rlimit rlim;
@@ -1310,7 +1313,7 @@ dounlimit(v, t)
Char **v;
struct command *t;
{
- register struct limits *lp;
+ struct limits *lp;
int lerr = 0;
Char hard = 0;
@@ -1336,7 +1339,7 @@ dounlimit(v, t)
static int
setlim(lp, hard, limit)
- register struct limits *lp;
+ struct limits *lp;
Char hard;
RLIM_TYPE limit;
{
diff --git a/bin/csh/glob.c b/bin/csh/glob.c
index 0d059ee..1f0f109 100644
--- a/bin/csh/glob.c
+++ b/bin/csh/glob.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)glob.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: glob.c,v 1.8 1997/02/22 14:01:58 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/param.h>
@@ -553,10 +556,10 @@ ginit()
void
rscan(t, f)
- register Char **t;
+ Char **t;
void (*f) ();
{
- register Char *p;
+ Char *p;
while ((p = *t++) != NULL)
while (*p)
@@ -565,9 +568,9 @@ rscan(t, f)
void
trim(t)
- register Char **t;
+ Char **t;
{
- register Char *p;
+ Char *p;
while ((p = *t++) != NULL)
while (*p)
@@ -576,9 +579,9 @@ trim(t)
void
tglob(t)
- register Char **t;
+ Char **t;
{
- register Char *p, c;
+ Char *p, c;
while ((p = *t++) != NULL) {
if (*p == '~' || *p == '=')
@@ -622,7 +625,7 @@ dobackp(cp, literal)
Char *cp;
bool literal;
{
- register Char *lp, *rp;
+ Char *lp, *rp;
Char *ep, word[MAXPATHLEN];
if (pargv) {
@@ -667,8 +670,8 @@ backeval(cp, literal)
Char *cp;
bool literal;
{
- register int icnt, c;
- register Char *ip;
+ int icnt, c;
+ Char *ip;
struct command faket;
bool hadnl;
int pvec[2], quoted;
@@ -851,9 +854,9 @@ Gmatch(string, pattern)
static int
pmatch(string, pattern)
- register Char *string, *pattern;
+ Char *string, *pattern;
{
- register Char stringc, patternc;
+ Char stringc, patternc;
int match, negate_range;
Char rangec;
@@ -910,7 +913,7 @@ void
Gcat(s1, s2)
Char *s1, *s2;
{
- register Char *p, *q;
+ Char *p, *q;
int n;
for (p = s1; *p++;)
@@ -934,7 +937,7 @@ Gcat(s1, s2)
#ifdef FILEC
int
sortscmp(a, b)
- register const ptr_t a, b;
+ const ptr_t a, b;
{
#if defined(NLS) && !defined(NOSTRCOLL)
char buf[2048];
diff --git a/bin/csh/hist.c b/bin/csh/hist.c
index c90dd66..fcc565d 100644
--- a/bin/csh/hist.c
+++ b/bin/csh/hist.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: hist.c,v 1.4 1997/02/22 14:01:59 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -56,8 +59,8 @@ void
savehist(sp)
struct wordent *sp;
{
- register struct Hist *hp, *np;
- register int histlen = 0;
+ struct Hist *hp, *np;
+ int histlen = 0;
Char *cp;
/* throw away null lines */
@@ -65,7 +68,7 @@ savehist(sp)
return;
cp = value(STRhistory);
if (*cp) {
- register Char *p = cp;
+ Char *p = cp;
while (*p) {
if (!Isdigit(*p)) {
@@ -86,10 +89,10 @@ savehist(sp)
struct Hist *
enthist(event, lp, docopy)
int event;
- register struct wordent *lp;
+ struct wordent *lp;
bool docopy;
{
- register struct Hist *np;
+ struct Hist *np;
np = (struct Hist *) xmalloc((size_t) sizeof(*np));
np->Hnum = np->Href = event;
@@ -109,7 +112,7 @@ enthist(event, lp, docopy)
static void
hfree(hp)
- register struct Hist *hp;
+ struct Hist *hp;
{
freelex(&hp->Hlex);
@@ -177,7 +180,7 @@ dohist1(hp, np, rflg, hflg)
static void
phist(hp, hflg)
- register struct Hist *hp;
+ struct Hist *hp;
int hflg;
{
if (hflg == 0)
diff --git a/bin/csh/init.c b/bin/csh/init.c
index cee64c6..e74bec3 100644
--- a/bin/csh/init.c
+++ b/bin/csh/init.c
@@ -29,13 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
-/*###9 [cc] warning: `sccsid' defined but not used%%%*/
+#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: init.c,v 1.4 1997/02/22 14:02:00 peter Exp $";
+#endif
#endif /* not lint */
#if __STDC__
diff --git a/bin/csh/lex.c b/bin/csh/lex.c
index f9a7f0c..fac2b7e 100644
--- a/bin/csh/lex.c
+++ b/bin/csh/lex.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)lex.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: lex.c,v 1.6 1997/02/22 14:02:01 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -142,9 +145,9 @@ static Char getCtmp;
int
lex(hp)
- register struct wordent *hp;
+ struct wordent *hp;
{
- register struct wordent *wdp;
+ struct wordent *wdp;
int c;
btell(&lineloc);
@@ -165,7 +168,7 @@ lex(hp)
* be ready and rarin to go even if it is interrupted.
*/
do {
- register struct wordent *new;
+ struct wordent *new;
new = (struct wordent *) xmalloc((size_t) sizeof(*wdp));
new->word = 0;
@@ -184,7 +187,7 @@ prlex(fp, sp0)
FILE *fp;
struct wordent *sp0;
{
- register struct wordent *sp = sp0->next;
+ struct wordent *sp = sp0->next;
for (;;) {
(void) fprintf(fp, "%s", vis_str(sp->word));
@@ -198,15 +201,15 @@ prlex(fp, sp0)
void
copylex(hp, fp)
- register struct wordent *hp;
- register struct wordent *fp;
+ struct wordent *hp;
+ struct wordent *fp;
{
- register struct wordent *wdp;
+ struct wordent *wdp;
wdp = hp;
fp = fp->next;
do {
- register struct wordent *new;
+ struct wordent *new;
new = (struct wordent *) xmalloc((size_t) sizeof(*wdp));
new->prev = wdp;
@@ -221,9 +224,9 @@ copylex(hp, fp)
void
freelex(vp)
- register struct wordent *vp;
+ struct wordent *vp;
{
- register struct wordent *fp;
+ struct wordent *fp;
while (vp->next != vp) {
fp = vp->next;
@@ -237,11 +240,11 @@ freelex(vp)
static Char *
word()
{
- register Char c, c1;
- register Char *wp;
+ Char c, c1;
+ Char *wp;
Char wbuf[BUFSIZ];
- register bool dolflg;
- register int i;
+ bool dolflg;
+ int i;
wp = wbuf;
i = BUFSIZ - 4;
@@ -358,9 +361,9 @@ ret:
static int
getC1(flag)
- register int flag;
+ int flag;
{
- register Char c;
+ Char c;
while (1) {
if ((c = peekc) != '\0') {
@@ -416,9 +419,9 @@ getC1(flag)
static void
getdol()
{
- register Char *np, *ep;
+ Char *np, *ep;
Char name[4 * MAXVARLEN + 1];
- register int c;
+ int c;
int sc;
bool special = 0, toolong;
@@ -650,9 +653,9 @@ static void
getexcl(sc)
int sc;
{
- register struct wordent *hp, *ip;
+ struct wordent *hp, *ip;
int left, right, dol;
- register int c;
+ int c;
if (sc == 0) {
sc = getC(0);
@@ -727,9 +730,9 @@ static struct wordent *
getsub(en)
struct wordent *en;
{
- register Char *cp;
+ Char *cp;
int delim;
- register int c;
+ int c;
int sc;
bool global;
Char orhsb[sizeof(rhsb) / sizeof(Char)];
@@ -872,12 +875,12 @@ dosub(sc, en, global)
struct wordent lexi;
bool didsub = 0, didone = 0;
struct wordent *hp = &lexi;
- register struct wordent *wdp;
- register int i = exclc;
+ struct wordent *wdp;
+ int i = exclc;
wdp = hp;
while (--i >= 0) {
- register struct wordent *new =
+ struct wordent *new =
(struct wordent *) xcalloc(1, sizeof *wdp);
new->word = 0;
@@ -924,8 +927,8 @@ subword(cp, type, adid)
bool *adid;
{
Char wbuf[BUFSIZ];
- register Char *wp, *mp, *np;
- register int i;
+ Char *wp, *mp, *np;
+ int i;
*adid = 0;
switch (type) {
@@ -996,8 +999,8 @@ domod(cp, type)
Char *cp;
int type;
{
- register Char *wp, *xp;
- register int c;
+ Char *wp, *xp;
+ int c;
switch (type) {
@@ -1042,7 +1045,7 @@ domod(cp, type)
static int
matchs(str, pat)
- register Char *str, *pat;
+ Char *str, *pat;
{
while (*str && *pat && *str == *pat)
str++, pat++;
@@ -1051,11 +1054,11 @@ matchs(str, pat)
static int
getsel(al, ar, dol)
- register int *al, *ar;
+ int *al, *ar;
int dol;
{
- register int c = getC(0);
- register int i;
+ int c = getC(0);
+ int i;
bool first = *al < 0;
switch (c) {
@@ -1139,9 +1142,9 @@ static struct wordent *
gethent(sc)
int sc;
{
- register struct Hist *hp;
- register Char *np;
- register int c;
+ struct Hist *hp;
+ Char *np;
+ int c;
int event;
bool back = 0;
@@ -1258,12 +1261,12 @@ findev(cp, anyarg)
Char *cp;
bool anyarg;
{
- register struct Hist *hp;
+ struct Hist *hp;
for (hp = Histlist.Hnext; hp; hp = hp->Hnext) {
Char *dp;
- register Char *p, *q;
- register struct wordent *lp = hp->Hlex.next;
+ Char *p, *q;
+ struct wordent *lp = hp->Hlex.next;
int argno = 0;
/*
@@ -1307,7 +1310,7 @@ findev(cp, anyarg)
static void
setexclp(cp)
- register Char *cp;
+ Char *cp;
{
if (cp && cp[0] == '\n')
return;
@@ -1325,7 +1328,7 @@ int
readc(wanteof)
bool wanteof;
{
- register int c;
+ int c;
static sincereal;
aret = F_SEEK;
@@ -1440,10 +1443,10 @@ reread:
static int
bgetc()
{
- register int buf, off, c;
+ int buf, off, c;
#ifdef FILEC
- register int numleft = 0, roomleft;
+ int numleft = 0, roomleft;
Char ttyline[BUFSIZ];
#endif
char tbuf[BUFSIZ + 1];
@@ -1474,7 +1477,7 @@ bgetc()
again:
buf = (int) fseekp / BUFSIZ;
if (buf >= fblocks) {
- register Char **nfbuf =
+ Char **nfbuf =
(Char **) xcalloc((size_t) (fblocks + 2),
sizeof(Char **));
@@ -1505,7 +1508,7 @@ again:
goto again;
}
if (c > 0)
- bcopy(ttyline, fbuf[buf] + off, c * sizeof(Char));
+ memcpy(fbuf[buf] + off, ttyline, c * sizeof(Char));
numleft = 0;
}
else {
@@ -1549,7 +1552,7 @@ again:
static void
bfree()
{
- register int sb, i;
+ int sb, i;
if (cantell)
return;
diff --git a/bin/csh/misc.c b/bin/csh/misc.c
index 70aa7af..67a9437 100644
--- a/bin/csh/misc.c
+++ b/bin/csh/misc.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: misc.c,v 1.5 1997/02/22 14:02:02 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/param.h>
@@ -53,8 +56,8 @@ static int renum __P((int, int));
int
any(s, c)
- register char *s;
- register int c;
+ char *s;
+ int c;
{
if (!s)
return (0); /* Check for nil pointer */
@@ -77,10 +80,10 @@ setzero(cp, i)
char *
strsave(s)
- register char *s;
+ char *s;
{
char *n;
- register char *p;
+ char *p;
if (s == NULL)
s = "";
@@ -94,7 +97,7 @@ strsave(s)
Char **
blkend(up)
- register Char **up;
+ Char **up;
{
while (*up)
@@ -106,7 +109,7 @@ blkend(up)
void
blkpr(fp, av)
FILE *fp;
- register Char **av;
+ Char **av;
{
for (; *av; av++) {
@@ -118,9 +121,9 @@ blkpr(fp, av)
int
blklen(av)
- register Char **av;
+ Char **av;
{
- register int i = 0;
+ int i = 0;
while (*av++)
i++;
@@ -130,9 +133,9 @@ blklen(av)
Char **
blkcpy(oav, bv)
Char **oav;
- register Char **bv;
+ Char **bv;
{
- register Char **av = oav;
+ Char **av = oav;
while ((*av++ = *bv++) != NULL)
continue;
@@ -152,7 +155,7 @@ void
blkfree(av0)
Char **av0;
{
- register Char **av = av0;
+ Char **av = av0;
if (!av0)
return;
@@ -163,9 +166,9 @@ blkfree(av0)
Char **
saveblk(v)
- register Char **v;
+ Char **v;
{
- register Char **newv =
+ Char **newv =
(Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **));
Char **onewv = newv;
@@ -177,11 +180,11 @@ saveblk(v)
#ifdef NOTUSED
char *
strstr(s, t)
- register char *s, *t;
+ char *s, *t;
{
do {
- register char *ss = s;
- register char *tt = t;
+ char *ss = s;
+ char *tt = t;
do
if (*tt == '\0')
@@ -199,7 +202,7 @@ strspl(cp, dp)
char *cp, *dp;
{
char *ep;
- register char *p, *q;
+ char *p, *q;
if (!cp)
cp = "";
@@ -221,9 +224,9 @@ strspl(cp, dp)
Char **
blkspl(up, vp)
- register Char **up, **vp;
+ Char **up, **vp;
{
- register Char **wp =
+ Char **wp =
(Char **) xcalloc((size_t) (blklen(up) + blklen(vp) + 1),
sizeof(Char **));
@@ -233,7 +236,7 @@ blkspl(up, vp)
Char
lastchr(cp)
- register Char *cp;
+ Char *cp;
{
if (!cp)
@@ -252,7 +255,7 @@ lastchr(cp)
void
closem()
{
- register int f, flimit;
+ int f, flimit;
for (f = 0, flimit = getdtablesize(); f < flimit; f++)
if (f != SHIN && f != SHOUT && f != SHERR && f != OLDSTD &&
@@ -277,7 +280,7 @@ donefds()
*/
int
dmove(i, j)
- register int i, j;
+ int i, j;
{
if (i == j || i < 0)
@@ -296,7 +299,7 @@ dmove(i, j)
int
dcopy(i, j)
- register int i, j;
+ int i, j;
{
if (i == j || i < 0 || (j < 0 && i > 2))
@@ -311,9 +314,9 @@ dcopy(i, j)
static int
renum(i, j)
- register int i, j;
+ int i, j;
{
- register int k = dup(i);
+ int k = dup(i);
if (k < 0)
return (-1);
@@ -334,10 +337,10 @@ renum(i, j)
*/
void
lshift(v, c)
- register Char **v;
- register int c;
+ Char **v;
+ int c;
{
- register Char **u;
+ Char **u;
for (u = v; *u && --c >= 0; u++)
xfree((ptr_t) *u);
@@ -363,7 +366,7 @@ number(cp)
Char **
copyblk(v)
- register Char **v;
+ Char **v;
{
Char **nv = (Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **));
@@ -373,7 +376,7 @@ copyblk(v)
#ifndef SHORT_STRINGS
char *
strend(cp)
- register char *cp;
+ char *cp;
{
if (!cp)
return (cp);
@@ -388,7 +391,7 @@ Char *
strip(cp)
Char *cp;
{
- register Char *dp = cp;
+ Char *dp = cp;
if (!cp)
return (cp);
@@ -408,7 +411,7 @@ udvar(name)
int
prefix(sub, str)
- register Char *sub, *str;
+ Char *sub, *str;
{
for (;;) {
diff --git a/bin/csh/parse.c b/bin/csh/parse.c
index 87e06f8..af75599 100644
--- a/bin/csh/parse.c
+++ b/bin/csh/parse.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: parse.c,v 1.5 1997/02/22 14:02:03 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -79,7 +82,7 @@ static int aleft;
extern int hleft;
void
alias(lex)
- register struct wordent *lex;
+ struct wordent *lex;
{
jmp_buf osetexit;
@@ -99,7 +102,7 @@ alias(lex)
static void
asyntax(p1, p2)
- register struct wordent *p1, *p2;
+ struct wordent *p1, *p2;
{
while (p1 != p2)
if (any(";&\n", p1->word[0]))
@@ -113,10 +116,10 @@ asyntax(p1, p2)
static void
asyn0(p1, p2)
struct wordent *p1;
- register struct wordent *p2;
+ struct wordent *p2;
{
- register struct wordent *p;
- register int l = 0;
+ struct wordent *p;
+ int l = 0;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
@@ -153,11 +156,11 @@ asyn0(p1, p2)
static void
asyn3(p1, p2)
struct wordent *p1;
- register struct wordent *p2;
+ struct wordent *p2;
{
- register struct varent *ap;
+ struct varent *ap;
struct wordent alout;
- register bool redid;
+ bool redid;
if (p1 == p2)
return;
@@ -203,9 +206,9 @@ asyn3(p1, p2)
static struct wordent *
freenod(p1, p2)
- register struct wordent *p1, *p2;
+ struct wordent *p1, *p2;
{
- register struct wordent *retp = p1->prev;
+ struct wordent *retp = p1->prev;
while (p1 != p2) {
xfree((ptr_t) p1->word);
@@ -229,7 +232,7 @@ freenod(p1, p2)
*/
struct command *
syntax(p1, p2, flags)
- register struct wordent *p1, *p2;
+ struct wordent *p1, *p2;
int flags;
{
@@ -251,8 +254,8 @@ syn0(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
- register struct wordent *p;
- register struct command *t, *t1;
+ struct wordent *p;
+ struct command *t, *t1;
int l;
l = 0;
@@ -319,8 +322,8 @@ syn1(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
- register struct wordent *p;
- register struct command *t;
+ struct wordent *p;
+ struct command *t;
int l;
l = 0;
@@ -360,9 +363,9 @@ syn1a(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
- register struct wordent *p;
- register struct command *t;
- register int l = 0;
+ struct wordent *p;
+ struct command *t;
+ int l = 0;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
@@ -401,9 +404,9 @@ syn1b(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
- register struct wordent *p;
- register struct command *t;
- register int l = 0;
+ struct wordent *p;
+ struct command *t;
+ int l = 0;
for (p = p1; p != p2; p = p->next)
switch (p->word[0]) {
@@ -441,9 +444,9 @@ syn2(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
- register struct wordent *p, *pn;
- register struct command *t;
- register int l = 0;
+ struct wordent *p, *pn;
+ struct command *t;
+ int l = 0;
int f;
for (p = p1; p != p2; p = p->next)
@@ -492,10 +495,10 @@ syn3(p1, p2, flags)
struct wordent *p1, *p2;
int flags;
{
- register struct wordent *p;
+ struct wordent *p;
struct wordent *lp, *rp;
- register struct command *t;
- register int l;
+ struct command *t;
+ int l;
Char **av;
int n, c;
bool specp = 0;
@@ -668,9 +671,9 @@ again:
void
freesyn(t)
- register struct command *t;
+ struct command *t;
{
- register Char **v;
+ Char **v;
if (t == 0)
return;
diff --git a/bin/csh/pathnames.h b/bin/csh/pathnames.h
index f1cf072..9fc456e 100644
--- a/bin/csh/pathnames.h
+++ b/bin/csh/pathnames.h
@@ -1,4 +1,4 @@
-/*
+/*-
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)pathnames.h 8.1 (Berkeley) 5/31/93
- * $Id$
+ * $Id: pathnames.h,v 1.4 1997/02/22 14:02:05 peter Exp $
*/
#define _PATH_BIN "/bin"
diff --git a/bin/csh/proc.c b/bin/csh/proc.c
index d70d29f..3627c31 100644
--- a/bin/csh/proc.c
+++ b/bin/csh/proc.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: proc.c,v 1.4 1997/02/22 14:02:06 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -82,9 +85,9 @@ void
pchild(notused)
int notused;
{
- register struct process *pp;
- register struct process *fp;
- register int pid;
+ struct process *pp;
+ struct process *fp;
+ int pid;
extern int insource;
union wait w;
int jobflags;
@@ -201,7 +204,7 @@ found:
void
pnote()
{
- register struct process *pp;
+ struct process *pp;
int flags;
sigset_t omask;
@@ -225,7 +228,7 @@ pnote()
void
pwait()
{
- register struct process *fp, *pp;
+ struct process *fp, *pp;
sigset_t omask;
/*
@@ -253,9 +256,9 @@ pwait()
*/
void
pjwait(pp)
- register struct process *pp;
+ struct process *pp;
{
- register struct process *fp;
+ struct process *fp;
int jobflags, reason;
sigset_t omask;
@@ -345,7 +348,7 @@ dowait(v, t)
Char **v;
struct command *t;
{
- register struct process *pp;
+ struct process *pp;
sigset_t omask;
pjobs++;
@@ -367,7 +370,7 @@ loop:
static void
pflushall()
{
- register struct process *pp;
+ struct process *pp;
for (pp = proclist.p_next; pp != NULL; pp = pp->p_next)
if (pp->p_pid)
@@ -381,10 +384,10 @@ pflushall()
*/
static void
pflush(pp)
- register struct process *pp;
+ struct process *pp;
{
- register struct process *np;
- register int idx;
+ struct process *np;
+ int idx;
if (pp->p_pid == 0) {
(void) fprintf(csherr, "BUG: process flushed twice");
@@ -415,7 +418,7 @@ pflush(pp)
*/
static void
pclrcurr(pp)
- register struct process *pp;
+ struct process *pp;
{
if (pp == pcurrent)
@@ -443,9 +446,9 @@ static Char *cmdp;
void
palloc(pid, t)
int pid;
- register struct command *t;
+ struct command *t;
{
- register struct process *pp;
+ struct process *pp;
int i;
pp = (struct process *) xcalloc(1, (size_t) sizeof(struct process));
@@ -509,7 +512,7 @@ palloc(pid, t)
static void
padd(t)
- register struct command *t;
+ struct command *t;
{
Char **argp;
@@ -570,7 +573,7 @@ static void
pads(cp)
Char *cp;
{
- register int i;
+ int i;
/*
* Avoid the Quoted Space alias hack! Reported by:
@@ -626,7 +629,7 @@ prestjob()
void
pendjob()
{
- register struct process *pp, *tp;
+ struct process *pp, *tp;
if (pcurrjob && (pcurrjob->p_flags & (PFOREGND | PSTOPPED)) == 0) {
pp = pcurrjob;
@@ -648,10 +651,10 @@ pendjob()
*/
static int
pprint(pp, flag)
- register struct process *pp;
+ struct process *pp;
bool flag;
{
- register status, reason;
+ int status, reason;
struct process *tp;
int jobflags, pstatus;
bool hadnl = 1; /* did we just have a newline */
@@ -814,13 +817,13 @@ prcomd:
static void
ptprint(tp)
- register struct process *tp;
+ struct process *tp;
{
struct timeval tetime, diff;
static struct timeval ztime;
struct rusage ru;
static struct rusage zru;
- register struct process *pp = tp;
+ struct process *pp = tp;
ru = zru;
tetime = ztime;
@@ -842,8 +845,8 @@ dojobs(v, t)
Char **v;
struct command *t;
{
- register struct process *pp;
- register int flag = NUMBER | NAME | REASON;
+ struct process *pp;
+ int flag = NUMBER | NAME | REASON;
int i;
if (chkstop)
@@ -872,7 +875,7 @@ dofg(v, t)
Char **v;
struct command *t;
{
- register struct process *pp;
+ struct process *pp;
okpcntl();
++v;
@@ -892,7 +895,7 @@ dofg1(v, t)
Char **v;
struct command *t;
{
- register struct process *pp;
+ struct process *pp;
okpcntl();
pp = pfind(v[0]);
@@ -909,7 +912,7 @@ dobg(v, t)
Char **v;
struct command *t;
{
- register struct process *pp;
+ struct process *pp;
okpcntl();
++v;
@@ -928,7 +931,7 @@ dobg1(v, t)
Char **v;
struct command *t;
{
- register struct process *pp;
+ struct process *pp;
pp = pfind(v[0]);
pstart(pp, 0);
@@ -955,8 +958,8 @@ dokill(v, t)
Char **v;
struct command *t;
{
- register int signum = SIGTERM;
- register char *name;
+ int signum = SIGTERM;
+ char *name;
v++;
if (v[0] && v[0][0] == '-') {
@@ -998,8 +1001,8 @@ pkill(v, signum)
Char **v;
int signum;
{
- register struct process *pp, *np;
- register int jobflags = 0;
+ struct process *pp, *np;
+ int jobflags = 0;
int pid, err1 = 0;
sigset_t omask;
Char *cp;
@@ -1081,10 +1084,10 @@ cont:
*/
void
pstart(pp, foregnd)
- register struct process *pp;
+ struct process *pp;
int foregnd;
{
- register struct process *np;
+ struct process *np;
sigset_t omask;
long jobflags = 0;
@@ -1115,7 +1118,7 @@ void
panystop(neednl)
bool neednl;
{
- register struct process *pp;
+ struct process *pp;
chkstop = 2;
for (pp = proclist.p_next; pp; pp = pp->p_next)
@@ -1127,7 +1130,7 @@ struct process *
pfind(cp)
Char *cp;
{
- register struct process *pp, *np;
+ struct process *pp, *np;
if (cp == 0 || cp[1] == 0 || eq(cp, STRcent2) || eq(cp, STRcentplus)) {
if (pcurrent == NULL)
@@ -1151,7 +1154,7 @@ pfind(cp)
for (pp = proclist.p_next; pp; pp = pp->p_next)
if (pp->p_pid == pp->p_jobid) {
if (cp[1] == '?') {
- register Char *dp;
+ Char *dp;
for (dp = pp->p_command; *dp; dp++) {
if (*dp != cp[2])
@@ -1169,7 +1172,7 @@ pfind(cp)
}
if (np)
return (np);
- stderror(ERR_NAME | cp[1] == '?' ? ERR_JOBPAT : ERR_NOSUCHJOB);
+ stderror((ERR_NAME | cp[1]) == '?' ? ERR_JOBPAT : ERR_NOSUCHJOB);
/* NOTREACHED */
return (0);
}
@@ -1180,10 +1183,10 @@ pfind(cp)
*/
static struct process *
pgetcurr(pp)
- register struct process *pp;
+ struct process *pp;
{
- register struct process *np;
- register struct process *xp = NULL;
+ struct process *np;
+ struct process *xp = NULL;
for (np = proclist.p_next; np; np = np->p_next)
if (np != pcurrent && np != pp && np->p_pid &&
@@ -1205,7 +1208,7 @@ donotify(v, t)
Char **v;
struct command *t;
{
- register struct process *pp;
+ struct process *pp;
pp = pfind(*++v);
pp->p_flags |= PNOTIFY;
@@ -1228,7 +1231,7 @@ pfork(t, wanttty)
struct command *t; /* command we are forking for */
int wanttty;
{
- register int pid;
+ int pid;
bool ignint = 0;
int pgrp;
sigset_t omask;
diff --git a/bin/csh/sem.c b/bin/csh/sem.c
index 9226687..e0ef759 100644
--- a/bin/csh/sem.c
+++ b/bin/csh/sem.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)sem.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: sem.c,v 1.5 1997/02/22 14:02:07 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/param.h>
@@ -62,7 +65,7 @@ static void chkclob __P((char *));
void
execute(t, wanttty, pipein, pipeout)
- register struct command *t;
+ struct command *t;
int wanttty, *pipein, *pipeout;
{
bool forked = 0;
@@ -451,7 +454,7 @@ static void
vffree(i)
int i;
{
- register Char **v;
+ Char **v;
if ((v = gargv) != NULL) {
gargv = 0;
@@ -481,7 +484,7 @@ int i;
*/
static Char *
splicepipe(t, cp)
- register struct command *t;
+ struct command *t;
Char *cp; /* word after < or > */
{
Char *blk[2];
@@ -524,12 +527,12 @@ splicepipe(t, cp)
*/
static void
doio(t, pipein, pipeout)
- register struct command *t;
+ struct command *t;
int *pipein, *pipeout;
{
- register int fd;
- register Char *cp;
- register int flags = t->t_dflg;
+ int fd;
+ Char *cp;
+ int flags = t->t_dflg;
if (didfds || (flags & F_REPEAT))
return;
@@ -620,7 +623,7 @@ doio(t, pipein, pipeout)
void
mypipe(pv)
- register int *pv;
+ int *pv;
{
if (pipe(pv) < 0)
@@ -635,7 +638,7 @@ oops:
static void
chkclob(cp)
- register char *cp;
+ char *cp;
{
struct stat stb;
diff --git a/bin/csh/set.c b/bin/csh/set.c
index fe7b500..1f532b0 100644
--- a/bin/csh/set.c
+++ b/bin/csh/set.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)set.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: set.c,v 1.6 1997/02/22 14:02:08 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -47,6 +50,7 @@ static char sccsid[] = "@(#)set.c 8.1 (Berkeley) 5/31/93";
#else
# include <varargs.h>
#endif
+#include <unistd.h>
#include "csh.h"
#include "extern.h"
@@ -75,7 +79,7 @@ doset(v, t)
Char **v;
struct command *t;
{
- register Char *p;
+ Char *p;
Char *vp, op;
Char **vecp;
bool hadsub;
@@ -116,7 +120,7 @@ doset(v, t)
if (op && op != '=')
stderror(ERR_NAME | ERR_SYNTAX);
if (eq(p, STRLparen)) {
- register Char **e = v;
+ Char **e = v;
if (hadsub)
stderror(ERR_NAME | ERR_SYNTAX);
@@ -143,7 +147,7 @@ doset(v, t)
dohash(NULL, NULL);
}
else if (eq(vp, STRhistchars)) {
- register Char *pn = value(STRhistchars);
+ Char *pn = value(STRhistchars);
HIST = *pn++;
HISTSUB = *pn;
@@ -158,7 +162,7 @@ doset(v, t)
else if (eq(vp, STRterm))
Setenv(STRTERM, value(vp));
else if (eq(vp, STRhome)) {
- register Char *cp;
+ Char *cp;
cp = Strsave(value(vp)); /* get the old value back */
@@ -184,8 +188,8 @@ doset(v, t)
static Char *
getinx(cp, ip)
- register Char *cp;
- register int *ip;
+ Char *cp;
+ int *ip;
{
*ip = 0;
@@ -203,7 +207,7 @@ asx(vp, subscr, p)
int subscr;
Char *p;
{
- register struct varent *v = getvx(vp, subscr);
+ struct varent *v = getvx(vp, subscr);
xfree((ptr_t) v->vec[subscr - 1]);
v->vec[subscr - 1] = globone(p, G_APPEND);
@@ -214,7 +218,7 @@ getvx(vp, subscr)
Char *vp;
int subscr;
{
- register struct varent *v = adrof(vp);
+ struct varent *v = adrof(vp);
if (v == 0)
udvar(vp);
@@ -229,7 +233,7 @@ dolet(v, t)
Char **v;
struct command *t;
{
- register Char *p;
+ Char *p;
Char *vp, c, op;
bool hadsub;
int subscr;
@@ -314,7 +318,7 @@ static Char *
xset(cp, vp)
Char *cp, ***vp;
{
- register Char *dp;
+ Char *dp;
if (*cp) {
dp = Strsave(cp);
@@ -332,9 +336,9 @@ operate(op, vp, p)
{
Char opr[2];
Char *vec[5];
- register Char **v = vec;
+ Char **v = vec;
Char **vecp = v;
- register int i;
+ int i;
if (op != '=') {
if (*vp)
@@ -357,7 +361,7 @@ static Char *putp;
Char *
putn(n)
- register int n;
+ int n;
{
int num;
static Char number[15];
@@ -390,7 +394,7 @@ putn(n)
static void
putn1(n)
- register int n;
+ int n;
{
if (n > 9)
putn1(n / 10);
@@ -399,9 +403,9 @@ putn1(n)
int
getn(cp)
- register Char *cp;
+ Char *cp;
{
- register int n;
+ int n;
int sign;
sign = 0;
@@ -426,7 +430,7 @@ value1(var, head)
Char *var;
struct varent *head;
{
- register struct varent *vp;
+ struct varent *vp;
vp = adrof1(var, head);
return (vp == 0 || vp->vec[0] == 0 ? STRNULL : vp->vec[0]);
@@ -435,9 +439,9 @@ value1(var, head)
static struct varent *
madrof(pat, vp)
Char *pat;
- register struct varent *vp;
+ struct varent *vp;
{
- register struct varent *vp1;
+ struct varent *vp1;
for (; vp; vp = vp->v_right) {
if (vp->v_left && (vp1 = madrof(pat, vp->v_left)))
@@ -450,10 +454,10 @@ madrof(pat, vp)
struct varent *
adrof1(name, v)
- register Char *name;
- register struct varent *v;
+ Char *name;
+ struct varent *v;
{
- register cmp;
+ int cmp;
v = v->v_left;
while (v && ((cmp = *name - *v->v_name) ||
@@ -472,7 +476,7 @@ void
set(var, val)
Char *var, *val;
{
- register Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
+ Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
vec[0] = val;
vec[1] = 0;
@@ -484,7 +488,7 @@ set1(var, vec, head)
Char *var, **vec;
struct varent *head;
{
- register Char **oldv = vec;
+ Char **oldv = vec;
gflag = 0;
tglob(oldv);
@@ -505,10 +509,10 @@ set1(var, vec, head)
void
setq(name, vec, p)
Char *name, **vec;
- register struct varent *p;
+ struct varent *p;
{
- register struct varent *c;
- register f;
+ struct varent *c;
+ int f;
f = 0; /* tree hangs off the header's left link */
while ((c = p->v_link[f]) != NULL) {
@@ -551,11 +555,11 @@ unset(v, t)
void
unset1(v, head)
- register Char *v[];
+ Char *v[];
struct varent *head;
{
- register struct varent *vp;
- register int cnt;
+ struct varent *vp;
+ int cnt;
while (*++v) {
cnt = 0;
@@ -570,7 +574,7 @@ void
unsetv(var)
Char *var;
{
- register struct varent *vp;
+ struct varent *vp;
if ((vp = adrof1(var, &shvhed)) == 0)
udvar(var);
@@ -579,10 +583,10 @@ unsetv(var)
static void
unsetv1(p)
- register struct varent *p;
+ struct varent *p;
{
- register struct varent *c, *pp;
- register f;
+ struct varent *c, *pp;
+ int f;
/*
* Free associated memory first to avoid complications.
@@ -633,8 +637,8 @@ shift(v, t)
Char **v;
struct command *t;
{
- register struct varent *argv;
- register Char *name;
+ struct varent *argv;
+ Char *name;
v++;
name = *v;
@@ -665,7 +669,7 @@ exportpath(val)
break;
}
if (**val != '/' && (euid == 0 || uid == 0) &&
- (intact || intty && isatty(SHOUT)))
+ (intact || (intty && isatty(SHOUT))))
(void) fprintf(csherr,
"Warning: exported path contains relative components.\n");
(void) Strcat(exppath, *val++);
@@ -717,16 +721,16 @@ rright(p)
*/
static void
balance(p, f, d)
- register struct varent *p;
- register int f, d;
+ struct varent *p;
+ int f, d;
{
- register struct varent *pp;
+ struct varent *pp;
#ifndef lint
- register struct varent *t; /* used by the rotate macros */
+ struct varent *t; /* used by the rotate macros */
#endif
- register ff;
+ int ff;
/*
* Ok, from here on, p is the node we're operating on; pp is it's parent; f
@@ -812,10 +816,10 @@ balance(p, f, d)
void
plist(p)
- register struct varent *p;
+ struct varent *p;
{
- register struct varent *c;
- register len;
+ struct varent *c;
+ int len;
if (setintr)
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
diff --git a/bin/csh/str.c b/bin/csh/str.c
index 46fce36..ab84d5f 100644
--- a/bin/csh/str.c
+++ b/bin/csh/str.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)str.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: str.c,v 1.5 1997/02/22 14:02:09 peter Exp $";
+#endif
#endif /* not lint */
#define MALLOC_INCR 128
@@ -59,10 +62,10 @@ static char sccsid[] = "@(#)str.c 8.1 (Berkeley) 5/31/93";
Char **
blk2short(src)
- register char **src;
+ char **src;
{
size_t n;
- register Char **sdst, **dst;
+ Char **sdst, **dst;
/*
* Count
@@ -79,10 +82,10 @@ blk2short(src)
char **
short2blk(src)
- register Char **src;
+ Char **src;
{
size_t n;
- register char **sdst, **dst;
+ char **sdst, **dst;
/*
* Count
@@ -99,11 +102,11 @@ short2blk(src)
Char *
str2short(src)
- register char *src;
+ char *src;
{
static Char *sdst;
static size_t dstsize = 0;
- register Char *dst, *edst;
+ Char *dst, *edst;
if (src == NULL)
return (NULL);
@@ -131,11 +134,11 @@ str2short(src)
char *
short2str(src)
- register Char *src;
+ Char *src;
{
static char *sdst = NULL;
static size_t dstsize = 0;
- register char *dst, *edst;
+ char *dst, *edst;
if (src == NULL)
return (NULL);
@@ -162,9 +165,9 @@ short2str(src)
Char *
s_strcpy(dst, src)
- register Char *dst, *src;
+ Char *dst, *src;
{
- register Char *sdst;
+ Char *sdst;
sdst = dst;
while ((*dst++ = *src++) != '\0')
@@ -174,10 +177,10 @@ s_strcpy(dst, src)
Char *
s_strncpy(dst, src, n)
- register Char *dst, *src;
- register size_t n;
+ Char *dst, *src;
+ size_t n;
{
- register Char *sdst;
+ Char *sdst;
if (n == 0)
return(dst);
@@ -195,9 +198,9 @@ s_strncpy(dst, src, n)
Char *
s_strcat(dst, src)
- register Char *dst, *src;
+ Char *dst, *src;
{
- register short *sdst;
+ short *sdst;
sdst = dst;
while (*dst++)
@@ -211,10 +214,10 @@ s_strcat(dst, src)
#ifdef NOTUSED
Char *
s_strncat(dst, src, n)
- register Char *dst, *src;
- register size_t n;
+ Char *dst, *src;
+ size_t n;
{
- register Char *sdst;
+ Char *sdst;
if (n == 0)
return (dst);
@@ -239,7 +242,7 @@ s_strncat(dst, src, n)
Char *
s_strchr(str, ch)
- register Char *str;
+ Char *str;
int ch;
{
do
@@ -251,10 +254,10 @@ s_strchr(str, ch)
Char *
s_strrchr(str, ch)
- register Char *str;
+ Char *str;
int ch;
{
- register Char *rstr;
+ Char *rstr;
rstr = NULL;
do
@@ -266,9 +269,9 @@ s_strrchr(str, ch)
size_t
s_strlen(str)
- register Char *str;
+ Char *str;
{
- register size_t n;
+ size_t n;
for (n = 0; *str++; n++)
continue;
@@ -277,7 +280,7 @@ s_strlen(str)
int
s_strcmp(str1, str2)
- register Char *str1, *str2;
+ Char *str1, *str2;
{
for (; *str1 && *str1 == *str2; str1++, str2++)
continue;
@@ -298,8 +301,8 @@ s_strcmp(str1, str2)
int
s_strncmp(str1, str2, n)
- register Char *str1, *str2;
- register size_t n;
+ Char *str1, *str2;
+ size_t n;
{
if (n == 0)
return (0);
@@ -327,10 +330,10 @@ s_strncmp(str1, str2, n)
Char *
s_strsave(s)
- register Char *s;
+ Char *s;
{
Char *n;
- register Char *p;
+ Char *p;
if (s == 0)
s = STRNULL;
@@ -347,7 +350,7 @@ s_strspl(cp, dp)
Char *cp, *dp;
{
Char *ep;
- register Char *p, *q;
+ Char *p, *q;
if (!cp)
cp = STRNULL;
@@ -368,7 +371,7 @@ s_strspl(cp, dp)
Char *
s_strend(cp)
- register Char *cp;
+ Char *cp;
{
if (!cp)
return (cp);
@@ -379,11 +382,11 @@ s_strend(cp)
Char *
s_strstr(s, t)
- register Char *s, *t;
+ Char *s, *t;
{
do {
- register Char *ss = s;
- register Char *tt = t;
+ Char *ss = s;
+ Char *tt = t;
do
if (*tt == '\0')
@@ -396,11 +399,11 @@ s_strstr(s, t)
char *
short2qstr(src)
- register Char *src;
+ Char *src;
{
static char *sdst = NULL;
static size_t dstsize = 0;
- register char *dst, *edst;
+ char *dst, *edst;
if (src == NULL)
return (NULL);
diff --git a/bin/csh/time.c b/bin/csh/time.c
index 9a911037..1d9b37e 100644
--- a/bin/csh/time.c
+++ b/bin/csh/time.c
@@ -29,12 +29,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $Id$
*/
#ifndef lint
+#if 0
static char sccsid[] = "@(#)time.c 8.1 (Berkeley) 5/31/93";
+#else
+static const char rcsid[] =
+ "$Id: time.c,v 1.7 1997/02/22 14:02:09 peter Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
@@ -92,7 +95,7 @@ donice(v, t)
Char **v;
struct command *t;
{
- register Char *cp;
+ Char *cp;
int nval = 0;
v++, cp = *v++;
@@ -105,7 +108,7 @@ donice(v, t)
void
ruadd(ru, ru2)
- register struct rusage *ru, *ru2;
+ struct rusage *ru, *ru2;
{
tvadd(&ru->ru_utime, &ru2->ru_utime);
tvadd(&ru->ru_stime, &ru2->ru_stime);
@@ -129,17 +132,17 @@ ruadd(ru, ru2)
void
prusage(r0, r1, e, b)
- register struct rusage *r0, *r1;
+ struct rusage *r0, *r1;
struct timeval *e, *b;
{
- register time_t t =
+ time_t t =
(r1->ru_utime.tv_sec - r0->ru_utime.tv_sec) * 100 +
(r1->ru_utime.tv_usec - r0->ru_utime.tv_usec) / 10000 +
(r1->ru_stime.tv_sec - r0->ru_stime.tv_sec) * 100 +
(r1->ru_stime.tv_usec - r0->ru_stime.tv_usec) / 10000;
- register char *cp;
- register long i;
- register struct varent *vp = adrof(STRtime);
+ char *cp;
+ long i;
+ struct varent *vp = adrof(STRtime);
int ms =
(e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000;
@@ -277,7 +280,7 @@ void
psecs(l)
long l;
{
- register int i;
+ int i;
i = l / 3600;
if (i) {
@@ -298,7 +301,7 @@ void
pcsecs(l) /* PWP: print mm:ss.dd, l is in sec*100 */
long l;
{
- register int i;
+ int i;
i = l / 360000;
if (i) {
OpenPOWER on IntegriCloud