From b93582a68e0cbf2f43f1052a28c57fb5e3c6e493 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 10 May 2015 22:19:57 +0100 Subject: [PATCH] sh: kill off PER REP --- Applications/V7/cmd/sh/blok.c | 4 ++-- Applications/V7/cmd/sh/expand.c | 4 ++-- Applications/V7/cmd/sh/mac.h | 2 -- Applications/V7/cmd/sh/service.c | 4 ++-- Applications/V7/cmd/sh/word.c | 8 ++++---- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/Applications/V7/cmd/sh/blok.c b/Applications/V7/cmd/sh/blok.c index 66075044..e53667df 100644 --- a/Applications/V7/cmd/sh/blok.c +++ b/Applications/V7/cmd/sh/blok.c @@ -35,7 +35,7 @@ ADDRESS alloc(nbytes) for (;;) { INT c=0; REG BLKPTR p = blokp; REG BLKPTR q; - REP if(!busy(p) + do { if(!busy(p) ) { while(!busy(q = p->word) DO p->word = q->word OD if(ADR(q)-ADR(p) >= rbytes ) { blokp = BLK(ADR(p)+rbytes); @@ -47,7 +47,7 @@ ADDRESS alloc(nbytes) ;} ;} q = p; p = BLK(Rcheat(p->word)&~BUSY); - PER p>q || (c++)==0 ); + } while ( p>q || (c++)==0 ); addblok(rbytes); } } diff --git a/Applications/V7/cmd/sh/expand.c b/Applications/V7/cmd/sh/expand.c index d9c1841a..c0e7a1e6 100644 --- a/Applications/V7/cmd/sh/expand.c +++ b/Applications/V7/cmd/sh/expand.c @@ -77,8 +77,8 @@ INT expand(as,rflg) ) { /* check for rescan */ REG STRING rs; rs=cs; - REP if (*rs=='/' ) { rescan=rs; *rs=0; gchain=0 ;} - PER *rs++ ); + do { if (*rs=='/' ) { rescan=rs; *rs=0; gchain=0 ;} + } while(*rs++ ); // FIXME: readdir while(read(dirf, (void *)&entry, 32) == 32 && (trapnote&SIGSET) == 0 diff --git a/Applications/V7/cmd/sh/mac.h b/Applications/V7/cmd/sh/mac.h index bc7f0104..121f3b31 100644 --- a/Applications/V7/cmd/sh/mac.h +++ b/Applications/V7/cmd/sh/mac.h @@ -16,8 +16,6 @@ #define DO ){ #define OD ;} -#define REP do{ -#define PER }while( #define TRUE (-1) #define FALSE 0 diff --git a/Applications/V7/cmd/sh/service.c b/Applications/V7/cmd/sh/service.c index 2f130698..7e918410 100644 --- a/Applications/V7/cmd/sh/service.c +++ b/Applications/V7/cmd/sh/service.c @@ -90,8 +90,8 @@ INT pathopen(path, name) { REG UFD f; - REP path=catpath(path,name); - PER (f=open(curstak(),0))<0 && path ); + do { path=catpath(path,name); + } while ( (f=open(curstak(),0))<0 && path ); return(f); } diff --git a/Applications/V7/cmd/sh/word.c b/Applications/V7/cmd/sh/word.c index df76d5a2..3fa8c927 100644 --- a/Applications/V7/cmd/sh/word.c +++ b/Applications/V7/cmd/sh/word.c @@ -29,7 +29,7 @@ word() while((c=nextc(0), space(c)) ); if(!eofmeta(c) - ) { REP if(c==LITERAL + ) { do { if(c==LITERAL ) { *argp++=(DQUOTE); while((c=readc()) && c!=LITERAL DO *argp++=(c|QUOTE); chkpr(c) OD @@ -43,7 +43,7 @@ word() DO chkpr(c) OD ;} ;} - PER (c=nextc(0), !eofmeta(c)) ); + } while ( (c=nextc(0), !eofmeta(c)) ); argp=endstak(argp); if(!letter(((ARGPTR)argp)->argval[0]) ) { wdset=0 ;} @@ -123,7 +123,7 @@ static readb() REG FILE f=standin; REG INT len; - REP if(trapnote&SIGSET ) { newline(); sigchk() ;} - PER (len=read(f->fdes,f->fbuf,f->fsiz))<0 && trapnote ); + do { if(trapnote&SIGSET ) { newline(); sigchk() ;} + } while ( (len=read(f->fdes,f->fbuf,f->fsiz))<0 && trapnote ); return(len); } -- 2.34.1