From: Alan Cox Date: Sun, 10 May 2015 21:13:05 +0000 (+0100) Subject: sh: kill off FOR X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a4b1e410b3fcfb8a5ecbce3fc3355f6f306adf3a;p=FUZIX.git sh: kill off FOR --- diff --git a/Applications/V7/cmd/sh/args.c b/Applications/V7/cmd/sh/args.c index 27fa6ad1..84314b95 100644 --- a/Applications/V7/cmd/sh/args.c +++ b/Applications/V7/cmd/sh/args.c @@ -95,7 +95,7 @@ freeargs(blk) if (argblk=blk ) { argr = argblk->dolnxt; if ((--argblk->doluse)==0 - ) { FOR argp=(STRING *)argblk->dolarg; Rcheat(*argp)!=ENDARGS; argp++ + ) { for ( argp=(STRING *)argblk->dolarg; Rcheat(*argp)!=ENDARGS; argp++ DO free(*argp) OD free(argblk); ;} diff --git a/Applications/V7/cmd/sh/mac.h b/Applications/V7/cmd/sh/mac.h index 835fbd0a..cffde0b7 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 FOR for( #define WHILE while( #define DO ){ #define OD ;} diff --git a/Applications/V7/cmd/sh/print.c b/Applications/V7/cmd/sh/print.c index 81152005..cb8795d3 100644 --- a/Applications/V7/cmd/sh/print.c +++ b/Applications/V7/cmd/sh/print.c @@ -74,7 +74,7 @@ itos(n) { REG char *abuf; REG POS a, i; INT pr, d; abuf=numbuf; pr=FALSE; a=n; - FOR i=10000; i!=1; i/=10 + for (i=10000; i!=1; i/=10 DO if ((pr |= (d=a/i)) ) { *abuf++=d+'0' ;} a %= i; OD diff --git a/Applications/V7/cmd/sh/service.c b/Applications/V7/cmd/sh/service.c index 495a3e01..af6bd6e4 100644 --- a/Applications/V7/cmd/sh/service.c +++ b/Applications/V7/cmd/sh/service.c @@ -306,12 +306,12 @@ 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 DONE - FOR m=2*j-1; m/=2; + for (m=2*j-1; m/=2; DO k=n-m; - FOR j=0; j=0; i-=m + for (j=0; j=0; i-=m DO REG STRING *fromi; fromi = &from[i]; if(cf(fromi[m],fromi[0])>0 ) { break; diff --git a/Applications/V7/cmd/sh/xec.c b/Applications/V7/cmd/sh/xec.c index e5e848f1..298b9b1f 100644 --- a/Applications/V7/cmd/sh/xec.c +++ b/Applications/V7/cmd/sh/xec.c @@ -124,7 +124,7 @@ execute(argt, execflg, pf1, pf2) } else { /* print out current traps */ INT i; - FOR i=0; i