sh: kill off REG
authorAlan Cox <alan@linux.intel.com>
Sun, 10 May 2015 21:33:39 +0000 (22:33 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 10 May 2015 21:33:39 +0000 (22:33 +0100)
17 files changed:
Applications/V7/cmd/sh/args.c
Applications/V7/cmd/sh/blok.c
Applications/V7/cmd/sh/cmd.c
Applications/V7/cmd/sh/error.c
Applications/V7/cmd/sh/expand.c
Applications/V7/cmd/sh/fault.c
Applications/V7/cmd/sh/io.c
Applications/V7/cmd/sh/mac.h
Applications/V7/cmd/sh/macro.c
Applications/V7/cmd/sh/main.c
Applications/V7/cmd/sh/name.c
Applications/V7/cmd/sh/print.c
Applications/V7/cmd/sh/service.c
Applications/V7/cmd/sh/stak.c
Applications/V7/cmd/sh/string.c
Applications/V7/cmd/sh/word.c
Applications/V7/cmd/sh/xec.c

index ef94dfc..c6a90cc 100644 (file)
@@ -32,9 +32,9 @@ INT   options(argc,argv)
        STRING          *argv;
        INT             argc;
 {
-       REG STRING      cp;
-       REG STRING      *argp=argv;
-       REG STRING      flagc;
+       register STRING cp;
+       register STRING *argp=argv;
+       register STRING flagc;
        STRING          flagp;
 
        if (argc>1 && *argp[1]=='-'
@@ -73,8 +73,8 @@ void  setargs(argi)
        STRING          argi[];
 {
        /* count args */
-       REG STRING      *argp=argi;
-       REG INT         argn=0;
+       register STRING *argp=argi;
+       register INT            argn=0;
 
        while(Rcheat(*argp++)!=ENDARGS ){argn++ ;}
 
@@ -88,9 +88,9 @@ DOLPTR
 freeargs(blk)
        DOLPTR          blk;
 {
-       REG STRING      *argp;
-       REG DOLPTR      argr=0;
-       REG DOLPTR      argblk;
+       register STRING *argp;
+       register DOLPTR argr=0;
+       register DOLPTR argblk;
 
        if (argblk=blk
        ) {     argr = argblk->dolnxt;
@@ -106,9 +106,9 @@ freeargs(blk)
 static STRING *        copyargs(from, n)
        STRING          from[];
 {
-       REG STRING *    np=(STRING *)alloc(sizeof(STRING*)*n+3*BYTESPERWORD);
-       REG STRING *    fp=from;
-       REG STRING *    pp=np;
+       register STRING *       np=(STRING *)alloc(sizeof(STRING*)*n+3*BYTESPERWORD);
+       register STRING *       fp=from;
+       register STRING *       pp=np;
 
        ((DOLPTR)np)->doluse=1; /* use count */
        np=(STRING *)((DOLPTR)np)->dolarg;
index e8135ae..34a8641 100644 (file)
@@ -30,11 +30,11 @@ BLKPTR              bloktop=BLK(end);       /*top of arena (last blok)*/
 ADDRESS        alloc(nbytes)
        POS             nbytes;
 {
-       REG POS         rbytes = round(nbytes+BYTESPERWORD,BYTESPERWORD);
+       register POS            rbytes = round(nbytes+BYTESPERWORD,BYTESPERWORD);
 
        for (;;) {      INT             c=0;
-               REG BLKPTR      p = blokp;
-               REG BLKPTR      q;
+               register BLKPTR p = blokp;
+               register BLKPTR q;
                do {    if(!busy(p)
                        ) {     while(!busy(q = p->word) ){p->word = q->word ;}
                                if(ADR(q)-ADR(p) >= rbytes
@@ -56,8 +56,8 @@ void  addblok(reqd)
        POS             reqd;
 {
        if(stakbas!=staktop
-       ) {     REG STKPTR      rndstak;
-               REG BLKPTR      blokstak;
+       ) {     register STKPTR rndstak;
+               register BLKPTR blokstak;
 
                pushstak(0);
                rndstak=(STKPTR)round(staktop,BYTESPERWORD);
@@ -71,7 +71,7 @@ void  addblok(reqd)
        bloktop=bloktop->word=BLK(Rcheat(bloktop)+reqd);
        bloktop->word=BLK(ADR(end)+1);
        {
-          REG STKPTR stakadr=STK(bloktop+2);
+          register STKPTR stakadr=STK(bloktop+2);
           staktop=movstr(stakbot,stakadr);
           stakbas=stakbot=stakadr;
        }
@@ -91,8 +91,8 @@ chkbptr(ptr)
        BLKPTR  ptr;
 {
        INT             exf=0;
-       REG BLKPTR      p = end;
-       REG BLKPTR      q;
+       register BLKPTR p = end;
+       register BLKPTR q;
        INT             us=0, un=0;
 
        for (;;) {
index d80d2ef..d49983a 100644 (file)
@@ -35,7 +35,7 @@ TREPTR        makefork(flgs, i)
        INT             flgs;
        TREPTR          i;
 {
-       REG FORKPTR     t;
+       register FORKPTR        t;
 
        t=(FORKPTR)getstak(FORKTYPE);
        t->forktyp=flgs|TFORK;
@@ -48,7 +48,7 @@ static TREPTR makelist(type,i,r)
        INT             type;
        TREPTR          i, r;
 {
-       REG LSTPTR      t;
+       register LSTPTR t;
 
        if (i==0 || r==0
        ) {     synbad();
@@ -68,10 +68,10 @@ static TREPTR       makelist(type,i,r)
  */
 
 TREPTR cmd(sym,flg)
-       REG INT         sym;
+       register INT            sym;
        INT             flg;
 {
-       REG TREPTR      i, e;
+       register TREPTR i, e;
 
        i = list(flg);
 
@@ -120,8 +120,8 @@ TREPTR      cmd(sym,flg)
 
 static TREPTR  list(flg)
 {
-       REG TREPTR      r;
-       REG INT         b;
+       register TREPTR r;
+       register INT            b;
 
        r = term(flg);
        while(r && ((b=(wdval==ANDFSYM)) || wdval==ORFSYM)
@@ -138,7 +138,7 @@ static TREPTR       list(flg)
 
 static TREPTR  term(flg)
 {
-       REG TREPTR      t;
+       register TREPTR t;
 
        reserv++;
        if (flg&NLFLG
@@ -153,12 +153,12 @@ static TREPTR     term(flg)
 }
 
 static REGPTR  syncase(esym)
-       REG INT esym;
+       register INT    esym;
 {
        skipnl();
        if (wdval==esym
        ) {     return(0);
-       } else {        REG REGPTR      r=(REGPTR)getstak(REGTYPE);
+       } else {        register REGPTR r=(REGPTR)getstak(REGTYPE);
                r->regptr=0;
                for(;;) {
                 wdarg->argnxt=r->regptr;
@@ -195,8 +195,8 @@ static REGPTR       syncase(esym)
 static TREPTR  item(flag)
        BOOL            flag;
 {
-       REG TREPTR      t;
-       REG IOPTR       io;
+       register TREPTR t;
+       register IOPTR  io;
 
        if (flag
        ) {     io=inout((IOPTR)0);
@@ -218,7 +218,7 @@ static TREPTR       item(flag)
 
            case IFSYM:
                {
-                  REG INT      w;
+                  register INT w;
                   t=(TREPTR)getstak(IFTYPE);
                   ((IFPTR)t)->iftyp=TIF;
                   ((IFPTR)t)->iftre=cmd(THSYM,NLFLG);
@@ -264,7 +264,7 @@ static TREPTR       item(flag)
 
            case '(':
                {
-                  REG PARPTR    p;
+                  register PARPTR       p;
                   p=(PARPTR)getstak(PARTYPE);
                   p->partre=cmd(')',NLFLG);
                   p->partyp=TPAR;
@@ -279,9 +279,9 @@ static TREPTR       item(flag)
 
            case 0:
                {
-                  REG ARGPTR   argp;
-                  REG ARGPTR   *argtail;
-                  REG ARGPTR   *argset=0;
+                  register ARGPTR      argp;
+                  register ARGPTR      *argtail;
+                  register ARGPTR      *argset=0;
                   INT          keywd=1;
                   t=(TREPTR)getstak(COMTYPE);
                   ((COMPTR)t)->comio=io; /*initial io chain*/
@@ -323,9 +323,9 @@ static int  skipnl()
 static IOPTR   inout(lastio)
        IOPTR           lastio;
 {
-       REG INT         iof;
-       REG IOPTR       iop;
-       REG CHAR        c;
+       register INT            iof;
+       register IOPTR  iop;
+       register CHAR   c;
 
        iof=wdnum;
 
@@ -375,7 +375,7 @@ static void chkword()
 
 static void    chksym(sym)
 {
-       REG INT         x = sym&wdval;
+       register INT            x = sym&wdval;
        if (((x&SYMFLG) ? x : sym) != wdval
        ) {     synbad();
        ;}
@@ -384,7 +384,7 @@ static void chksym(sym)
 static void    prsym(sym)
 {
        if (sym&SYMFLG
-       ) {     REG SYSPTR      sp=reserved;
+       ) {     register SYSPTR sp=reserved;
                while(sp->sysval
                        && sp->sysval!=sym
                ){sp++ ;}
index 482858b..445e3c3 100644 (file)
@@ -67,7 +67,7 @@ exitsh(xno)
 
 done()
 {
-       REG STRING      t;
+       register STRING t;
        if (t=trapcom[0]
        ) {     trapcom[0]=0; /*should free but not long */
                execexp(t,0);
index d709481..fcd31b8 100644 (file)
@@ -36,7 +36,7 @@ INT   expand(as,rflg)
        INT             count, dirf;
        BOOL            dir=0;
        STRING          rescan = 0;
-       REG STRING      s, cs;
+       register STRING s, cs;
        ARGPTR          schain = gchain;
        struct dirent   entry;
        STATBUF         statb;
@@ -47,7 +47,7 @@ INT   expand(as,rflg)
 
        /* check for meta chars */
        {
-          REG BOOL slash; slash=0;
+          register BOOL slash; slash=0;
           while(!fngchar(*cs)
           ){if (*cs++==0
                ) {     if (rflg && slash ) { break; } else { return(0) ;}
@@ -75,7 +75,7 @@ INT   expand(as,rflg)
        if (*cs==0 ) { *cs++=0200 ;}
        if (dir
        ) {     /* check for rescan */
-               REG STRING rs; rs=cs;
+               register STRING rs; rs=cs;
 
                do {    if (*rs=='/' ) { rescan=rs; *rs=0; gchain=0 ;}
                } while(*rs++ );
@@ -93,7 +93,7 @@ INT   expand(as,rflg)
                close(dirf);
 
                if (rescan
-               ) {     REG ARGPTR      rchain;
+               ) {     register ARGPTR rchain;
                        rchain=gchain; gchain=schain;
                        if (count
                        ) {     count=0;
@@ -107,7 +107,7 @@ INT expand(as,rflg)
        ;}
 
        {
-          REG CHAR     c;
+          register CHAR        c;
           s=as;
           while(c = *s
           ){*s++=(c&STRIP?c:'/') ;}
@@ -116,9 +116,9 @@ INT expand(as,rflg)
 }
 
 gmatch(s, p)
-       REG STRING      s, p;
+       register STRING s, p;
 {
-       REG INT         scc;
+       register INT            scc;
        CHAR            c;
 
        if (scc = *s++
@@ -162,8 +162,8 @@ gmatch(s, p)
 static void    addg(as1,as2,as3)
        STRING          as1, as2, as3;
 {
-       REG STRING      s1, s2;
-       REG INT         c;
+       register STRING s1, s2;
+       register INT            c;
 
        s2 = locstak()+BYTESPERWORD;
 
@@ -185,7 +185,7 @@ static void addg(as1,as2,as3)
 }
 
 makearg(args)
-       REG STRING      args;
+       register STRING args;
 {
        ((ARGPTR)args)->argnxt=gchain;
        gchain=(ARGPTR)args;
index ddf8e00..cbd6b6a 100644 (file)
@@ -20,9 +20,9 @@ BOOL          trapflg[MAXTRAP];
 
 
 void   fault(sig)
-       REG INT         sig;
+       register INT            sig;
 {
-       REG INT         flag;
+       register INT            flag;
 
        signal(sig,fault);
        if(sig==MEMF
@@ -49,7 +49,7 @@ stdsigs()
 
 ignsig(n)
 {
-       REG INT         s, i;
+       register INT            s, i;
 #if 0
     // FIXME: need to do proper SIG_IGN checks/handling
        if((s=signal(i=n,1)&01)==0
@@ -61,7 +61,7 @@ ignsig(n)
 
 getsig(n)
 {
-       REG INT         i;
+       register INT            i;
 
        if(trapflg[i=n]&SIGMOD || ignsig(i)==0
        ) {     signal(i,fault);
@@ -70,8 +70,8 @@ getsig(n)
 
 oldsigs()
 {
-       REG INT         i;
-       REG STRING      t;
+       register INT            i;
+       register STRING t;
 
        i=MAXTRAP;
        while(i--
@@ -97,8 +97,8 @@ clrsig(i)
 chktrap()
 {
        /* check for traps */
-       REG INT         i=MAXTRAP;
-       REG STRING      t;
+       register INT            i=MAXTRAP;
+       register STRING t;
 
        trapnote &= ~TRAPSET;
        while(--i
index 2d3a601..3f13a62 100644 (file)
@@ -18,7 +18,7 @@
 initf(fd)
        UFD             fd;
 {
-       REG FILE        f=standin;
+       register FILE   f=standin;
 
        f->fdes=fd; f->fsiz=((flags&(oneflg|ttyflg))==0 ? BUFSIZ : 1);
        f->fnxt=f->fend=f->fbuf; f->feval=0; f->flin=1;
@@ -26,9 +26,9 @@ initf(fd)
 }
 
 estabf(s)
-       REG STRING      s;
+       register STRING s;
 {
-       REG FILE        f;
+       register FILE   f;
 
        (f=standin)->fdes = -1;
        f->fend=length(s)+(f->fnxt=s);
@@ -39,7 +39,7 @@ estabf(s)
 push(af)
        FILE            af;
 {
-       REG FILE        f;
+       register FILE   f;
 
        (f=af)->fstak=standin;
        f->feof=0; f->feval=0;
@@ -48,7 +48,7 @@ push(af)
 
 pop()
 {
-       REG FILE        f;
+       register FILE   f;
 
        if((f=standin)->fstak
        ) {     if(f->fdes>=0 ) { close(f->fdes) ;}
@@ -69,7 +69,7 @@ chkpipe(pv)
 chkopen(idf)
        STRING          idf;
 {
-       REG INT         rc;
+       register INT            rc;
 
        if((rc=open(idf,0))<0
        ) {     failed(idf,badopen);
@@ -78,7 +78,7 @@ chkopen(idf)
 }
 
 sh_rename(f1,f2)
-       REG INT         f1, f2;
+       register INT            f1, f2;
 {
        if(f1!=f2
        ) {     dup2(f1, f2);
@@ -90,7 +90,7 @@ sh_rename(f1,f2)
 create(s)
        STRING          s;
 {
-       REG INT         rc;
+       register INT            rc;
 
        if((rc=creat(s,0666))<0
        ) {     failed(s,badcreate);
@@ -111,9 +111,9 @@ copy(ioparg)
        IOPTR           ioparg;
 {
        CHAR            c, *ends;
-       REG CHAR        *cline, *clinep;
+       register CHAR   *cline, *clinep;
        INT             fd;
-       REG IOPTR       iop;
+       register IOPTR  iop;
 
        if(iop=ioparg
        ) {     copy(iop->iolst);
index db4008a..e77820a 100644 (file)
@@ -12,7 +12,6 @@
 #define TYPE   typedef
 #define STRUCT TYPE struct
 #define UNION  TYPE union
-#define REG    register
 
 
 #define TRUE   (-1)
index 7ab3f0f..ab489b2 100644 (file)
@@ -22,9 +22,9 @@ static flush();
 
 
 static STRING  copyto(endch)
-       REG CHAR        endch;
+       register CHAR   endch;
 {
-       REG CHAR        c;
+       register CHAR   c;
 
        while((c=getch(endch))!=endch && c
        ){pushstak(c|quote) ;}
@@ -33,10 +33,10 @@ static STRING       copyto(endch)
 }
 
 static skipto(endch)
-       REG CHAR        endch;
+       register CHAR   endch;
 {
        /* skip chars up to } */
-       REG CHAR        c;
+       register CHAR   c;
        while((c=readc()) && c!=endch
        ){      switch(c) {
 
@@ -55,7 +55,7 @@ static skipto(endch)
 static getch(endch)
        CHAR            endch;
 {
-       REG CHAR        d;
+       register CHAR   d;
 
 retry:
        d=readc();
@@ -63,12 +63,12 @@ retry:
        ) {     return(d);
        ;}
        if(d==DOLLAR
-       ) {     REG INT c;
+       ) {     register INT    c;
                if((c=readc(), dolchar(c))
                ) {     NAMPTR          n=(NAMPTR)NIL;
                        INT             dolg=0;
                        BOOL            bra;
-                       REG STRING      argp, v;
+                       register STRING argp, v;
                        CHAR            idb[2];
                        STRING          id=idb;
 
@@ -158,8 +158,8 @@ STRING      macro(as)
        /* Strip "" and do $ substitution
         * Leaves result on top of stack
         */
-       REG BOOL        savqu =quoted;
-       REG CHAR        savq = quote;
+       register BOOL   savqu =quoted;
+       register CHAR   savq = quote;
        FILEHDR         fb;
 
        push(&fb); estabf(as);
@@ -176,20 +176,20 @@ static comsubst()
 {
        /* command substn */
        FILEBLK         cb;
-       REG CHAR        d;
-       REG STKPTR      savptr = fixstak();
+       register CHAR   d;
+       register STKPTR savptr = fixstak();
 
        usestak();
        while((d=readc())!=SQUOTE && d
        ){pushstak(d) ;}
 
        {
-          REG STRING   argc;
+          register STRING      argc;
           trim(argc=fixstak());
           push(&cb); estabf(argc);
        }
        {
-          REG TREPTR   t = makefork(FPOU,cmd(EOFSYM,MTFLG|NLFLG));
+          register TREPTR      t = makefork(FPOU,cmd(EOFSYM,MTFLG|NLFLG));
           INT          pv[2];
 
           /* this is done like this so that the pipe
@@ -216,9 +216,9 @@ static comsubst()
 subst(in,ot)
        INT             in, ot;
 {
-       REG CHAR        c;
+       register CHAR   c;
        FILEBLK         fb;
-       REG INT         count=CPYSIZ;
+       register INT            count=CPYSIZ;
 
        push(&fb); initf(in);
        /* DQUOTE used to stop it from quoting */
index 3694366..92d061c 100644 (file)
@@ -35,7 +35,7 @@ main(c, v)
        INT             c;
        STRING          v[];
 {
-       REG INT         rflag=ttyflg;
+       register INT            rflag=ttyflg;
 
        /* initialise storage allocation */
        stdsigs();
@@ -96,8 +96,8 @@ main(c, v)
 static void    exfile(prof)
 BOOL           prof;
 {
-       REG L_INT       mailtime = 0;
-       REG INT         userid;
+       register L_INT  mailtime = 0;
+       register INT            userid;
        struct stat     statb;
 
        /* move input */
@@ -172,7 +172,7 @@ settmp()
 }
 
 Ldup(fa, fb)
-       REG INT         fa, fb;
+       register INT            fa, fb;
 {
        dup2(fa, fb);
        close(fa);
index 70fe73c..f2408af 100644 (file)
@@ -33,9 +33,9 @@ syslook(w,syswds)
        STRING          w;
        SYSTAB          syswds;
 {
-       REG CHAR        first;
-       REG STRING      s;
-       REG SYSPTR      syscan;
+       register CHAR   first;
+       register STRING s;
+       register SYSPTR syscan;
 
        syscan=syswds; first = *w;
 
@@ -50,11 +50,11 @@ syslook(w,syswds)
 }
 
 setlist(arg,xp)
-       REG ARGPTR      arg;
+       register ARGPTR arg;
        INT             xp;
 {
        while(arg
-       ){REG STRING    s=mactrim(arg->argval);
+       ){register STRING       s=mactrim(arg->argval);
           setname(s, xp);
           arg=arg->argnxt;
           if (flags&execpr
@@ -68,8 +68,8 @@ void  setname(argi, xp)
        STRING          argi;
        INT             xp;
 {
-       REG STRING      argscan=argi;
-       REG NAMPTR      n;
+       register STRING argscan=argi;
+       register NAMPTR n;
 
        if (letter(*argscan)
        ) {     while(alphanum(*argscan) ){argscan++ ;}
@@ -89,7 +89,7 @@ void  setname(argi, xp)
 }
 
 replace(a, v)
-       REG STRING      *a;
+       register STRING *a;
        STRING          v;
 {
        free(*a); *a=make(v);
@@ -118,9 +118,9 @@ INT readvar(names)
        STRING          *names;
 {
        FILEBLK         fb;
-       REG FILE        f = &fb;
-       REG CHAR        c;
-       REG INT         rc=0;
+       register FILE   f = &fb;
+       register CHAR   c;
+       register INT            rc=0;
        NAMPTR          n=lookup(*names++); /* done now to avoid storage mess */
        STKPTR          rel=(STKPTR)relstak();
 
@@ -165,7 +165,7 @@ assnum(p, i)
 STRING make(v)
        STRING          v;
 {
-       REG STRING      p;
+       register STRING p;
 
        if (v
        ) {     movstr(v,p=alloc(length(v)));
@@ -176,10 +176,10 @@ STRING    make(v)
 
 
 NAMPTR         lookup(nam)
-       REG STRING      nam;
+       register STRING nam;
 {
-       REG NAMPTR      nscan=namep;
-       REG NAMPTR      *prev;
+       register NAMPTR nscan=namep;
+       register NAMPTR *prev;
        INT             LR;
 
        if (!chkid(nam)
@@ -206,7 +206,7 @@ NAMPTR              lookup(nam)
 static BOOL    chkid(nam)
        STRING          nam;
 {
-       REG CHAR *      cp=nam;
+       register CHAR * cp=nam;
 
        if (!letter(*cp)
        ) {     return(FALSE);
@@ -228,7 +228,7 @@ namscan(fn)
 }
 
 static void    namwalk(np)
-       REG NAMPTR      np;
+       register NAMPTR np;
 {
        if (np
        ) {     namwalk(np->namlft);
@@ -240,7 +240,7 @@ static void namwalk(np)
 void   printnam(n)
        NAMPTR          n;
 {
-       REG STRING      s;
+       register STRING s;
 
        sigchk();
        if (s=n->namval
@@ -251,9 +251,9 @@ void        printnam(n)
 }
 
 static STRING  staknam(n)
-       REG NAMPTR      n;
+       register NAMPTR n;
 {
-       REG STRING      p;
+       register STRING p;
 
        p=movstr(n->namid,staktop);
        p=movstr("=",p);
@@ -262,7 +262,7 @@ static STRING       staknam(n)
 }
 
 void   exname(n)
-       REG NAMPTR      n;
+       register NAMPTR n;
 {
        if (n->namflg&N_EXPORT
        ) {     free(n->namenv);
@@ -273,7 +273,7 @@ void        exname(n)
 }
 
 void   printflg(n)
-       REG NAMPTR              n;
+       register NAMPTR         n;
 {
        if (n->namflg&N_EXPORT
        ) {     prs(export); blank();
@@ -288,7 +288,7 @@ void        printflg(n)
 
 void   sh_getenv(void)
 {
-       REG STRING      *e=environ;
+       register STRING *e=environ;
 
        while(*e
        ){setname(*e++, N_ENVNAM) ;}
@@ -314,7 +314,7 @@ void        pushnam(n)
 
 STRING *sh_setenv(void)
 {
-       REG STRING      *er;
+       register STRING *er;
 
        namec=0;
        namscan(countnam);
index 02b3830..4a486d2 100644 (file)
@@ -34,7 +34,7 @@ prp()
 void   prs(as)
        STRING          as;
 {
-       REG STRING      s;
+       register STRING s;
 
        if (s=as
        ) {     write(output,s,length(s)-1);
@@ -52,7 +52,7 @@ void  prc(c)
 prt(t)
        L_INT           t;
 {
-       REG INT hr, min, sec;
+       register INT    hr, min, sec;
 
        t += 30; t /= 60;
        sec=t%60; t /= 60;
@@ -72,7 +72,7 @@ prn(n)
 
 itos(n)
 {
-       REG char *abuf; REG POS a, i; INT pr, d;
+       register char *abuf; register POS a, i; INT pr, d;
        abuf=numbuf; pr=FALSE; a=n;
        for (i=10000; i!=1; i/=10
        ){      if ((pr |= (d=a/i)) ) { *abuf++=d+'0' ;}
@@ -85,9 +85,9 @@ itos(n)
 stoi(icp)
 STRING icp;
 {
-       REG CHAR        *cp = icp;
-       REG INT         r = 0;
-       REG CHAR        c;
+       register CHAR   *cp = icp;
+       register INT            r = 0;
+       register CHAR   c;
 
        while((c = *cp, digit(c)) && c && r>=0
        ){ r = r*10 + c - '0'; cp++ ;}
index 2f09533..b6e9fb0 100644 (file)
@@ -36,8 +36,8 @@ STRING                sysmsg[];
 void   initio(iop)
        IOPTR           iop;
 {
-       REG STRING      ion;
-       REG INT         iof, fd;
+       register STRING ion;
+       register INT            iof, fd;
 
        if(iop
        ) {     iof=iop->iofile;
@@ -73,7 +73,7 @@ void  initio(iop)
 STRING getpath(s)
        STRING          s;
 {
-       REG STRING      path;
+       register STRING path;
        if(any('/',s)
        ) {     if(flags&rshflg
                ) {     failed(s, restricted);
@@ -86,9 +86,9 @@ STRING        getpath(s)
 }
 
 INT    pathopen(path, name)
-       REG STRING      path, name;
+       register STRING path, name;
 {
-       REG UFD         f;
+       register UFD            f;
 
        do { path=catpath(path,name);
        } while ( (f=open(curstak(),0))<0 && path );
@@ -96,11 +96,11 @@ INT pathopen(path, name)
 }
 
 STRING catpath(path,name)
-       REG STRING      path;
+       register STRING path;
        STRING          name;
 {
        /* leaves result on top of stack */
-       REG STRING      scanp = path,
+       register STRING scanp = path,
                        argp = locstak();
 
        while(*scanp && *scanp!=COLON ){*argp++ = *scanp++ ;}
@@ -117,8 +117,8 @@ static STRING       *xecenv;
 void   execa(at)
        STRING          at[];
 {
-       REG STRING      path;
-       REG STRING      *t = at;
+       register STRING path;
+       register STRING *t = at;
 
        if((flags&noexec)==0
        ) {     xecmsg=notfound; path=getpath(*t);
@@ -131,9 +131,9 @@ void        execa(at)
 
 static STRING  execs(ap,t)
        STRING          ap;
-       REG STRING      t[];
+       register STRING t[];
 {
-       REG STRING      p, prefix;
+       register STRING p, prefix;
 
        prefix=catpath(ap,t[0]);
        trim(p=curstak());
@@ -176,7 +176,7 @@ static INT  pwc;
 
 postclr()
 {
-       REG INT         *pw = pwlist;
+       register INT            *pw = pwlist;
 
        while(pw <= &pwlist[pwc]
        ){*pw++ = 0 ;}
@@ -186,7 +186,7 @@ postclr()
 void   post(pcsid)
        INT             pcsid;
 {
-       REG INT         *pw = pwlist;
+       register INT            *pw = pwlist;
 
        if(pcsid
        ) {     while(*pw ){pw++ ;}
@@ -207,12 +207,12 @@ void      await(i)
 
        post(i);
        while(pwc
-       ){      REG INT         p;
-               REG INT         sig;
+       ){      register INT            p;
+               register INT            sig;
                INT             w_hi;
 
                {
-                  REG INT      *pw=pwlist;
+                  register INT *pw=pwlist;
                   p=wait(&w);
                   while(pw <= &pwlist[ipwc]
                   ){if(*pw==p
@@ -256,9 +256,9 @@ BOOL                nosubst;
 trim(at)
        STRING          at;
 {
-       REG STRING      p;
-       REG CHAR        c;
-       REG CHAR        q=0;
+       register STRING p;
+       register CHAR   c;
+       register CHAR   q=0;
 
        if(p=at
        ) {     while(c = *p
@@ -270,7 +270,7 @@ trim(at)
 STRING mactrim(s)
        STRING          s;
 {
-       REG STRING      t=macro(s);
+       register STRING t=macro(s);
        trim(t);
        return(t);
 }
@@ -278,8 +278,8 @@ STRING      mactrim(s)
 STRING *scan(argn)
        INT             argn;
 {
-       REG ARGPTR      argp = (ARGPTR)(Rcheat(gchain)&~ARGMK);
-       REG STRING      *comargn, *comargm;
+       register ARGPTR argp = (ARGPTR)(Rcheat(gchain)&~ARGMK);
+       register STRING *comargn, *comargm;
 
        comargn=(STRING *)getstak(BYTESPERWORD*argn+BYTESPERWORD); comargm = comargn += argn; *comargn = ENDARGS;
 
@@ -302,7 +302,7 @@ static void gsort(from,to)
        STRING          from[], to[];
 {
        INT             k, m, n;
-       REG INT         i, j;
+       register INT            i, j;
 
        if((n=to-from)<=1 ) { return ;}
 
@@ -312,7 +312,7 @@ static void gsort(from,to)
        ){ k=n-m;
            for (j=0; j<k; j++
            ){  for (i=j; i>=0; i-=m
-               ){ REG STRING *fromi; fromi = &from[i];
+               ){ register STRING *fromi; fromi = &from[i];
                    if(cf(fromi[m],fromi[0])>0
                    ) { break;
                    } else { STRING s; s=fromi[m]; fromi[m]=fromi[0]; fromi[0]=s;
@@ -327,9 +327,9 @@ static void gsort(from,to)
 INT    getarg(ac)
        COMPTR          ac;
 {
-       REG ARGPTR      argp;
-       REG INT         count=0;
-       REG COMPTR      c;
+       register ARGPTR argp;
+       register INT            count=0;
+       register COMPTR c;
 
        if(c=ac
        ) {     argp=c->comarg;
@@ -342,10 +342,10 @@ INT       getarg(ac)
 }
 
 static INT     split(s)
-       REG STRING      s;
+       register STRING s;
 {
-       REG STRING      argp;
-       REG INT         c;
+       register STRING argp;
+       register INT            c;
        INT             count=0;
 
        for(;;) {
index fc0a35d..80abf6f 100644 (file)
@@ -21,8 +21,8 @@ STKPTR                stakbot=nullstr;
 STKPTR getstak(asize)
        INT             asize;
 {      /* allocate requested stack */
-       REG STKPTR      oldstak;
-       REG INT         size;
+       register STKPTR oldstak;
+       register INT            size;
 
        size=round(asize,BYTESPERWORD);
        oldstak=stakbot;
@@ -50,16 +50,16 @@ STKPTR      savstak()
 }
 
 STKPTR endstak(argp)
-       REG STRING      argp;
+       register STRING argp;
 {      /* tidy up after `locstak' */
-       REG STKPTR      oldstak;
+       register STKPTR oldstak;
        *argp++=0;
        oldstak=stakbot; stakbot=staktop=(STKPTR)round(argp,BYTESPERWORD);
        return(oldstak);
 }
 
 void   tdystak(x)
-       REG STKPTR      x;
+       register STKPTR         x;
 {
        /* try to bring stack back to x */
        while(ADR(stakbsy)>ADR(x)
index 65c1d40..ddd1591 100644 (file)
 
 
 STRING movstr(a,b)
-       REG STRING      a, b;
+       register STRING a, b;
 {
        while(*b++ = *a++ );
        return(--b);
 }
 
 INT    any(c,s)
-       REG CHAR        c;
+       register CHAR   c;
        STRING          s;
 {
-       REG CHAR d;
+       register CHAR d;
 
        while(d = *s++
        ){if(d==c
@@ -37,7 +37,7 @@ INT   any(c,s)
 }
 
 INT    cf(s1, s2)
-       REG STRING s1, s2;
+       register STRING s1, s2;
 {
        while(*s1++ == *s2
        ){if(*s2++==0
@@ -50,7 +50,7 @@ INT   cf(s1, s2)
 INT    length(as)
        STRING as;
 {
-       REG STRING s;
+       register STRING s;
 
        if(s=as ) { while(*s++ ); ;}
        return(s-as);
index 4053bde..cbb4ead 100644 (file)
@@ -21,8 +21,8 @@ static readb();
 
 word()
 {
-       REG CHAR        c, d;
-       REG CHAR        *argp=locstak()+BYTESPERWORD;
+       register CHAR   c, d;
+       register CHAR   *argp=locstak()+BYTESPERWORD;
        INT             alpha=1;
 
        wdnum=0; wdset=0;
@@ -75,7 +75,7 @@ word()
 nextc(quote)
        CHAR            quote;
 {
-       REG CHAR        c, d;
+       register CHAR   c, d;
        if((d=readc())==ESCAPE
        ) {     if((c=readc())==NL
                ) {     chkpr(NL); d=nextc(quote);
@@ -89,9 +89,9 @@ nextc(quote)
 
 readc()
 {
-       REG CHAR        c;
-       REG INT         len;
-       REG FILE        f;
+       register CHAR   c;
+       register INT            len;
+       register FILE   f;
 
 retry:
        if(peekc
@@ -120,8 +120,8 @@ retry:
 
 static readb()
 {
-       REG FILE        f=standin;
-       REG INT         len;
+       register FILE   f=standin;
+       register INT            len;
 
        do {    if(trapnote&SIGSET ) { newline(); sigchk() ;}
        } while ( (len=read(f->fdes,f->fbuf,f->fsiz))<0 && trapnote );
index 77384ce..68456a7 100644 (file)
@@ -27,15 +27,15 @@ execute(argt, execflg, pf1, pf2)
        INT             *pf1, *pf2;
 {
        /* `stakbot' is preserved by this routine */
-       REG TREPTR      t;
+       register TREPTR t;
        STKPTR          sav=savstak();
 
        sigchk();
 
        if( (t=argt) && execbrk==0
-       ) {     REG INT         treeflgs;
+       ) {     register INT            treeflgs;
                INT             oldexit, type;
-               REG STRING      *com;
+               register STRING *com;
 
                treeflgs = t->tretyp; type = treeflgs&COMMSK;
                oldexit=exitval; exitval=0;
@@ -70,7 +70,7 @@ execute(argt, execflg, pf1, pf2)
 
                                case SYSDOT:
                                        if( a1
-                                       ) {     REG INT         f;
+                                       ) {     register INT            f;
        
                                                if( (f=pathopen(getpath(a1), a1)) < 0
                                                ) { failed(a1,notfound);
@@ -382,12 +382,12 @@ execute(argt, execflg, pf1, pf2)
 
                case TSW:
                        {
-                          REG STRING   r = mactrim(((SWPTR)t)->swarg);
+                          register STRING      r = mactrim(((SWPTR)t)->swarg);
                           t=(TREPTR)((SWPTR)t)->swlst;
                           while(t
                           ){ARGPTR             rex=((REGPTR)t)->regptr;
                                while(rex
-                               ){REG STRING    s;
+                               ){register STRING       s;
                                        if( gmatch(r,s=macro(rex->argval)) || (trim(s), eq(r,s))
                                        ) {     execute(((REGPTR)t)->regcom,0);
                                                t=0; break;