From fa705d3a7191176329f8811df3dd0a13c42e6109 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 10 May 2015 22:16:59 +0100 Subject: [PATCH] sh: kill off DONE --- Applications/V7/cmd/sh/args.c | 4 ++-- Applications/V7/cmd/sh/blok.c | 2 +- Applications/V7/cmd/sh/expand.c | 4 ++-- Applications/V7/cmd/sh/mac.h | 1 - Applications/V7/cmd/sh/service.c | 8 ++++---- Applications/V7/cmd/sh/string.c | 4 ++-- Applications/V7/cmd/sh/word.c | 6 +++--- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Applications/V7/cmd/sh/args.c b/Applications/V7/cmd/sh/args.c index ed1663f3..cdb57501 100644 --- a/Applications/V7/cmd/sh/args.c +++ b/Applications/V7/cmd/sh/args.c @@ -123,10 +123,10 @@ static STRING * copyargs(from, n) clearup() { /* force `for' $* lists to go away */ - while(argfor=freeargs(argfor) DONE + while(argfor=freeargs(argfor) ); /* clean up io files */ - while(pop() DONE + while(pop() ); } DOLPTR useargs() diff --git a/Applications/V7/cmd/sh/blok.c b/Applications/V7/cmd/sh/blok.c index 99a5dd6d..66075044 100644 --- a/Applications/V7/cmd/sh/blok.c +++ b/Applications/V7/cmd/sh/blok.c @@ -47,7 +47,7 @@ ADDRESS alloc(nbytes) ;} ;} q = p; p = BLK(Rcheat(p->word)&~BUSY); - PER p>q || (c++)==0 DONE + PER p>q || (c++)==0 ); addblok(rbytes); } } diff --git a/Applications/V7/cmd/sh/expand.c b/Applications/V7/cmd/sh/expand.c index af9dfea8..d9c1841a 100644 --- a/Applications/V7/cmd/sh/expand.c +++ b/Applications/V7/cmd/sh/expand.c @@ -78,7 +78,7 @@ INT expand(as,rflg) REG STRING rs; rs=cs; REP if (*rs=='/' ) { rescan=rs; *rs=0; gchain=0 ;} - PER *rs++ DONE + PER *rs++ ); // FIXME: readdir while(read(dirf, (void *)&entry, 32) == 32 && (trapnote&SIGSET) == 0 @@ -179,7 +179,7 @@ static void addg(as1,as2,as3) while(*s2 = *s1++ DO s2++ OD if (s1=as3 ) { *s2++='/'; - while(*s2++ = *++s1 DONE + while(*s2++ = *++s1 ); ;} makearg(endstak(s2)); } diff --git a/Applications/V7/cmd/sh/mac.h b/Applications/V7/cmd/sh/mac.h index 0b2ea33f..bc7f0104 100644 --- a/Applications/V7/cmd/sh/mac.h +++ b/Applications/V7/cmd/sh/mac.h @@ -18,7 +18,6 @@ #define OD ;} #define REP do{ #define PER }while( -#define DONE ); #define TRUE (-1) #define FALSE 0 diff --git a/Applications/V7/cmd/sh/service.c b/Applications/V7/cmd/sh/service.c index 0c9439cd..2f130698 100644 --- a/Applications/V7/cmd/sh/service.c +++ b/Applications/V7/cmd/sh/service.c @@ -91,7 +91,7 @@ INT pathopen(path, name) REG UFD f; REP path=catpath(path,name); - PER (f=open(curstak(),0))<0 && path DONE + PER (f=open(curstak(),0))<0 && path ); return(f); } @@ -107,7 +107,7 @@ STRING catpath(path,name) if(scanp!=path ) { *argp++='/' ;} if(*scanp==COLON ) { scanp++ ;} path=(*scanp ? scanp : 0); scanp=name; - while((*argp++ = *scanp++) DONE + while((*argp++ = *scanp++) ); return(path); } @@ -124,7 +124,7 @@ void execa(at) ) { xecmsg=notfound; path=getpath(*t); namscan(exname); xecenv=sh_setenv(); - while(path=execs(path,t) DONE + while(path=execs(path,t) ); failed(*t,xecmsg); ;} } @@ -306,7 +306,7 @@ static void gsort(from,to) if((n=to-from)<=1 ) { return ;} - for (j=1; j<=n; j*=2 DONE + for (j=1; j<=n; j*=2 ); for (m=2*j-1; m/=2; DO k=n-m; diff --git a/Applications/V7/cmd/sh/string.c b/Applications/V7/cmd/sh/string.c index eb4c5600..4bb0b661 100644 --- a/Applications/V7/cmd/sh/string.c +++ b/Applications/V7/cmd/sh/string.c @@ -18,7 +18,7 @@ STRING movstr(a,b) REG STRING a, b; { - while(*b++ = *a++ DONE + while(*b++ = *a++ ); return(--b); } @@ -52,6 +52,6 @@ INT length(as) { REG STRING s; - if(s=as ) { while(*s++ DONE ;} + if(s=as ) { while(*s++ ); ;} return(s-as); } diff --git a/Applications/V7/cmd/sh/word.c b/Applications/V7/cmd/sh/word.c index 384bc6a3..df76d5a2 100644 --- a/Applications/V7/cmd/sh/word.c +++ b/Applications/V7/cmd/sh/word.c @@ -27,7 +27,7 @@ word() wdnum=0; wdset=0; - while((c=nextc(0), space(c)) DONE + while((c=nextc(0), space(c)) ); if(!eofmeta(c) ) { REP if(c==LITERAL ) { *argp++=(DQUOTE); @@ -43,7 +43,7 @@ word() DO chkpr(c) OD ;} ;} - PER (c=nextc(0), !eofmeta(c)) DONE + PER (c=nextc(0), !eofmeta(c)) ); argp=endstak(argp); if(!letter(((ARGPTR)argp)->argval[0]) ) { wdset=0 ;} @@ -124,6 +124,6 @@ static readb() REG INT len; REP if(trapnote&SIGSET ) { newline(); sigchk() ;} - PER (len=read(f->fdes,f->fbuf,f->fsiz))<0 && trapnote DONE + PER (len=read(f->fdes,f->fbuf,f->fsiz))<0 && trapnote ); return(len); } -- 2.34.1