From: Alan Cox Date: Sun, 10 May 2015 21:29:53 +0000 (+0100) Subject: sh: kill off OD/DO X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=4605f39678eb42a4467f3d7132db9d7f273b6077;p=FUZIX.git sh: kill off OD/DO --- diff --git a/Applications/V7/cmd/sh/args.c b/Applications/V7/cmd/sh/args.c index e269b1aa..ef94dfc6 100644 --- a/Applications/V7/cmd/sh/args.c +++ b/Applications/V7/cmd/sh/args.c @@ -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); } diff --git a/Applications/V7/cmd/sh/blok.c b/Applications/V7/cmd/sh/blok.c index aa7a3784..e8135aeb 100644 --- a/Applications/V7/cmd/sh/blok.c +++ b/Applications/V7/cmd/sh/blok.c @@ -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 diff --git a/Applications/V7/cmd/sh/cmd.c b/Applications/V7/cmd/sh/cmd.c index f8d36dbb..d80d2ef7 100644 --- a/Applications/V7/cmd/sh/cmd.c +++ b/Applications/V7/cmd/sh/cmd.c @@ -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); diff --git a/Applications/V7/cmd/sh/error.c b/Applications/V7/cmd/sh/error.c index 815b17a7..482858b7 100644 --- a/Applications/V7/cmd/sh/error.c +++ b/Applications/V7/cmd/sh/error.c @@ -82,5 +82,5 @@ rmtemp(base) while(iotemp>base ){ unlink(iotemp->ioname); iotemp=iotemp->iolst; - OD + ;} } diff --git a/Applications/V7/cmd/sh/expand.c b/Applications/V7/cmd/sh/expand.c index 84b53122..d7094814 100644 --- a/Applications/V7/cmd/sh/expand.c +++ b/Applications/V7/cmd/sh/expand.c @@ -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 ); diff --git a/Applications/V7/cmd/sh/fault.c b/Applications/V7/cmd/sh/fault.c index 73e54e3a..ddf8e009 100644 --- a/Applications/V7/cmd/sh/fault.c +++ b/Applications/V7/cmd/sh/fault.c @@ -80,7 +80,7 @@ oldsigs() ) { clrsig(i); ;} trapflg[i]=0; - OD + ;} trapnote=0; } @@ -110,5 +110,5 @@ chktrap() exitval=savxit; exitset(); ;} ;} - OD + ;} } diff --git a/Applications/V7/cmd/sh/io.c b/Applications/V7/cmd/sh/io.c index 493a3534..2d3a601a 100644 --- a/Applications/V7/cmd/sh/io.c +++ b/Applications/V7/cmd/sh/io.c @@ -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; diff --git a/Applications/V7/cmd/sh/mac.h b/Applications/V7/cmd/sh/mac.h index 0276d047..db4008a8 100644 --- a/Applications/V7/cmd/sh/mac.h +++ b/Applications/V7/cmd/sh/mac.h @@ -14,7 +14,6 @@ #define UNION TYPE union #define REG register -#define OD ;} #define TRUE (-1) #define FALSE 0 diff --git a/Applications/V7/cmd/sh/macro.c b/Applications/V7/cmd/sh/macro.c index c708b9f4..7ab3f0fa 100644 --- a/Applications/V7/cmd/sh/macro.c +++ b/Applications/V7/cmd/sh/macro.c @@ -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(); } diff --git a/Applications/V7/cmd/sh/name.c b/Applications/V7/cmd/sh/name.c index 40f2ad30..70fe73c7 100644 --- a/Applications/V7/cmd/sh/name.c +++ b/Applications/V7/cmd/sh/name.c @@ -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; diff --git a/Applications/V7/cmd/sh/print.c b/Applications/V7/cmd/sh/print.c index b7e2902a..02b38301 100644 --- a/Applications/V7/cmd/sh/print.c +++ b/Applications/V7/cmd/sh/print.c @@ -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); diff --git a/Applications/V7/cmd/sh/service.c b/Applications/V7/cmd/sh/service.c index b48b35ce..2f095338 100644 --- a/Applications/V7/cmd/sh/service.c +++ b/Applications/V7/cmd/sh/service.c @@ -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"E; } @@ -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; diff --git a/Applications/V7/cmd/sh/stak.c b/Applications/V7/cmd/sh/stak.c index c21a4584..fc0a35d2 100644 --- a/Applications/V7/cmd/sh/stak.c +++ b/Applications/V7/cmd/sh/stak.c @@ -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); } diff --git a/Applications/V7/cmd/sh/string.c b/Applications/V7/cmd/sh/string.c index ff012684..65c1d406 100644 --- a/Applications/V7/cmd/sh/string.c +++ b/Applications/V7/cmd/sh/string.c @@ -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); } diff --git a/Applications/V7/cmd/sh/word.c b/Applications/V7/cmd/sh/word.c index 7fa5af05..4053bdeb 100644 --- a/Applications/V7/cmd/sh/word.c +++ b/Applications/V7/cmd/sh/word.c @@ -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)) ); diff --git a/Applications/V7/cmd/sh/xec.c b/Applications/V7/cmd/sh/xec.c index 6bb96983..77384ce8 100644 --- a/Applications/V7/cmd/sh/xec.c +++ b/Applications/V7/cmd/sh/xec.c @@ -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; }