diff options
author | ed <ed@FreeBSD.org> | 2012-10-19 05:43:38 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-10-19 05:43:38 +0000 |
commit | fbb83e78c0ca90b09e1e9c0a76030f46f419dcaf (patch) | |
tree | 4ffbcf3b1f945e0ae5715cc8c2500ff622b14872 /sbin | |
parent | c6ac8508b2ea2c486313c4fbfef377e83807af8f (diff) | |
download | FreeBSD-src-fbb83e78c0ca90b09e1e9c0a76030f46f419dcaf.zip FreeBSD-src-fbb83e78c0ca90b09e1e9c0a76030f46f419dcaf.tar.gz |
Fix warnings found by -Wmising-variable-declarations.
This self-written compiler warning, which is hopefully going to be
committed into LLVM sources soon, warns about potentially missing
`static' keywords, similar to -Wmissing-prototypes.
- bin/pax: Move external declaration of chdname and s_mask into extern.h.
- bin/setfacl: Move setfacl.c-specific stuff out of setfacl.h.
- sbin/mount_fusefs: Remove char *progname; use getprogname().
- others: add `static' where possible.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/etherswitchcfg/etherswitchcfg.c | 4 | ||||
-rw-r--r-- | sbin/etherswitchcfg/ifmedia.c | 4 | ||||
-rw-r--r-- | sbin/ggate/ggatec/ggatec.c | 2 | ||||
-rw-r--r-- | sbin/ggate/ggated/ggated.c | 6 | ||||
-rw-r--r-- | sbin/ggate/ggatel/ggatel.c | 2 | ||||
-rw-r--r-- | sbin/mount_fusefs/mount_fusefs.c | 11 | ||||
-rw-r--r-- | sbin/rcorder/rcorder.c | 2 |
7 files changed, 13 insertions, 18 deletions
diff --git a/sbin/etherswitchcfg/etherswitchcfg.c b/sbin/etherswitchcfg/etherswitchcfg.c index e6129f3..ea2cec8 100644 --- a/sbin/etherswitchcfg/etherswitchcfg.c +++ b/sbin/etherswitchcfg/etherswitchcfg.c @@ -79,7 +79,7 @@ struct cmds { int args; void (*f)(struct cfg *, char *argv[]); }; -struct cmds cmds[]; +static struct cmds cmds[]; static void usage(void); @@ -501,7 +501,7 @@ main(int argc, char *argv[]) return (0); } -struct cmds cmds[] = { +static struct cmds cmds[] = { { MODE_PORT, "vlangroup", 1, set_port_vlangroup }, { MODE_PORT, "media", 1, set_port_media }, { MODE_PORT, "mediaopt", 1, set_port_mediaopt }, diff --git a/sbin/etherswitchcfg/ifmedia.c b/sbin/etherswitchcfg/ifmedia.c index 258c3d5..b9bd3b9 100644 --- a/sbin/etherswitchcfg/ifmedia.c +++ b/sbin/etherswitchcfg/ifmedia.c @@ -396,10 +396,10 @@ static struct ifmedia_description ifm_subtype_ieee80211_aliases[] = static struct ifmedia_description ifm_subtype_ieee80211_option_descriptions[] = IFM_SUBTYPE_IEEE80211_OPTION_DESCRIPTIONS; -struct ifmedia_description ifm_subtype_ieee80211_mode_descriptions[] = +static struct ifmedia_description ifm_subtype_ieee80211_mode_descriptions[] = IFM_SUBTYPE_IEEE80211_MODE_DESCRIPTIONS; -struct ifmedia_description ifm_subtype_ieee80211_mode_aliases[] = +static struct ifmedia_description ifm_subtype_ieee80211_mode_aliases[] = IFM_SUBTYPE_IEEE80211_MODE_ALIASES; static struct ifmedia_description ifm_subtype_atm_descriptions[] = diff --git a/sbin/ggate/ggatec/ggatec.c b/sbin/ggate/ggatec/ggatec.c index 660bd8a..6f9263c 100644 --- a/sbin/ggate/ggatec/ggatec.c +++ b/sbin/ggate/ggatec/ggatec.c @@ -55,7 +55,7 @@ #include "ggate.h" -enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; +static enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; static const char *path = NULL; static const char *host = NULL; diff --git a/sbin/ggate/ggated/ggated.c b/sbin/ggate/ggated/ggated.c index 2997a9c..01aa00a 100644 --- a/sbin/ggate/ggated/ggated.c +++ b/sbin/ggate/ggated/ggated.c @@ -92,12 +92,12 @@ struct ggd_export { static const char *exports_file = GGATED_EXPORT_FILE; static int got_sighup = 0; -in_addr_t bindaddr; +static in_addr_t bindaddr; static TAILQ_HEAD(, ggd_request) inqueue = TAILQ_HEAD_INITIALIZER(inqueue); static TAILQ_HEAD(, ggd_request) outqueue = TAILQ_HEAD_INITIALIZER(outqueue); -pthread_mutex_t inqueue_mtx, outqueue_mtx; -pthread_cond_t inqueue_cond, outqueue_cond; +static pthread_mutex_t inqueue_mtx, outqueue_mtx; +static pthread_cond_t inqueue_cond, outqueue_cond; static SLIST_HEAD(, ggd_export) exports = SLIST_HEAD_INITIALIZER(exports); static LIST_HEAD(, ggd_connection) connections = LIST_HEAD_INITIALIZER(connections); diff --git a/sbin/ggate/ggatel/ggatel.c b/sbin/ggate/ggatel/ggatel.c index d9e49db..abfe7c1 100644 --- a/sbin/ggate/ggatel/ggatel.c +++ b/sbin/ggate/ggatel/ggatel.c @@ -47,7 +47,7 @@ #include "ggate.h" -enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; +static enum { UNSET, CREATE, DESTROY, LIST, RESCUE } action = UNSET; static const char *path = NULL; static int unit = G_GATE_UNIT_AUTO; diff --git a/sbin/mount_fusefs/mount_fusefs.c b/sbin/mount_fusefs/mount_fusefs.c index 2dff27b..797aba7 100644 --- a/sbin/mount_fusefs/mount_fusefs.c +++ b/sbin/mount_fusefs/mount_fusefs.c @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include <fcntl.h> #include <signal.h> #include <getopt.h> -#include <libgen.h> #include <limits.h> #include <osreldate.h> #include <paths.h> @@ -61,7 +60,7 @@ void helpmsg(void); void showversion(void); int init_backgrounded(void); -struct mntopt mopts[] = { +static struct mntopt mopts[] = { #define ALTF_PRIVATE 0x01 { "private", 0, ALTF_PRIVATE, 1 }, { "neglect_shares", 0, 0x02, 1 }, @@ -93,14 +92,12 @@ struct mntval { int mv_len; }; -struct mntval mvals[] = { +static struct mntval mvals[] = { { ALTF_MAXREAD, NULL, 0 }, { ALTF_SUBTYPE, NULL, 0 }, { 0, NULL, 0 } }; -char *progname; - #define DEFAULT_MOUNT_FLAGS ALTF_PRIVATE | ALTF_SYNC_UNMOUNT int @@ -133,8 +130,6 @@ main(int argc, char *argv[]) char *ep; char *daemon_str = NULL, *daemon_opts = NULL; - progname = argv[0]; - /* * We want a parsing routine which is not sensitive to * the position of args/opts; it should extract the @@ -432,7 +427,7 @@ void __usage_short(void) { fprintf(stderr, "usage:\n%s [-A|-S|-v|-V|-h|-D daemon|-O args|-s special|-m node|-o option...] special node [daemon args...]\n\n", - basename(progname)); + getprogname()); } void diff --git a/sbin/rcorder/rcorder.c b/sbin/rcorder/rcorder.c index c92d063..83f6df8 100644 --- a/sbin/rcorder/rcorder.c +++ b/sbin/rcorder/rcorder.c @@ -84,7 +84,7 @@ typedef bool flag; #define SET TRUE #define RESET FALSE -Hash_Table provide_hash_s, *provide_hash; +static Hash_Table provide_hash_s, *provide_hash; typedef struct provnode provnode; typedef struct filenode filenode; |