sh: kill off OD/DO
authorAlan Cox <alan@linux.intel.com>
Sun, 10 May 2015 21:29:53 +0000 (22:29 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 10 May 2015 21:29:53 +0000 (22:29 +0100)
16 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/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 e269b1a..ef94dfc 100644 (file)
@@ -43,7 +43,7 @@ INT   options(argc,argv)
                while(*++cp
                ){flagc=flagchar;
 
-                       while(*flagc && *flagc != *cp ){flagc++ OD
+                       while(*flagc && *flagc != *cp ){flagc++ ;}
                        if (*cp == *flagc
                        ) {     flags |= flagval[flagc-flagchar];
                        } else if (*cp=='c' && argc>2 && comdiv==0
@@ -51,7 +51,7 @@ INT   options(argc,argv)
                                argp[1]=argp[0]; argp++; argc--;
                        } else {        failed(argv[1],badopt);
                        ;}
-               OD
+               ;}
                argp[1]=argp[0]; argc--;
        ;}
 
@@ -63,7 +63,7 @@ INT   options(argc,argv)
           ) { *flagp++ = *flagc;
           ;}
           flagc++;
-       OD
+       ;}
        *flagp++=0;
 
        return(argc);
@@ -76,7 +76,7 @@ void  setargs(argi)
        REG STRING      *argp=argi;
        REG INT         argn=0;
 
-       while(Rcheat(*argp++)!=ENDARGS ){argn++ OD
+       while(Rcheat(*argp++)!=ENDARGS ){argn++ ;}
 
        /* free old ones unless on for loop chain */
        freeargs(dolh);
@@ -96,7 +96,7 @@ freeargs(blk)
        ) {     argr = argblk->dolnxt;
                if ((--argblk->doluse)==0
                ) {     for ( argp=(STRING *)argblk->dolarg; Rcheat(*argp)!=ENDARGS; argp++
-                       ){free(*argp) OD
+                       ){free(*argp) ;}
                        free(argblk);
                ;}
        ;}
@@ -115,7 +115,7 @@ static STRING *     copyargs(from, n)
        dolv=np;
 
        while(n--
-       ){*np++ = make(*fp++) OD
+       ){*np++ = make(*fp++) ;}
        *np++ = ENDARGS;
        return(pp);
 }
index aa7a378..e8135ae 100644 (file)
@@ -36,7 +36,7 @@ ADDRESS       alloc(nbytes)
                REG BLKPTR      p = blokp;
                REG BLKPTR      q;
                do {    if(!busy(p)
-                       ) {     while(!busy(q = p->word) ){p->word = q->word OD
+                       ) {     while(!busy(q = p->word) ){p->word = q->word ;}
                                if(ADR(q)-ADR(p) >= rbytes
                                ) {     blokp = BLK(ADR(p)+rbytes);
                                        if(q > blokp
index f8d36db..d80d2ef 100644 (file)
@@ -126,7 +126,7 @@ static TREPTR       list(flg)
        r = term(flg);
        while(r && ((b=(wdval==ANDFSYM)) || wdval==ORFSYM)
        ){r = makelist((b ? TAND : TORF), r, term(NLFLG));
-       OD
+       ;}
        return(r);
 }
 
@@ -297,7 +297,7 @@ static TREPTR       item(flag)
                        if (flag
                        ) { ((COMPTR)t)->comio=inout(((COMPTR)t)->comio);
                        ;}
-                  OD
+                  ;}
 
                   ((COMPTR)t)->comtyp=TCOM;
                   ((COMPTR)t)->comset=(ARGPTR)argset;
@@ -316,7 +316,7 @@ static TREPTR       item(flag)
 
 static int     skipnl()
 {
-       while((reserv++, word()==NL) ){chkpr(NL) OD
+       while((reserv++, word()==NL) ){chkpr(NL) ;}
        return(wdval);
 }
 
@@ -387,7 +387,7 @@ static void prsym(sym)
        ) {     REG SYSPTR      sp=reserved;
                while(sp->sysval
                        && sp->sysval!=sym
-               ){sp++ OD
+               ){sp++ ;}
                prs(sp->sysnam);
        } else if ( sym==EOFSYM
        ) {     prs(endoffile);
index 815b17a..482858b 100644 (file)
@@ -82,5 +82,5 @@ rmtemp(base)
        while(iotemp>base
        ){ unlink(iotemp->ioname);
            iotemp=iotemp->iolst;
-       OD
+       ;}
 }
index 84b5312..d709481 100644 (file)
@@ -54,7 +54,7 @@ INT   expand(as,rflg)
                } else if ( *cs=='/'
                ) {     slash++;
                ;}
-          OD
+          ;}
        }
 
        for(;;) {       if (cs==s
@@ -89,7 +89,7 @@ INT   expand(as,rflg)
                        if (gmatch(entry.d_name, cs)
                        ) {     addg(s,entry.d_name,rescan); count++;
                        ;}
-               OD
+               ;}
                close(dirf);
 
                if (rescan
@@ -100,7 +100,7 @@ INT expand(as,rflg)
                                while(rchain
                                ){count += expand(rchain->argval,1);
                                        rchain=rchain->argnxt;
-                               OD
+                               ;}
                        ;}
                        *rescan='/';
                ;}
@@ -110,7 +110,7 @@ INT expand(as,rflg)
           REG CHAR     c;
           s=as;
           while(c = *s
-          ){*s++=(c&STRIP?c:'/') OD
+          ){*s++=(c&STRIP?c:'/') ;}
        }
        return(count);
 }
@@ -137,7 +137,7 @@ gmatch(s, p)
                        ) {     if (lc<=scc && scc<=(*p++) ) { ok++ ;}
                        } else {        if (scc==(lc=(c&STRIP)) ) { ok++ ;}
                        ;}
-               OD
+               ;}
                return(0);
                }
 
@@ -151,7 +151,7 @@ gmatch(s, p)
                if (*p==0 ) { return(1) ;}
                --s;
                while(*s
-               ){ if (gmatch(s++,p) ) { return(1) ;} OD
+               ){ if (gmatch(s++,p) ) { return(1) ;} ;}
                return(0);
 
            case 0:
@@ -174,9 +174,9 @@ static void addg(as1,as2,as3)
                        break;
                ;}
                *s2++=c;
-       OD
+       ;}
        s1=as2;
-       while(*s2 = *s1++ ){s2++ OD
+       while(*s2 = *s1++ ){s2++ ;}
        if (s1=as3
        ) {     *s2++='/';
                while(*s2++ = *++s1 );
index 73e54e3..ddf8e00 100644 (file)
@@ -80,7 +80,7 @@ oldsigs()
            ) { clrsig(i);
            ;}
            trapflg[i]=0;
-       OD
+       ;}
        trapnote=0;
 }
 
@@ -110,5 +110,5 @@ chktrap()
                        exitval=savxit; exitset();
                ;}
           ;}
-       OD
+       ;}
 }
index 493a353..2d3a601 100644 (file)
@@ -125,7 +125,7 @@ copy(ioparg)
 
                for (;;) {
                        clinep=cline; chkpr(NL);
-                       while((c = (nosubst ? readc() :  nextc(*ends)),  !eolchar(c)) ){*clinep++ = c OD
+                       while((c = (nosubst ? readc() :  nextc(*ends)),  !eolchar(c)) ){*clinep++ = c ;}
                        *clinep=0;
                        if(eof || eq(cline,ends) ) { break ;}
                        *clinep++=NL;
index 0276d04..db4008a 100644 (file)
@@ -14,7 +14,6 @@
 #define UNION  TYPE union
 #define REG    register
 
-#define OD     ;}
 
 #define TRUE   (-1)
 #define FALSE  0
index c708b9f..7ab3f0f 100644 (file)
@@ -27,7 +27,7 @@ static STRING copyto(endch)
        REG CHAR        c;
 
        while((c=getch(endch))!=endch && c
-       ){pushstak(c|quote) OD
+       ){pushstak(c|quote) ;}
        zerostak();
        if(c!=endch ) { error(badsub) ;}
 }
@@ -48,7 +48,7 @@ static skipto(endch)
                                ) {     skipto('}');
                                ;}
                }
-       OD
+       ;}
        if(c!=endch ) { error(badsub) ;}
 }
 
@@ -75,7 +75,7 @@ retry:
                        if(bra=(c==BRACE) ) { c=readc() ;}
                        if(letter(c)
                        ) {     argp=(STRING)relstak();
-                               while(alphanum(c) ){pushstak(c); c=readc() OD
+                               while(alphanum(c) ){pushstak(c); c=readc() ;}
                                zerostak();
                                n=lookup(absstak(argp)); setstak(argp);
                                v = n->namval; id = n->namid;
@@ -120,7 +120,7 @@ retry:
                        ) {     if(c!='+'
                                ) {     for (;;) {
                                            while(c = *v++
-                                            ){pushstak(c|quote); OD
+                                            ){pushstak(c|quote); ;}
                                             if(dolg==0 || (++dolg>dolc)
                                             ) { break;
                                             } else { v=dolv[dolg]; pushstak(SP|(*id=='*' ? quote : 0));
@@ -181,7 +181,7 @@ static comsubst()
 
        usestak();
        while((d=readc())!=SQUOTE && d
-       ){pushstak(d) OD
+       ){pushstak(d) ;}
 
        {
           REG STRING   argc;
@@ -201,13 +201,13 @@ static comsubst()
           close(pv[OTPIPE]);
        }
        tdystak(savptr); staktop=movstr(savptr,stakbot);
-       while(d=readc() ){pushstak(d|quote) OD
+       while(d=readc() ){pushstak(d|quote) ;}
        await(0);
        while(stakbot!=staktop
        ){      if((*--staktop&STRIP)!=NL
                ) {     ++staktop; break;
                ;}
-       OD
+       ;}
        pop();
 }
 
@@ -227,7 +227,7 @@ subst(in,ot)
           if(--count == 0
           ) {  flush(ot); count=CPYSIZ;
           ;}
-       OD
+       ;}
        flush(ot);
        pop();
 }
index 40f2ad3..70fe73c 100644 (file)
@@ -45,7 +45,7 @@ syslook(w,syswds)
            ) { return(syscan->sysval);
            ;}
            syscan++;
-       OD
+       ;}
        return(0);
 }
 
@@ -61,7 +61,7 @@ setlist(arg,xp)
           ) { prs(s);
                if (arg ) { blank(); } else { newline(); ;}
           ;}
-       OD
+       ;}
 }
 
 void   setname(argi, xp)
@@ -72,7 +72,7 @@ void  setname(argi, xp)
        REG NAMPTR      n;
 
        if (letter(*argscan)
-       ) {     while(alphanum(*argscan) ){argscan++ OD
+       ) {     while(alphanum(*argscan) ){argscan++ ;}
                if (*argscan=='='
                ) {     *argscan = 0;
                        n=lookup(argi);
@@ -147,7 +147,7 @@ INT readvar(names)
        while(n
        ){assign(n, nullstr);
           if (*names ) { n=lookup(*names++); } else { n=0; ;}
-       OD
+       ;}
 
        if (eof ) { rc=1 ;}
        lseek(0, (long)(f->fnxt-f->fend), 1);
@@ -193,7 +193,7 @@ NAMPTR              lookup(nam)
                } else {        prev = &(nscan->namrgt);
                ;}
                nscan = *prev;
-       OD
+       ;}
 
        /* add name node */
        nscan=(NAMPTR)alloc(sizeof *nscan);
@@ -214,7 +214,7 @@ static BOOL chkid(nam)
                ){if (!alphanum(*cp)
                   ) {  return(FALSE);
                   ;}
-               OD
+               ;}
        ;}
        return(TRUE);
 }
@@ -291,7 +291,7 @@ void        sh_getenv(void)
        REG STRING      *e=environ;
 
        while(*e
-       ){setname(*e++, N_ENVNAM) OD
+       ){setname(*e++, N_ENVNAM) ;}
 }
 
 static INT     namec;
index b7e2902..02b3830 100644 (file)
@@ -77,7 +77,7 @@ itos(n)
        for (i=10000; i!=1; i/=10
        ){      if ((pr |= (d=a/i)) ) { *abuf++=d+'0' ;}
                a %= i;
-       OD
+       ;}
        *abuf++=a+'0';
        *abuf++=0;
 }
@@ -90,7 +90,7 @@ STRING        icp;
        REG CHAR        c;
 
        while((c = *cp, digit(c)) && c && r>=0
-       ){ r = r*10 + c - '0'; cp++ OD
+       ){ r = r*10 + c - '0'; cp++ ;}
        if (r<0 || cp==icp
        ) {     failed(icp,badnum);
        } else {        return(r);
index b48b35c..2f09533 100644 (file)
@@ -103,7 +103,7 @@ STRING      catpath(path,name)
        REG STRING      scanp = path,
                        argp = locstak();
 
-       while(*scanp && *scanp!=COLON ){*argp++ = *scanp++ OD
+       while(*scanp && *scanp!=COLON ){*argp++ = *scanp++ ;}
        if(scanp!=path ) { *argp++='/' ;}
        if(*scanp==COLON ) { scanp++ ;}
        path=(*scanp ? scanp : 0); scanp=name;
@@ -179,7 +179,7 @@ postclr()
        REG INT         *pw = pwlist;
 
        while(pw <= &pwlist[pwc]
-       ){*pw++ = 0 OD
+       ){*pw++ = 0 ;}
        pwc=0;
 }
 
@@ -189,7 +189,7 @@ void        post(pcsid)
        REG INT         *pw = pwlist;
 
        if(pcsid
-       ) {     while(*pw ){pw++ OD
+       ) {     while(*pw ){pw++ ;}
                if(pwc >= MAXP-1
                ) {     pw--;
                } else {        pwc++;
@@ -219,7 +219,7 @@ void        await(i)
                      ) { *pw=0; pwc--;
                      } else { pw++;
                      ;}
-                  OD
+                  ;}
                }
 
                if(p == -1 ) { continue ;}
@@ -243,7 +243,7 @@ void        await(i)
                ) {     rc = (sig ? sig|SIGFLG : w_hi);
                ;}
                wx |= w;
-       OD
+       ;}
 
        if(wx && flags&errflg
        ) {     exitsh(rc);
@@ -262,7 +262,7 @@ trim(at)
 
        if(p=at
        ) {     while(c = *p
-               ){*p++=c&STRIP; q |= c OD
+               ){*p++=c&STRIP; q |= c ;}
        ;}
        nosubst=q&QUOTE;
 }
@@ -294,7 +294,7 @@ STRING      *scan(argn)
                ;}
                /* Lcheat(argp) &= ~ARGMK; */
                argp = (ARGPTR)(Rcheat(argp)&~ARGMK);
-       OD
+       ;}
        return(comargn);
 }
 
@@ -317,9 +317,9 @@ static void gsort(from,to)
                    ) { break;
                    } else { STRING s; s=fromi[m]; fromi[m]=fromi[0]; fromi[0]=s;
                    ;}
-               OD
-           OD
-       OD
+               ;}
+           ;}
+       ;}
 }
 
 /* Argument list generation */
@@ -336,7 +336,7 @@ INT getarg(ac)
                while(argp
                ){      count += split(macro(argp->argval));
                        argp=argp->argnxt;
-               OD
+               ;}
        ;}
        return(count);
 }
@@ -351,7 +351,7 @@ static INT  split(s)
        for(;;) {
                sigchk(); argp=locstak()+BYTESPERWORD;
                while((c = *s++, !any(c,ifsnod.namval) && c)
-               ){*argp++ = c OD
+               ){*argp++ = c ;}
                if(argp==staktop+BYTESPERWORD
                ) {     if(c
                        ) {     continue;
index c21a458..fc0a35d 100644 (file)
@@ -65,7 +65,7 @@ void  tdystak(x)
        while(ADR(stakbsy)>ADR(x)
        ){free(stakbsy);
           stakbsy = stakbsy->word;
-       OD
+       ;}
        staktop=stakbot=max(ADR(x),ADR(stakbas));
        rmtemp(x);
 }
index ff01268..65c1d40 100644 (file)
@@ -32,7 +32,7 @@ INT   any(c,s)
        ){if(d==c
                ) {     return(TRUE);
                ;}
-       OD
+       ;}
        return(FALSE);
 }
 
@@ -43,7 +43,7 @@ INT   cf(s1, s2)
        ){if(*s2++==0
                ) {     return(0);
                ;}
-       OD
+       ;}
        return(*--s1 - *s2);
 }
 
index 7fa5af0..4053bde 100644 (file)
@@ -32,7 +32,7 @@ word()
        ) {     do {    if(c==LITERAL
                        ) {     *argp++=(DQUOTE);
                                while((c=readc()) && c!=LITERAL
-                               ){*argp++=(c|QUOTE); chkpr(c) OD
+                               ){*argp++=(c|QUOTE); chkpr(c) ;}
                                *argp++=(DQUOTE);
                        } else {        *argp++=(c);
                                if(c=='=' ) { wdset |= alpha ;}
@@ -40,7 +40,7 @@ word()
                                if(qotchar(c)
                                ) {     d=c;
                                        while((*argp++=(c=nextc(d))) && c!=d
-                                       ){chkpr(c) OD
+                                       ){chkpr(c) ;}
                                ;}
                        ;}
                } while ( (c=nextc(0), !eofmeta(c)) );
index 6bb9698..77384ce 100644 (file)
@@ -62,7 +62,7 @@ execute(argt, execflg, pf1, pf2)
                                if( flags&execpr
                                ) {     argn=0; prs(execpmsg);
                                        while(com[argn]!=ENDARGS
-                                       ){prs(com[argn++]); blank() OD
+                                       ){prs(com[argn++]); blank() ;}
                                        newline();
                                ;}
 
@@ -120,7 +120,7 @@ execute(argt, execflg, pf1, pf2)
                                                        } else {        ignsig(i);
                                                        ;}
                                                   ;}
-                                               OD
+                                               ;}
                                        } else {        /* print out current traps */
                                                INT             i;
        
@@ -128,7 +128,7 @@ execute(argt, execflg, pf1, pf2)
                                                ){if( trapcom[i]
                                                   ) {  prn(i); prs(colon); prs(trapcom[i]); newline();
                                                   ;}
-                                               OD
+                                               ;}
                                        ;}
                                        break;
        
@@ -191,7 +191,7 @@ execute(argt, execflg, pf1, pf2)
        
                                        if( a1
                                        ) {     while(*++com
-                                               ){attrib(lookup(*com), exitval) OD
+                                               ){attrib(lookup(*com), exitval) ;}
                                        } else {        namscan(printflg);
                                        ;}
                                        exitval=0;
@@ -240,7 +240,7 @@ execute(argt, execflg, pf1, pf2)
                        if( execflg && (treeflgs&(FAMP|FPOU))==0
                        ) {     parent=0;
                        } else {        while((parent=fork()) == -1
-                               ){sigchk(); alarm(10); pause() OD
+                               ){sigchk(); alarm(10); pause() ;}
                        ;}
 
                        if( parent
@@ -351,7 +351,7 @@ execute(argt, execflg, pf1, pf2)
                           ){assign(n,*args++);
                                execute(((FORPTR)t)->fortre,0);
                                if( execbrk<0 ) { execbrk=0 ;}
-                          OD
+                          ;}
                           if( breakcnt ) { breakcnt-- ;}
                           execbrk=breakcnt; loopcnt--;
                           argfor=freeargs(argsav);
@@ -367,7 +367,7 @@ execute(argt, execflg, pf1, pf2)
                           while(execbrk==0 && (execute(((WHPTR)t)->whtre,0)==0)==(type==TWH)
                           ){i=execute(((WHPTR)t)->dotre,0);
                              if( execbrk<0 ) { execbrk=0 ;}
-                          OD
+                          ;}
                           if( breakcnt ) { breakcnt-- ;}
                           execbrk=breakcnt; loopcnt--; exitval=i;
                        }
@@ -393,9 +393,9 @@ execute(argt, execflg, pf1, pf2)
                                                t=0; break;
                                        } else {        rex=((ARGPTR)rex)->argnxt;
                                        ;}
-                               OD
+                               ;}
                                if( t ) { t=(TREPTR)((REGPTR)t)->regnxt ;}
-                          OD
+                          ;}
                        }
                        break;
                }