summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authordds <dds@FreeBSD.org>2003-07-05 15:18:44 +0000
committerdds <dds@FreeBSD.org>2003-07-05 15:18:44 +0000
commit34719e1dbbd13069c2034382dc5129edf7657a4b (patch)
treeb3c2aa55b49d1fcca627aec69e1e5a16b264b51d /bin
parent9179c67e977015ed4bfe4a52ade43ac574300c93 (diff)
downloadFreeBSD-src-34719e1dbbd13069c2034382dc5129edf7657a4b.zip
FreeBSD-src-34719e1dbbd13069c2034382dc5129edf7657a4b.tar.gz
Changes following CScout analysis:
- Removed dead declarations - Made objects that should have been declared as static, static. The changes use STATIC instead of static, following the existing convention in the rest of the code. Approved by: schweikh (mentor) MFC after: 2 weeks
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/alias.c2
-rw-r--r--bin/sh/cd.c4
-rw-r--r--bin/sh/exec.c2
-rw-r--r--bin/sh/exec.h1
-rw-r--r--bin/sh/expand.c12
-rw-r--r--bin/sh/input.c2
-rw-r--r--bin/sh/jobs.c8
-rw-r--r--bin/sh/memalloc.c4
-rw-r--r--bin/sh/nodes.c.pat8
-rw-r--r--bin/sh/output.c2
-rw-r--r--bin/sh/parser.c22
-rw-r--r--bin/sh/redir.c2
-rw-r--r--bin/sh/var.c6
13 files changed, 37 insertions, 38 deletions
diff --git a/bin/sh/alias.c b/bin/sh/alias.c
index 1e4b81c..45cfd74 100644
--- a/bin/sh/alias.c
+++ b/bin/sh/alias.c
@@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$");
#define ATABSIZE 39
-struct alias *atab[ATABSIZE];
+STATIC struct alias *atab[ATABSIZE];
STATIC void setalias(char *, char *);
STATIC int unalias(char *);
diff --git a/bin/sh/cd.c b/bin/sh/cd.c
index aa1fd5a..3a45d95 100644
--- a/bin/sh/cd.c
+++ b/bin/sh/cd.c
@@ -74,8 +74,8 @@ STATIC int docd(char *, int, int);
STATIC char *getcomponent(void);
STATIC int updatepwd(char *);
-char *curdir = NULL; /* current working directory */
-char *prevdir; /* previous working directory */
+STATIC char *curdir = NULL; /* current working directory */
+STATIC char *prevdir; /* previous working directory */
STATIC char *cdcomppath;
int
diff --git a/bin/sh/exec.c b/bin/sh/exec.c
index 21f247f..5a19977 100644
--- a/bin/sh/exec.c
+++ b/bin/sh/exec.c
@@ -599,7 +599,7 @@ deletefuncs(void)
* entry.
*/
-struct tblentry **lastcmdentry;
+STATIC struct tblentry **lastcmdentry;
STATIC struct tblentry *
diff --git a/bin/sh/exec.h b/bin/sh/exec.h
index 2d4743c..dd1fd81 100644
--- a/bin/sh/exec.h
+++ b/bin/sh/exec.h
@@ -64,7 +64,6 @@ int find_builtin(char *);
void hashcd(void);
void changepath(const char *);
void deletefuncs(void);
-void getcmdentry(char *, struct cmdentry *);
void addcmdentry(char *, struct cmdentry *);
void defun(char *, union node *);
int unsetfunc(char *);
diff --git a/bin/sh/expand.c b/bin/sh/expand.c
index 214f53a..4ff7427 100644
--- a/bin/sh/expand.c
+++ b/bin/sh/expand.c
@@ -90,11 +90,11 @@ struct ifsregion {
};
-char *expdest; /* output of current string */
-struct nodelist *argbackq; /* list of back quote expressions */
-struct ifsregion ifsfirst; /* first struct in list of ifs regions */
-struct ifsregion *ifslastp; /* last struct in list */
-struct arglist exparg; /* holds expanded arg list */
+STATIC char *expdest; /* output of current string */
+STATIC struct nodelist *argbackq; /* list of back quote expressions */
+STATIC struct ifsregion ifsfirst; /* first struct in list of ifs regions */
+STATIC struct ifsregion *ifslastp; /* last struct in list */
+STATIC struct arglist exparg; /* holds expanded arg list */
STATIC void argstr(char *, int);
STATIC char *exptilde(char *, int);
@@ -1055,7 +1055,7 @@ ifsbreakup(char *string, struct arglist *arglist)
* should be escapes. The results are stored in the list exparg.
*/
-char *expdir;
+STATIC char *expdir;
STATIC void
diff --git a/bin/sh/input.c b/bin/sh/input.c
index 47c7283..85b94d6 100644
--- a/bin/sh/input.c
+++ b/bin/sh/input.c
@@ -102,7 +102,7 @@ MKINIT int parselleft; /* copy of parsefile->lleft */
char *parsenextc; /* copy of parsefile->nextc */
MKINIT struct parsefile basepf; /* top level input file */
char basebuf[BUFSIZ]; /* buffer for top level input file */
-struct parsefile *parsefile = &basepf; /* current input file */
+STATIC struct parsefile *parsefile = &basepf; /* current input file */
int init_editline = 0; /* editline library initialized? */
int whichprompt; /* 1 == PS1, 2 == PS2 */
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index f8ecbf8..7c9cfa4 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -76,12 +76,12 @@ __FBSDID("$FreeBSD$");
#include "mystring.h"
-struct job *jobtab; /* array of jobs */
-int njobs; /* size of array */
+STATIC struct job *jobtab; /* array of jobs */
+STATIC int njobs; /* size of array */
MKINIT pid_t backgndpid = -1; /* pid of last background process */
#if JOBS
-struct job *jobmru; /* most recently used job list */
-pid_t initialpgrp; /* pgrp of shell on invocation */
+STATIC struct job *jobmru; /* most recently used job list */
+STATIC pid_t initialpgrp; /* pgrp of shell on invocation */
#endif
int in_waitcmd = 0; /* are we in waitcmd()? */
int in_dowait = 0; /* are we in dowait()? */
diff --git a/bin/sh/memalloc.c b/bin/sh/memalloc.c
index cfe087e..6334290 100644
--- a/bin/sh/memalloc.c
+++ b/bin/sh/memalloc.c
@@ -113,8 +113,8 @@ struct stack_block {
};
#define SPACE(sp) ((char*)(sp) + ALIGN(sizeof(struct stack_block)))
-struct stack_block *stackp;
-struct stackmark *markp;
+STATIC struct stack_block *stackp;
+STATIC struct stackmark *markp;
char *stacknxt;
int stacknleft;
int sstrnleft;
diff --git a/bin/sh/nodes.c.pat b/bin/sh/nodes.c.pat
index 80541b0..6319613 100644
--- a/bin/sh/nodes.c.pat
+++ b/bin/sh/nodes.c.pat
@@ -49,10 +49,10 @@
#include "mystring.h"
-int funcblocksize; /* size of structures in function */
-int funcstringsize; /* size of strings in node */
-pointer funcblock; /* block to allocate function from */
-char *funcstring; /* block to allocate strings from */
+STATIC int funcblocksize; /* size of structures in function */
+STATIC int funcstringsize; /* size of strings in node */
+STATIC pointer funcblock; /* block to allocate function from */
+STATIC char *funcstring; /* block to allocate strings from */
%SIZES
diff --git a/bin/sh/output.c b/bin/sh/output.c
index b850d80..f332106 100644
--- a/bin/sh/output.c
+++ b/bin/sh/output.c
@@ -161,7 +161,7 @@ outqstr(const char *p, struct output *file)
out1c('\'');
}
-char out_junk[16];
+STATIC char out_junk[16];
void
emptyoutbuf(struct output *dest)
diff --git a/bin/sh/parser.c b/bin/sh/parser.c
index e00df92..da166e6 100644
--- a/bin/sh/parser.c
+++ b/bin/sh/parser.c
@@ -84,19 +84,19 @@ struct heredoc {
-struct heredoc *heredoclist; /* list of here documents to read */
-int parsebackquote; /* nonzero if we are inside backquotes */
-int doprompt; /* if set, prompt the user */
-int needprompt; /* true if interactive and at start of line */
-int lasttoken; /* last token read */
+STATIC struct heredoc *heredoclist; /* list of here documents to read */
+STATIC int parsebackquote; /* nonzero if we are inside backquotes */
+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 */
-char *wordtext; /* text of last word returned by readtoken */
+STATIC char *wordtext; /* text of last word returned by readtoken */
MKINIT int checkkwd; /* 1 == check for kwds, 2 == also eat newlines */
-struct nodelist *backquotelist;
-union node *redirnode;
-struct heredoc *heredoc;
-int quoteflag; /* set if (part of) last token was quoted */
-int startlinno; /* line # where last token started */
+STATIC struct nodelist *backquotelist;
+STATIC union node *redirnode;
+STATIC struct heredoc *heredoc;
+STATIC int quoteflag; /* set if (part of) last token was quoted */
+STATIC int startlinno; /* line # where last token started */
/* XXX When 'noaliases' is set to one, no alias expansion takes place. */
static int noaliases = 0;
diff --git a/bin/sh/redir.c b/bin/sh/redir.c
index 0a4588f..547cdcc 100644
--- a/bin/sh/redir.c
+++ b/bin/sh/redir.c
@@ -84,7 +84,7 @@ MKINIT struct redirtab *redirlist;
* background commands, where we want to redirect fd0 to /dev/null only
* if it hasn't already been redirected.
*/
-int fd0_redirected = 0;
+STATIC int fd0_redirected = 0;
STATIC void openredirect(union node *, char[10 ]);
STATIC int openhere(union node *);
diff --git a/bin/sh/var.c b/bin/sh/var.c
index 508867f..7ef73f1 100644
--- a/bin/sh/var.c
+++ b/bin/sh/var.c
@@ -93,9 +93,9 @@ struct var vppid;
struct var vps1;
struct var vps2;
struct var vvers;
-struct var voptind;
+STATIC struct var voptind;
-const struct varinit varinit[] = {
+STATIC const struct varinit varinit[] = {
#ifndef NO_HISTORY
{ &vhistsize, VSTRFIXED|VTEXTFIXED|VUNSET, "HISTSIZE=",
sethistsize },
@@ -121,7 +121,7 @@ const struct varinit varinit[] = {
NULL }
};
-struct var *vartab[VTABSIZE];
+STATIC struct var *vartab[VTABSIZE];
STATIC struct var **hashvar(char *);
STATIC int varequal(char *, char *);
OpenPOWER on IntegriCloud