diff options
author | ed <ed@FreeBSD.org> | 2011-11-06 18:50:19 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2011-11-06 18:50:19 +0000 |
commit | 90167b18125979bd30ab6fd436e141094904fa23 (patch) | |
tree | 8fbe751f8c7e92482f591858a0eddd608b719084 /usr.bin/whereis/whereis.c | |
parent | 8ea5e6afe9b1a842636691228198747a889785f8 (diff) | |
download | FreeBSD-src-90167b18125979bd30ab6fd436e141094904fa23.zip FreeBSD-src-90167b18125979bd30ab6fd436e141094904fa23.tar.gz |
Mark global functions and/or variables in whereis(1) static where possible.
This allows compilers and static analyzers to more thorough analysis.
Diffstat (limited to 'usr.bin/whereis/whereis.c')
-rw-r--r-- | usr.bin/whereis/whereis.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/usr.bin/whereis/whereis.c b/usr.bin/whereis/whereis.c index 0829f77..91df6dc 100644 --- a/usr.bin/whereis/whereis.c +++ b/usr.bin/whereis/whereis.c @@ -56,18 +56,18 @@ __FBSDID("$FreeBSD$"); typedef const char *ccharp; -int opt_a, opt_b, opt_m, opt_q, opt_s, opt_u, opt_x; -ccharp *bindirs, *mandirs, *sourcedirs; -char **query; +static int opt_a, opt_b, opt_m, opt_q, opt_s, opt_u, opt_x; +static ccharp *bindirs, *mandirs, *sourcedirs; +static char **query; -const char *sourcepath = PATH_SOURCES; +static const char *sourcepath = PATH_SOURCES; -char *colonify(ccharp *); -int contains(ccharp *, const char *); -void decolonify(char *, ccharp **, int *); -void defaults(void); -void scanopts(int, char **); -void usage(void); +static char *colonify(ccharp *); +static int contains(ccharp *, const char *); +static void decolonify(char *, ccharp **, int *); +static void defaults(void); +static void scanopts(int, char **); +static void usage(void); /* * Throughout this program, a number of strings are dynamically @@ -85,7 +85,7 @@ void usage(void); * abort(3) in case of an allocation failure. */ -void +static void usage(void) { (void)fprintf(stderr, @@ -99,7 +99,7 @@ usage(void) * Note that the -B/-M/-S options expect a list of directory * names that must be terminated with -f. */ -void +static void scanopts(int argc, char **argv) { int c, i; @@ -174,7 +174,7 @@ scanopts(int argc, char **argv) /* * Find out whether string `s' is contained in list `cpp'. */ -int +static int contains(ccharp *cpp, const char *s) { ccharp cp; @@ -197,7 +197,7 @@ contains(ccharp *cpp, const char *s) * partial string is only added if it has a length greater than 0, and * if it's not already contained in the string list. */ -void +static void decolonify(char *s, ccharp **cppp, int *ip) { char *cp; @@ -223,7 +223,7 @@ decolonify(char *s, ccharp **cppp, int *ip) /* * Join string list `cpp' into a colon-separated string. */ -char * +static char * colonify(ccharp *cpp) { size_t s; @@ -249,7 +249,7 @@ colonify(ccharp *cpp) /* * Provide defaults for all options and directory lists. */ -void +static void defaults(void) { size_t s; |