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
This commit is contained in:
parent
cf35742847
commit
2ba1b30bf5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117261
@ -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 *);
|
||||
|
@ -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
|
||||
|
@ -599,7 +599,7 @@ deletefuncs(void)
|
||||
* entry.
|
||||
*/
|
||||
|
||||
struct tblentry **lastcmdentry;
|
||||
STATIC struct tblentry **lastcmdentry;
|
||||
|
||||
|
||||
STATIC struct tblentry *
|
||||
|
@ -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 *);
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -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()? */
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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 *);
|
||||
|
@ -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 *);
|
||||
|
Loading…
Reference in New Issue
Block a user