summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-10-19 05:43:38 +0000
committered <ed@FreeBSD.org>2012-10-19 05:43:38 +0000
commitfbb83e78c0ca90b09e1e9c0a76030f46f419dcaf (patch)
tree4ffbcf3b1f945e0ae5715cc8c2500ff622b14872
parentc6ac8508b2ea2c486313c4fbfef377e83807af8f (diff)
downloadFreeBSD-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.
-rw-r--r--bin/ed/buf.c12
-rw-r--r--bin/ed/cbc.c20
-rw-r--r--bin/ed/glbl.c10
-rw-r--r--bin/ed/io.c4
-rw-r--r--bin/ed/main.c31
-rw-r--r--bin/ed/sub.c10
-rw-r--r--bin/ed/undo.c6
-rw-r--r--bin/getfacl/getfacl.c2
-rw-r--r--bin/pax/ar_io.c1
-rw-r--r--bin/pax/ar_subs.c1
-rw-r--r--bin/pax/extern.h3
-rw-r--r--bin/pax/options.c1
-rw-r--r--bin/rcp/rcp.c15
-rw-r--r--bin/setfacl/setfacl.c29
-rw-r--r--bin/setfacl/setfacl.h32
-rw-r--r--lib/libdwarf/dwarf_errmsg.c2
-rw-r--r--lib/libelf/elf_errmsg.c2
-rw-r--r--lib/librpcsec_gss/svc_rpcsec_gss.c4
-rw-r--r--lib/libthread_db/libpthread_db.c2
-rw-r--r--lib/libthread_db/libthr_db.c2
-rw-r--r--libexec/tftpd/tftp-io.c4
-rw-r--r--libexec/tftpd/tftp-utils.c2
-rw-r--r--libexec/tftpd/tftpd.c4
-rw-r--r--sbin/etherswitchcfg/etherswitchcfg.c4
-rw-r--r--sbin/etherswitchcfg/ifmedia.c4
-rw-r--r--sbin/ggate/ggatec/ggatec.c2
-rw-r--r--sbin/ggate/ggated/ggated.c6
-rw-r--r--sbin/ggate/ggatel/ggatel.c2
-rw-r--r--sbin/mount_fusefs/mount_fusefs.c11
-rw-r--r--sbin/rcorder/rcorder.c2
30 files changed, 114 insertions, 116 deletions
diff --git a/bin/ed/buf.c b/bin/ed/buf.c
index b4b78a5..2f3559a 100644
--- a/bin/ed/buf.c
+++ b/bin/ed/buf.c
@@ -35,10 +35,10 @@ __FBSDID("$FreeBSD$");
#include "ed.h"
-FILE *sfp; /* scratch file pointer */
-off_t sfseek; /* scratch file position */
-int seek_write; /* seek before writing */
-line_t buffer_head; /* incore buffer */
+static FILE *sfp; /* scratch file pointer */
+static off_t sfseek; /* scratch file position */
+static int seek_write; /* seek before writing */
+static line_t buffer_head; /* incore buffer */
/* get_sbuf_line: get a line of text from the scratch file; return pointer
to the text */
@@ -188,7 +188,7 @@ get_addressed_line_node(long n)
extern int newline_added;
-char sfn[15] = ""; /* scratch file name */
+static char sfn[15] = ""; /* scratch file name */
/* open_sbuf: open scratch file */
int
@@ -244,7 +244,7 @@ quit(int n)
}
-unsigned char ctab[256]; /* character translation table */
+static unsigned char ctab[256]; /* character translation table */
/* init_buffers: open scratch buffer; initialize line queue */
void
diff --git a/bin/ed/cbc.c b/bin/ed/cbc.c
index 52e9999..08e48cd 100644
--- a/bin/ed/cbc.c
+++ b/bin/ed/cbc.c
@@ -68,28 +68,24 @@ __FBSDID("$FreeBSD$");
* global variables and related macros
*/
-enum { /* encrypt, decrypt, authenticate */
- MODE_ENCRYPT, MODE_DECRYPT, MODE_AUTHENTICATE
-} mode = MODE_ENCRYPT;
-
#ifdef DES
-DES_cblock ivec; /* initialization vector */
-DES_cblock pvec; /* padding vector */
+static DES_cblock ivec; /* initialization vector */
+static DES_cblock pvec; /* padding vector */
#endif
-char bits[] = { /* used to extract bits from a char */
+static char bits[] = { /* used to extract bits from a char */
'\200', '\100', '\040', '\020', '\010', '\004', '\002', '\001'
};
-int pflag; /* 1 to preserve parity bits */
+static int pflag; /* 1 to preserve parity bits */
#ifdef DES
-DES_key_schedule schedule; /* expanded DES key */
+static DES_key_schedule schedule; /* expanded DES key */
#endif
-unsigned char des_buf[8]; /* shared buffer for get_des_char/put_des_char */
-int des_ct = 0; /* count for get_des_char/put_des_char */
-int des_n = 0; /* index for put_des_char/get_des_char */
+static unsigned char des_buf[8];/* shared buffer for get_des_char/put_des_char */
+static int des_ct = 0; /* count for get_des_char/put_des_char */
+static int des_n = 0; /* index for put_des_char/get_des_char */
/* init_des_cipher: initialize DES */
void
diff --git a/bin/ed/glbl.c b/bin/ed/glbl.c
index 11dcc19..5524700 100644
--- a/bin/ed/glbl.c
+++ b/bin/ed/glbl.c
@@ -135,11 +135,11 @@ exec_global(int interact, int gflag)
}
-line_t **active_list; /* list of lines active in a global command */
-long active_last; /* index of last active line in active_list */
-long active_size; /* size of active_list */
-long active_ptr; /* active_list index (non-decreasing) */
-long active_ndx; /* active_list index (modulo active_last) */
+static line_t **active_list; /* list of lines active in a global command */
+static long active_last; /* index of last active line in active_list */
+static long active_size; /* size of active_list */
+static long active_ptr; /* active_list index (non-decreasing) */
+static long active_ndx; /* active_list index (modulo active_last) */
/* set_active_node: add a line node to the global-active list */
int
diff --git a/bin/ed/io.c b/bin/ed/io.c
index 63fe10c..29c5612 100644
--- a/bin/ed/io.c
+++ b/bin/ed/io.c
@@ -61,8 +61,8 @@ read_file(char *fn, long n)
extern int des;
-char *sbuf; /* file i/o buffer */
-int sbufsz; /* file i/o buffer size */
+static char *sbuf; /* file i/o buffer */
+static int sbufsz; /* file i/o buffer size */
int newline_added; /* if set, newline appended to input file */
/* read_stream: read a stream into the editor buffer; return status */
diff --git a/bin/ed/main.c b/bin/ed/main.c
index f414d40..98bb300 100644
--- a/bin/ed/main.c
+++ b/bin/ed/main.c
@@ -66,40 +66,40 @@ __FBSDID("$FreeBSD$");
#ifdef _POSIX_SOURCE
-sigjmp_buf env;
+static sigjmp_buf env;
#else
-jmp_buf env;
+static jmp_buf env;
#endif
/* static buffers */
char stdinbuf[1]; /* stdin buffer */
-char *shcmd; /* shell command buffer */
-int shcmdsz; /* shell command buffer size */
-int shcmdi; /* shell command buffer index */
+static char *shcmd; /* shell command buffer */
+static int shcmdsz; /* shell command buffer size */
+static int shcmdi; /* shell command buffer index */
char *ibuf; /* ed command-line buffer */
int ibufsz; /* ed command-line buffer size */
char *ibufp; /* pointer to ed command-line buffer */
/* global flags */
int des = 0; /* if set, use crypt(3) for i/o */
-int garrulous = 0; /* if set, print all error messages */
+static int garrulous = 0; /* if set, print all error messages */
int isbinary; /* if set, buffer contains ASCII NULs */
int isglobal; /* if set, doing a global command */
int modified; /* if set, buffer modified since last write */
int mutex = 0; /* if set, signals set "sigflags" */
-int red = 0; /* if set, restrict shell/directory access */
+static int red = 0; /* if set, restrict shell/directory access */
int scripted = 0; /* if set, suppress diagnostics */
int sigflags = 0; /* if set, signals received while mutex set */
-int sigactive = 0; /* if set, signal handlers are enabled */
+static int sigactive = 0; /* if set, signal handlers are enabled */
-char old_filename[PATH_MAX] = ""; /* default filename */
+static char old_filename[PATH_MAX] = ""; /* default filename */
long current_addr; /* current address in editor buffer */
long addr_last; /* last address in editor buffer */
int lineno; /* script line number */
-const char *prompt; /* command-line prompt */
-const char *dps = "*"; /* default command-line prompt */
+static const char *prompt; /* command-line prompt */
+static const char *dps = "*"; /* default command-line prompt */
-const char usage[] = "usage: %s [-] [-sx] [-p string] [file]\n";
+static const char *usage = "usage: %s [-] [-sx] [-p string] [file]\n";
/* ed: line editor */
int
@@ -254,7 +254,8 @@ top:
/*NOTREACHED*/
}
-long first_addr, second_addr, addr_cnt;
+long first_addr, second_addr;
+static long addr_cnt;
/* extract_addr_range: get line addresses from the command buffer until an
illegal address is seen; return status */
@@ -1241,8 +1242,8 @@ display_lines(long from, long to, int gflag)
#define MAXMARK 26 /* max number of marks */
-line_t *mark[MAXMARK]; /* line markers */
-int markno; /* line marker count */
+static line_t *mark[MAXMARK]; /* line markers */
+static int markno; /* line marker count */
/* mark_line_node: set a line node mark */
int
diff --git a/bin/ed/sub.c b/bin/ed/sub.c
index 1c44328..d12a5c9 100644
--- a/bin/ed/sub.c
+++ b/bin/ed/sub.c
@@ -32,9 +32,9 @@ __FBSDID("$FreeBSD$");
#include "ed.h"
-char *rhbuf; /* rhs substitution buffer */
-int rhbufsz; /* rhs substitution buffer size */
-int rhbufi; /* rhs substitution buffer index */
+static char *rhbuf; /* rhs substitution buffer */
+static int rhbufsz; /* rhs substitution buffer size */
+static int rhbufi; /* rhs substitution buffer index */
/* extract_subst_tail: extract substitution tail from the command buffer */
int
@@ -105,8 +105,8 @@ extract_subst_template(void)
}
-char *rbuf; /* substitute_matching_text buffer */
-int rbufsz; /* substitute_matching_text buffer size */
+static char *rbuf; /* substitute_matching_text buffer */
+static int rbufsz; /* substitute_matching_text buffer size */
/* search_and_replace: for each line in a range, change text matching a pattern
according to a substitution template; return status */
diff --git a/bin/ed/undo.c b/bin/ed/undo.c
index 6a8ca9e..603e39f 100644
--- a/bin/ed/undo.c
+++ b/bin/ed/undo.c
@@ -32,9 +32,9 @@ __FBSDID("$FreeBSD$");
#define USIZE 100 /* undo stack size */
-undo_t *ustack = NULL; /* undo stack */
-long usize = 0; /* stack size variable */
-long u_p = 0; /* undo stack pointer */
+static undo_t *ustack = NULL; /* undo stack */
+static long usize = 0; /* stack size variable */
+static long u_p = 0; /* undo stack pointer */
/* push_undo_stack: return pointer to initialized undo node */
undo_t *
diff --git a/bin/getfacl/getfacl.c b/bin/getfacl/getfacl.c
index ea376c7..45d6b45 100644
--- a/bin/getfacl/getfacl.c
+++ b/bin/getfacl/getfacl.c
@@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
-int more_than_one = 0;
+static int more_than_one = 0;
static void
usage(void)
diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c
index c3b35a7..4914c85 100644
--- a/bin/pax/ar_io.c
+++ b/bin/pax/ar_io.c
@@ -85,7 +85,6 @@ const char *gzip_program; /* name of gzip program */
static pid_t zpid = -1; /* pid of child process */
static int get_phys(void);
-extern sigset_t s_mask;
static void ar_start_gzip(int, const char *, int);
/*
diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c
index bc808ab..4a3e5e7 100644
--- a/bin/pax/ar_subs.c
+++ b/bin/pax/ar_subs.c
@@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$");
static void wr_archive(ARCHD *, int is_app);
static int get_arc(void);
static int next_head(ARCHD *);
-extern sigset_t s_mask;
/*
* Routines which control the overall operation modes of pax as specified by
diff --git a/bin/pax/extern.h b/bin/pax/extern.h
index e716792..4375694 100644
--- a/bin/pax/extern.h
+++ b/bin/pax/extern.h
@@ -186,7 +186,7 @@ void options(int, char **);
OPLIST * opt_next(void);
int opt_add(const char *);
int bad_opt(void);
-char *chdname;
+extern char *chdname;
/*
* pat_rep.c
@@ -231,6 +231,7 @@ extern int exit_val;
extern int docrc;
extern char *dirptr;
extern const char *argv0;
+extern sigset_t s_mask;
extern FILE *listf;
extern char *tempfile;
extern char *tempbase;
diff --git a/bin/pax/options.c b/bin/pax/options.c
index 5fd641f..32d967e 100644
--- a/bin/pax/options.c
+++ b/bin/pax/options.c
@@ -81,6 +81,7 @@ static void cpio_usage(void);
#define GETLINE_OUT_OF_MEM 2
static int getline_error;
+char *chdname;
#define GZIP_CMD "gzip" /* command to run as gzip */
#define COMPRESS_CMD "compress" /* command to run as compress */
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c
index 3357705..186dde6 100644
--- a/bin/rcp/rcp.c
+++ b/bin/rcp/rcp.c
@@ -76,12 +76,13 @@ __FBSDID("$FreeBSD$");
#define OPTIONS "46dfprt"
-struct passwd *pwd;
-u_short port;
-uid_t userid;
-int errs, rem;
-int pflag, iamremote, iamrecursive, targetshouldbedirectory;
-int family = PF_UNSPEC;
+static struct passwd *pwd;
+static u_short port;
+static uid_t userid;
+static int errs, rem;
+int iamremote;
+static int pflag, iamrecursive, targetshouldbedirectory;
+static int family = PF_UNSPEC;
static int argc_copy;
static const char **argv_copy;
@@ -89,7 +90,7 @@ static const char **argv_copy;
static char period[] = ".";
#define CMDNEEDS 64
-char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
+static char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */
int response(void);
void rsource(char *, struct stat *);
diff --git a/bin/setfacl/setfacl.c b/bin/setfacl/setfacl.c
index e1f3023..c69f0ba 100644
--- a/bin/setfacl/setfacl.c
+++ b/bin/setfacl/setfacl.c
@@ -42,6 +42,35 @@ __FBSDID("$FreeBSD$");
#include "setfacl.h"
+/* file operations */
+#define OP_MERGE_ACL 0x00 /* merge acl's (-mM) */
+#define OP_REMOVE_DEF 0x01 /* remove default acl's (-k) */
+#define OP_REMOVE_EXT 0x02 /* remove extended acl's (-b) */
+#define OP_REMOVE_ACL 0x03 /* remove acl's (-xX) */
+#define OP_REMOVE_BY_NUMBER 0x04 /* remove acl's (-xX) by acl entry number */
+#define OP_ADD_ACL 0x05 /* add acls entries at a given position */
+
+/* TAILQ entry for acl operations */
+struct sf_entry {
+ uint op;
+ acl_t acl;
+ uint entry_number;
+ TAILQ_ENTRY(sf_entry) next;
+};
+static TAILQ_HEAD(, sf_entry) entrylist;
+
+/* TAILQ entry for files */
+struct sf_file {
+ const char *filename;
+ TAILQ_ENTRY(sf_file) next;
+};
+static TAILQ_HEAD(, sf_file) filelist;
+
+uint have_mask;
+uint need_mask;
+uint have_stdin;
+uint n_flag;
+
static void add_filename(const char *filename);
static void usage(void);
diff --git a/bin/setfacl/setfacl.h b/bin/setfacl/setfacl.h
index 84fdd92..c4afbfc 100644
--- a/bin/setfacl/setfacl.h
+++ b/bin/setfacl/setfacl.h
@@ -33,30 +33,6 @@
#include <sys/acl.h>
#include <sys/queue.h>
-/* file operations */
-#define OP_MERGE_ACL 0x00 /* merge acl's (-mM) */
-#define OP_REMOVE_DEF 0x01 /* remove default acl's (-k) */
-#define OP_REMOVE_EXT 0x02 /* remove extended acl's (-b) */
-#define OP_REMOVE_ACL 0x03 /* remove acl's (-xX) */
-#define OP_REMOVE_BY_NUMBER 0x04 /* remove acl's (-xX) by acl entry number */
-#define OP_ADD_ACL 0x05 /* add acls entries at a given position */
-
-/* TAILQ entry for acl operations */
-struct sf_entry {
- uint op;
- acl_t acl;
- uint entry_number;
- TAILQ_ENTRY(sf_entry) next;
-};
-TAILQ_HEAD(, sf_entry) entrylist;
-
-/* TAILQ entry for files */
-struct sf_file {
- const char *filename;
- TAILQ_ENTRY(sf_file) next;
-};
-TAILQ_HEAD(, sf_file) filelist;
-
/* files.c */
acl_t get_acl_from_file(const char *filename);
/* merge.c */
@@ -74,9 +50,9 @@ void *zmalloc(size_t size);
const char *brand_name(int brand);
int branding_mismatch(int brand1, int brand2);
-uint have_mask;
-uint need_mask;
-uint have_stdin;
-uint n_flag;
+extern uint have_mask;
+extern uint need_mask;
+extern uint have_stdin;
+extern uint n_flag;
#endif /* _SETFACL_H */
diff --git a/lib/libdwarf/dwarf_errmsg.c b/lib/libdwarf/dwarf_errmsg.c
index ffc2020..ca37740 100644
--- a/lib/libdwarf/dwarf_errmsg.c
+++ b/lib/libdwarf/dwarf_errmsg.c
@@ -29,7 +29,7 @@
#include <stdio.h>
#include "_libdwarf.h"
-const char *_libdwarf_errors[] = {
+static const char *_libdwarf_errors[] = {
#define DEFINE_ERROR(N,S) [DWARF_E_##N] = S
DEFINE_ERROR(NONE, "No Error"),
DEFINE_ERROR(ERROR, "An error"),
diff --git a/lib/libelf/elf_errmsg.c b/lib/libelf/elf_errmsg.c
index 05947a7..193a602 100644
--- a/lib/libelf/elf_errmsg.c
+++ b/lib/libelf/elf_errmsg.c
@@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$");
* Retrieve a human readable translation for an error message.
*/
-const char *_libelf_errors[] = {
+static const char *_libelf_errors[] = {
#define DEFINE_ERROR(N,S) [ELF_E_##N] = S
DEFINE_ERROR(NONE, "No Error"),
DEFINE_ERROR(ARCHIVE, "Malformed ar(1) archive"),
diff --git a/lib/librpcsec_gss/svc_rpcsec_gss.c b/lib/librpcsec_gss/svc_rpcsec_gss.c
index d0599be..e110a5f 100644
--- a/lib/librpcsec_gss/svc_rpcsec_gss.c
+++ b/lib/librpcsec_gss/svc_rpcsec_gss.c
@@ -140,8 +140,8 @@ TAILQ_HEAD(svc_rpc_gss_client_list, svc_rpc_gss_client);
#define CLIENT_HASH_SIZE 256
#define CLIENT_MAX 128
-struct svc_rpc_gss_client_list svc_rpc_gss_client_hash[CLIENT_HASH_SIZE];
-struct svc_rpc_gss_client_list svc_rpc_gss_clients;
+static struct svc_rpc_gss_client_list svc_rpc_gss_client_hash[CLIENT_HASH_SIZE];
+static struct svc_rpc_gss_client_list svc_rpc_gss_clients;
static size_t svc_rpc_gss_client_count;
static uint32_t svc_rpc_gss_next_clientid = 1;
diff --git a/lib/libthread_db/libpthread_db.c b/lib/libthread_db/libpthread_db.c
index 31ea15d..e190e56 100644
--- a/lib/libthread_db/libpthread_db.c
+++ b/lib/libthread_db/libpthread_db.c
@@ -1107,7 +1107,7 @@ pt_thr_tls_get_addr(const td_thrhandle_t *th, psaddr_t _linkmap, size_t offset,
return (TD_OK);
}
-struct ta_ops libpthread_db_ops = {
+static struct ta_ops libpthread_db_ops = {
.to_init = pt_init,
.to_ta_clear_event = pt_ta_clear_event,
.to_ta_delete = pt_ta_delete,
diff --git a/lib/libthread_db/libthr_db.c b/lib/libthread_db/libthr_db.c
index b24385f..c20394c 100644
--- a/lib/libthread_db/libthr_db.c
+++ b/lib/libthread_db/libthr_db.c
@@ -765,7 +765,7 @@ pt_thr_tls_get_addr(const td_thrhandle_t *th, psaddr_t _linkmap, size_t offset,
return (TD_OK);
}
-struct ta_ops libthr_db_ops = {
+static struct ta_ops libthr_db_ops = {
.to_init = pt_init,
.to_ta_clear_event = pt_ta_clear_event,
.to_ta_delete = pt_ta_delete,
diff --git a/libexec/tftpd/tftp-io.c b/libexec/tftpd/tftp-io.c
index 3ce4f6e..d5d7fc6 100644
--- a/libexec/tftpd/tftp-io.c
+++ b/libexec/tftpd/tftp-io.c
@@ -53,7 +53,7 @@ struct sockaddr_storage me_sock;
static int send_packet(int peer, uint16_t block, char *pkt, int size);
-struct errmsg {
+static struct errmsg {
int e_code;
const char *e_msg;
} errmsgs[] = {
@@ -375,7 +375,7 @@ send_data(int peer, uint16_t block, char *data, int size)
/*
* Receive a packet
*/
-jmp_buf timeoutbuf;
+static jmp_buf timeoutbuf;
static void
timeout(int sig __unused)
diff --git a/libexec/tftpd/tftp-utils.c b/libexec/tftpd/tftp-utils.c
index 5613dd1..c55f120 100644
--- a/libexec/tftpd/tftp-utils.c
+++ b/libexec/tftpd/tftp-utils.c
@@ -121,7 +121,7 @@ get_field(int peer, char *buffer, ssize_t size)
/*
* Logging functions
*/
-int _tftp_logtostdout = 1;
+static int _tftp_logtostdout = 1;
void
tftp_openlog(const char *ident, int logopt, int facility)
diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c
index 16702b7..7363abf 100644
--- a/libexec/tftpd/tftpd.c
+++ b/libexec/tftpd/tftpd.c
@@ -107,9 +107,9 @@ static void tftp_xmitfile(int peer, const char *mode);
static int validate_access(int peer, char **, int);
static char peername[NI_MAXHOST];
-FILE *file;
+static FILE *file;
-struct formats {
+static struct formats {
const char *f_mode;
int f_convert;
} formats[] = {
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;
OpenPOWER on IntegriCloud