From 45d56acf59e57b291bf5e8cce6a222057bb42c8e Mon Sep 17 00:00:00 2001 From: jilles Date: Thu, 25 Jul 2013 19:48:15 +0000 Subject: sh: Remove #define MKINIT. MKINIT only served for the removed mkinit. Many variables can be static now. --- bin/sh/eval.c | 2 +- bin/sh/input.c | 2 +- bin/sh/jobs.c | 6 +++--- bin/sh/parser.c | 4 ++-- bin/sh/redir.c | 3 +-- bin/sh/shell.h | 1 - bin/sh/trap.c | 2 +- 7 files changed, 9 insertions(+), 11 deletions(-) (limited to 'bin') diff --git a/bin/sh/eval.c b/bin/sh/eval.c index 4d0fed7..1daa3db 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); int evalskip; /* set if we are skipping commands */ int skipcount; /* number of levels to skip */ -MKINIT int loopnest; /* current loop nesting level */ +static int loopnest; /* current loop nesting level */ int funcnest; /* depth of function calls */ static int builtin_flags; /* evalcommand flags for builtins */ diff --git a/bin/sh/input.c b/bin/sh/input.c index c5b1828..e46095d 100644 --- a/bin/sh/input.c +++ b/bin/sh/input.c @@ -92,7 +92,7 @@ struct parsefile { int plinno = 1; /* input line number */ int parsenleft; /* copy of parsefile->nleft */ -MKINIT int parselleft; /* copy of parsefile->lleft */ +static int parselleft; /* copy of parsefile->lleft */ const char *parsenextc; /* copy of parsefile->nextc */ static char basebuf[BUFSIZ + 1];/* buffer for top level input file */ static struct parsefile basepf = { /* top level input file */ diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index 7129a9f..89e4812 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -77,8 +77,8 @@ __FBSDID("$FreeBSD$"); static struct job *jobtab; /* array of jobs */ static int njobs; /* size of array */ -MKINIT pid_t backgndpid = -1; /* pid of last background process */ -MKINIT struct job *bgjob = NULL; /* last background process */ +static pid_t backgndpid = -1; /* pid of last background process */ +static struct job *bgjob = NULL; /* last background process */ #if JOBS static struct job *jobmru; /* most recently used job list */ static pid_t initialpgrp; /* pgrp of shell on invocation */ @@ -116,7 +116,7 @@ static void showjob(struct job *, int); * Turn job control on and off. */ -MKINIT int jobctl; +static int jobctl; #if JOBS void diff --git a/bin/sh/parser.c b/bin/sh/parser.c index acb59df..282cbaef 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -96,9 +96,9 @@ static struct heredoc *heredoclist; /* list of here documents to read */ static int doprompt; /* if set, prompt the user */ static int needprompt; /* true if interactive and at start of line */ static int lasttoken; /* last token read */ -MKINIT int tokpushback; /* last token pushed back */ +int tokpushback; /* last token pushed back */ static char *wordtext; /* text of last word returned by readtoken */ -MKINIT int checkkwd; /* 1 == check for kwds, 2 == also eat newlines */ +static int checkkwd; /* 1 == check for kwds, 2 == also eat newlines */ static struct nodelist *backquotelist; static union node *redirnode; static struct heredoc *heredoc; diff --git a/bin/sh/redir.c b/bin/sh/redir.c index d6d9fb1..dde4384 100644 --- a/bin/sh/redir.c +++ b/bin/sh/redir.c @@ -66,14 +66,13 @@ __FBSDID("$FreeBSD$"); #define CLOSED -1 /* fd was not open before redir */ -MKINIT struct redirtab { struct redirtab *next; int renamed[10]; }; -MKINIT struct redirtab *redirlist; +static struct redirtab *redirlist; /* * We keep track of whether or not fd0 has been redirected. This is for diff --git a/bin/sh/shell.h b/bin/sh/shell.h index 5f6d0ac..679efc7 100644 --- a/bin/sh/shell.h +++ b/bin/sh/shell.h @@ -63,7 +63,6 @@ typedef intmax_t arith_t; #define ARITH_MAX INTMAX_MAX typedef void *pointer; -#define MKINIT /* empty */ #include diff --git a/bin/sh/trap.c b/bin/sh/trap.c index 3138029..1411289 100644 --- a/bin/sh/trap.c +++ b/bin/sh/trap.c @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #define S_RESET 5 /* temporary - to reset a hard ignored sig */ -MKINIT char sigmode[NSIG]; /* current value of signal */ +static char sigmode[NSIG]; /* current value of signal */ volatile sig_atomic_t pendingsig; /* indicates some signal received */ int in_dotrap; /* do we execute in a trap handler? */ static char *volatile trap[NSIG]; /* trap handler commands */ -- cgit v1.1