diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-01-09 20:19:22 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-01-09 20:19:22 +0100 |
commit | 62ee434e336dac7523cace3b3acea6894ef3a509 (patch) | |
tree | 7833a504b866bb503676cc79577ba0dc41a0ef94 /soltools | |
parent | 04900bf971196a3b27473fd35d4726cd8cadd0e0 (diff) |
loplugin:externvar
Change-Id: I304144c0ae6b51656ad326a77e9402cc34d5aa18
Diffstat (limited to 'soltools')
-rw-r--r-- | soltools/cpp/_eval.c | 3 | ||||
-rw-r--r-- | soltools/cpp/_getopt.c | 2 | ||||
-rw-r--r-- | soltools/cpp/_lex.c | 2 | ||||
-rw-r--r-- | soltools/cpp/_nlist.c | 3 | ||||
-rw-r--r-- | soltools/cpp/_tokens.c | 2 | ||||
-rw-r--r-- | soltools/mkdepend/def.h | 16 | ||||
-rw-r--r-- | soltools/mkdepend/include.c | 5 | ||||
-rw-r--r-- | soltools/mkdepend/main.c | 10 | ||||
-rw-r--r-- | soltools/mkdepend/parse.c | 3 | ||||
-rw-r--r-- | soltools/mkdepend/pr.c | 8 |
10 files changed, 31 insertions, 23 deletions
diff --git a/soltools/cpp/_eval.c b/soltools/cpp/_eval.c index f10fa7988bb5..84d8a79b5d44 100644 --- a/soltools/cpp/_eval.c +++ b/soltools/cpp/_eval.c @@ -46,8 +46,9 @@ struct pri char pri; char arity; char ctype; -} priority[] = +}; +static struct pri priority[] = { { 0, 0, 0 diff --git a/soltools/cpp/_getopt.c b/soltools/cpp/_getopt.c index 24a6cfb6199e..4e609bae92de 100644 --- a/soltools/cpp/_getopt.c +++ b/soltools/cpp/_getopt.c @@ -25,7 +25,7 @@ #define EPR fprintf(stderr, #define ERR(str, chr) if(opterr) { EPR "%s%c\n", str, chr); } -int opterr = 1; +static int opterr = 1; int optind = 1; int optopt; char *optarg; diff --git a/soltools/cpp/_lex.c b/soltools/cpp/_lex.c index fde7605e8354..a8f874d6d464 100644 --- a/soltools/cpp/_lex.c +++ b/soltools/cpp/_lex.c @@ -73,7 +73,7 @@ struct fsm int nextstate; /* enter this state if +ve */ }; - /*const*/ struct fsm fsm[] = { +static /*const*/ struct fsm fsm[] = { /* start state */ {START, {C_XX}, ACT(UNCLASS, S_SELF)}, {START, {' ', '\t', '\v'}, WS1}, diff --git a/soltools/cpp/_nlist.c b/soltools/cpp/_nlist.c index 83516f461ac1..3bd1a6557d9b 100644 --- a/soltools/cpp/_nlist.c +++ b/soltools/cpp/_nlist.c @@ -42,8 +42,9 @@ struct kwtab char *kw; int val; int flag; -} kwtab[] = +}; +static struct kwtab kwtab[] = { {"if", KIF, ISKW}, {"ifdef", KIFDEF, ISKW}, diff --git a/soltools/cpp/_tokens.c b/soltools/cpp/_tokens.c index c764886593d6..bac421647035 100644 --- a/soltools/cpp/_tokens.c +++ b/soltools/cpp/_tokens.c @@ -34,7 +34,7 @@ static char *wbp = wbuf; static int EBCDIC_ExternTokenDetected = 0; static int EBCDIC_StartTokenDetected = 0; -unsigned char toLatin1[256] = +static unsigned char toLatin1[256] = { 0x00, 0x01, 0x02, 0x03, 0x9c, 0x09, 0x86, 0x7f, 0x97, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, diff --git a/soltools/mkdepend/def.h b/soltools/mkdepend/def.h index 74445a2ed130..5e96a2b75712 100644 --- a/soltools/mkdepend/def.h +++ b/soltools/mkdepend/def.h @@ -191,4 +191,20 @@ void warning1(char *, ...); void convert_slashes(char *); char *append_slash(char *); +extern char * directives[]; + +extern struct inclist * inclistp; + +extern char * objprefix; + +extern char * objsuffix; + +extern boolean printed; + +extern boolean verbose; + +extern boolean show_where_not; + +extern boolean warn_multiple; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/soltools/mkdepend/include.c b/soltools/mkdepend/include.c index 6712b1a9ce78..e83ac0fbc24b 100644 --- a/soltools/mkdepend/include.c +++ b/soltools/mkdepend/include.c @@ -38,12 +38,9 @@ int issymbolic(char * dir, char * component); int exists_path(struct IncludesCollection*, char*); -extern struct inclist inclist[ MAXFILES ], - *inclistp; +extern struct inclist inclist[ MAXFILES ]; extern char *includedirs[ ]; extern char *notdotdot[ ]; -extern boolean show_where_not; -extern boolean warn_multiple; struct inclist *inc_path(char *file, char *include, boolean dot, struct IncludesCollection *incCollection) { diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c index c156c19b2019..997ba6dbb87d 100644 --- a/soltools/mkdepend/main.c +++ b/soltools/mkdepend/main.c @@ -120,16 +120,16 @@ void redirect(char * makefile); struct inclist inclist[ MAXFILES ], *inclistp = inclist; -struct symhash *maininclist = NULL; +static struct symhash *maininclist = NULL; char *filelist[ MAXFILES ]; char *includedirs[ MAXDIRS + 1 ]; char *notdotdot[ MAXDIRS ]; char *objprefix = ""; char *objsuffix = OBJSUFFIX; -char *startat = "# DO NOT DELETE"; -int width = 78; -boolean append = FALSE; +static char *startat = "# DO NOT DELETE"; +static int width = 78; +static boolean append = FALSE; boolean printed = FALSE; boolean verbose = FALSE; boolean show_where_not = FALSE; @@ -161,7 +161,7 @@ catch (int sig) struct sigaction sig_act; #endif /* USGISH */ -boolean native_win_slashes = FALSE; +static boolean native_win_slashes = FALSE; int main(int argc, char **argv) { diff --git a/soltools/mkdepend/parse.c b/soltools/mkdepend/parse.c index 01adafbbbd36..250a6a66a702 100644 --- a/soltools/mkdepend/parse.c +++ b/soltools/mkdepend/parse.c @@ -38,7 +38,6 @@ int deftype ( char *line, struct filepointer *filep, int zero_value(char *exp, struct filepointer *filep, struct inclist *file_red, struct symhash *symbols); -extern char *directives[]; extern struct symhash *maininclist; int find_includes(struct filepointer *filep, struct inclist *file, struct inclist *file_red, int recursion, boolean failOK, struct IncludesCollection* incCollection, struct symhash *symbols) @@ -361,7 +360,7 @@ int deftype (char *line, struct filepointer *filep, struct inclist *file_red, st * HACK! - so that we do not have to introduce 'symbols' in each cppsetup.c * function... It's safe, functions from cppsetup.c don't return here. */ -struct symhash *global_symbols = NULL; +static struct symhash *global_symbols = NULL; char * isdefined( char *symbol ) { diff --git a/soltools/mkdepend/pr.c b/soltools/mkdepend/pr.c index 23a93f4b9e9b..fe8d756a636c 100644 --- a/soltools/mkdepend/pr.c +++ b/soltools/mkdepend/pr.c @@ -31,14 +31,8 @@ in this Software without prior written authorization from the X Consortium. #include <string.h> size_t pr( struct inclist *ip, char *file,char *base); -extern struct inclist inclist[ MAXFILES ], - *inclistp; -extern char *objprefix; -extern char *objsuffix; +extern struct inclist inclist[ MAXFILES ]; extern int width; -extern boolean printed; -extern boolean verbose; -extern boolean show_where_not; void add_include(struct filepointer *filep, struct inclist *file, struct inclist *file_red, char *include, boolean dot, boolean failOK, struct IncludesCollection* incCollection, struct symhash *symbols) { |