From 2d036abce4b4599e9d2f2a3b194e3bfd0c383a23 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 10 May 2015 21:32:20 +0100 Subject: [PATCH] sh: Remove "LOCAL" define --- Applications/V7/cmd/sh/args.c | 6 ++--- Applications/V7/cmd/sh/cmd.c | 44 ++++++++++++++++---------------- Applications/V7/cmd/sh/expand.c | 4 +-- Applications/V7/cmd/sh/mac.h | 1 - Applications/V7/cmd/sh/macro.c | 20 +++++++-------- Applications/V7/cmd/sh/main.c | 6 ++--- Applications/V7/cmd/sh/name.c | 16 ++++++------ Applications/V7/cmd/sh/service.c | 20 +++++++-------- Applications/V7/cmd/sh/word.c | 4 +-- Applications/V7/cmd/sh/xec.c | 2 +- 10 files changed, 61 insertions(+), 62 deletions(-) diff --git a/Applications/V7/cmd/sh/args.c b/Applications/V7/cmd/sh/args.c index c92e5517..04eb1311 100644 --- a/Applications/V7/cmd/sh/args.c +++ b/Applications/V7/cmd/sh/args.c @@ -13,8 +13,8 @@ #include #include "defs.h" -LOCAL STRING *copyargs(); -LOCAL DOLPTR dolh; +static STRING *copyargs(); +static DOLPTR dolh; CHAR flagadr[10]; @@ -103,7 +103,7 @@ freeargs(blk) return(argr); } -LOCAL STRING * copyargs(from, n) +static STRING * copyargs(from, n) STRING from[]; { REG STRING * np=(STRING *)alloc(sizeof(STRING*)*n+3*BYTESPERWORD); diff --git a/Applications/V7/cmd/sh/cmd.c b/Applications/V7/cmd/sh/cmd.c index d539b337..50d41626 100644 --- a/Applications/V7/cmd/sh/cmd.c +++ b/Applications/V7/cmd/sh/cmd.c @@ -13,17 +13,17 @@ #include "defs.h" #include "sym.h" -LOCAL IOPTR inout(); -LOCAL void chkword(); -LOCAL void chksym(); -LOCAL TREPTR term(); -LOCAL TREPTR makelist(); -LOCAL TREPTR list(); -LOCAL REGPTR syncase(); -LOCAL TREPTR item(); -LOCAL int skipnl(); -LOCAL void prsym(); -LOCAL void synbad(); +static IOPTR inout(); +static void chkword(); +static void chksym(); +static TREPTR term(); +static TREPTR makelist(); +static TREPTR list(); +static REGPTR syncase(); +static TREPTR item(); +static int skipnl(); +static void prsym(); +static void synbad(); /* ======== command line decoding ========*/ @@ -44,7 +44,7 @@ TREPTR makefork(flgs, i) return(TREPTR)(t); } -LOCAL TREPTR makelist(type,i,r) +static TREPTR makelist(type,i,r) INT type; TREPTR i, r; { @@ -118,7 +118,7 @@ TREPTR cmd(sym,flg) * list || term */ -LOCAL TREPTR list(flg) +static TREPTR list(flg) { REG TREPTR r; REG INT b; @@ -136,7 +136,7 @@ LOCAL TREPTR list(flg) * item |^ term */ -LOCAL TREPTR term(flg) +static TREPTR term(flg) { REG TREPTR t; @@ -152,7 +152,7 @@ LOCAL TREPTR term(flg) FI } -LOCAL REGPTR syncase(esym) +static REGPTR syncase(esym) REG INT esym; { skipnl(); @@ -191,7 +191,7 @@ LOCAL REGPTR syncase(esym) * begin ... end */ -LOCAL TREPTR item(flag) +static TREPTR item(flag) BOOL flag; { REG TREPTR t; @@ -313,13 +313,13 @@ LOCAL TREPTR item(flag) } -LOCAL int skipnl() +static int skipnl() { WHILE (reserv++, word()==NL) DO chkpr(NL) OD return(wdval); } -LOCAL IOPTR inout(lastio) +static IOPTR inout(lastio) IOPTR lastio; { REG INT iof; @@ -365,14 +365,14 @@ LOCAL IOPTR inout(lastio) return(iop); } -LOCAL void chkword() +static void chkword() { IF word() THEN synbad(); FI } -LOCAL void chksym(sym) +static void chksym(sym) { REG INT x = sym&wdval; IF ((x&SYMFLG) ? x : sym) != wdval @@ -380,7 +380,7 @@ LOCAL void chksym(sym) FI } -LOCAL void prsym(sym) +static void prsym(sym) { IF sym&SYMFLG THEN REG SYSPTR sp=reserved; @@ -398,7 +398,7 @@ LOCAL void prsym(sym) FI } -LOCAL void synbad() +static void synbad() { prp(); prs(synmsg); IF (flags&ttyflg)==0 diff --git a/Applications/V7/cmd/sh/expand.c b/Applications/V7/cmd/sh/expand.c index 97fdcb50..5dfc3b15 100644 --- a/Applications/V7/cmd/sh/expand.c +++ b/Applications/V7/cmd/sh/expand.c @@ -27,7 +27,7 @@ * */ -LOCAL void addg(); +static void addg(); INT expand(as,rflg) @@ -160,7 +160,7 @@ gmatch(s, p) ENDSW } -LOCAL void addg(as1,as2,as3) +static void addg(as1,as2,as3) STRING as1, as2, as3; { REG STRING s1, s2; diff --git a/Applications/V7/cmd/sh/mac.h b/Applications/V7/cmd/sh/mac.h index 29e5b955..011009de 100644 --- a/Applications/V7/cmd/sh/mac.h +++ b/Applications/V7/cmd/sh/mac.h @@ -9,7 +9,6 @@ * */ -#define LOCAL static #define PROC extern #define TYPE typedef #define STRUCT TYPE struct diff --git a/Applications/V7/cmd/sh/macro.c b/Applications/V7/cmd/sh/macro.c index 7f5eccf7..1c8e4dd6 100644 --- a/Applications/V7/cmd/sh/macro.c +++ b/Applications/V7/cmd/sh/macro.c @@ -13,15 +13,15 @@ #include "defs.h" #include "sym.h" -LOCAL CHAR quote; /* used locally */ -LOCAL CHAR quoted; /* used locally */ +static CHAR quote; /* used locally */ +static CHAR quoted; /* used locally */ -LOCAL getch(); -LOCAL comsubst(); -LOCAL flush(); +static getch(); +static comsubst(); +static flush(); -LOCAL STRING copyto(endch) +static STRING copyto(endch) REG CHAR endch; { REG CHAR c; @@ -32,7 +32,7 @@ LOCAL STRING copyto(endch) IF c!=endch THEN error(badsub) FI } -LOCAL skipto(endch) +static skipto(endch) REG CHAR endch; { /* skip chars up to } */ @@ -52,7 +52,7 @@ LOCAL skipto(endch) IF c!=endch THEN error(badsub) FI } -LOCAL getch(endch) +static getch(endch) CHAR endch; { REG CHAR d; @@ -171,7 +171,7 @@ STRING macro(as) return(fixstak()); } -LOCAL comsubst() +static comsubst() { /* command substn */ FILEBLK cb; @@ -231,7 +231,7 @@ subst(in,ot) pop(); } -LOCAL flush(ot) +static flush(ot) { write(ot,stakbot,staktop-stakbot); IF flags&execpr THEN write(output,stakbot,staktop-stakbot) FI diff --git a/Applications/V7/cmd/sh/main.c b/Applications/V7/cmd/sh/main.c index a1cd5e83..075d955e 100644 --- a/Applications/V7/cmd/sh/main.c +++ b/Applications/V7/cmd/sh/main.c @@ -21,12 +21,12 @@ #include UFD output = 2; -LOCAL BOOL beenhere = FALSE; +static BOOL beenhere = FALSE; CHAR tmpout[20] = "/tmp/sh-"; FILEBLK stdfile; FILE standin = &stdfile; -LOCAL void exfile(); +static void exfile(); @@ -93,7 +93,7 @@ main(c, v) done(); } -LOCAL void exfile(prof) +static void exfile(prof) BOOL prof; { REG L_INT mailtime = 0; diff --git a/Applications/V7/cmd/sh/name.c b/Applications/V7/cmd/sh/name.c index 290d568e..9e6fc509 100644 --- a/Applications/V7/cmd/sh/name.c +++ b/Applications/V7/cmd/sh/name.c @@ -12,8 +12,8 @@ #include "defs.h" -LOCAL BOOL chkid(); -LOCAL void namwalk(); +static BOOL chkid(); +static void namwalk(); NAMNOD ps2nod = {(NAMPTR)NIL, (NAMPTR)NIL, ps2name}, @@ -202,7 +202,7 @@ NAMPTR lookup(nam) return(*prev = nscan); } -LOCAL BOOL chkid(nam) +static BOOL chkid(nam) STRING nam; { REG CHAR * cp=nam; @@ -218,7 +218,7 @@ LOCAL BOOL chkid(nam) return(TRUE); } -LOCAL void (*namfn)(); +static void (*namfn)(); namscan(fn) void (*fn)(); { @@ -226,7 +226,7 @@ namscan(fn) namwalk(namep); } -LOCAL void namwalk(np) +static void namwalk(np) REG NAMPTR np; { IF np @@ -249,7 +249,7 @@ void printnam(n) FI } -LOCAL STRING staknam(n) +static STRING staknam(n) REG NAMPTR n; { REG STRING p; @@ -293,7 +293,7 @@ void sh_getenv(void) DO setname(*e++, N_ENVNAM) OD } -LOCAL INT namec; +static INT namec; void countnam(n) NAMPTR n; @@ -301,7 +301,7 @@ void countnam(n) namec++; } -LOCAL STRING *argnam; +static STRING *argnam; void pushnam(n) NAMPTR n; diff --git a/Applications/V7/cmd/sh/service.c b/Applications/V7/cmd/sh/service.c index 2df45997..8f77a711 100644 --- a/Applications/V7/cmd/sh/service.c +++ b/Applications/V7/cmd/sh/service.c @@ -13,9 +13,9 @@ #include "defs.h" -LOCAL STRING execs(); -LOCAL void gsort(); -LOCAL INT split(); +static STRING execs(); +static void gsort(); +static INT split(); #define ARGMK 01 @@ -111,8 +111,8 @@ STRING catpath(path,name) return(path); } -LOCAL STRING xecmsg; -LOCAL STRING *xecenv; +static STRING xecmsg; +static STRING *xecenv; void execa(at) STRING at[]; @@ -129,7 +129,7 @@ void execa(at) FI } -LOCAL STRING execs(ap,t) +static STRING execs(ap,t) STRING ap; REG STRING t[]; { @@ -172,8 +172,8 @@ LOCAL STRING execs(ap,t) /* for processes to be waited for */ #define MAXP 20 -LOCAL INT pwlist[MAXP]; -LOCAL INT pwc; +static INT pwlist[MAXP]; +static INT pwc; postclr() { @@ -299,7 +299,7 @@ STRING *scan(argn) return(comargn); } -LOCAL void gsort(from,to) +static void gsort(from,to) STRING from[], to[]; { INT k, m, n; @@ -342,7 +342,7 @@ INT getarg(ac) return(count); } -LOCAL INT split(s) +static INT split(s) REG STRING s; { REG STRING argp; diff --git a/Applications/V7/cmd/sh/word.c b/Applications/V7/cmd/sh/word.c index 294bcaac..2cc10f71 100644 --- a/Applications/V7/cmd/sh/word.c +++ b/Applications/V7/cmd/sh/word.c @@ -13,7 +13,7 @@ #include "defs.h" #include "sym.h" -LOCAL readb(); +static readb(); /* ======== character handling for command lines ========*/ @@ -118,7 +118,7 @@ retry: return(c); } -LOCAL readb() +static readb() { REG FILE f=standin; REG INT len; diff --git a/Applications/V7/cmd/sh/xec.c b/Applications/V7/cmd/sh/xec.c index 3db942fe..d6e68027 100644 --- a/Applications/V7/cmd/sh/xec.c +++ b/Applications/V7/cmd/sh/xec.c @@ -13,7 +13,7 @@ #include "defs.h" #include "sym.h" -LOCAL INT parent; +static INT parent; SYSTAB commands; -- 2.34.1