summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-10-19 14:49:42 +0000
committered <ed@FreeBSD.org>2012-10-19 14:49:42 +0000
commitaf31e8843c2cc0ba388a33f341de8da1b50de433 (patch)
treeddffe542a2e921ec48c73d322a2046f559a9d74f /usr.sbin
parentb1462253851ab8c1f6dde48bb7796b15d3f38253 (diff)
downloadFreeBSD-src-af31e8843c2cc0ba388a33f341de8da1b50de433.zip
FreeBSD-src-af31e8843c2cc0ba388a33f341de8da1b50de433.tar.gz
More -Wmissing-variable-declarations fixes.
In addition to adding `static' where possible: - bin/date: Move `retval' into extern.h to make it visible to date.c. - bin/ed: Move globally used variables into ed.h. - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. - usr.bin/calendar: Remove unneeded variables. - usr.bin/chat: Make `line' local instead of global. - usr.bin/elfdump: Comment out unneeded function. - usr.bin/rlogin: Use _Noreturn instead of __dead2. - usr.bin/tset: Pull `Ospeed' into extern.h. - usr.sbin/mfiutil: Put global variables in mfiutil.h. - usr.sbin/pkg: Remove unused `os_corres'. - usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/acpi/acpidump/acpi.c15
-rw-r--r--usr.sbin/acpi/acpidump/acpi_user.c2
-rw-r--r--usr.sbin/cpucontrol/cpucontrol.c2
-rw-r--r--usr.sbin/ctladm/ctladm.c8
-rw-r--r--usr.sbin/ctladm/util.c2
-rw-r--r--usr.sbin/gpioctl/gpioctl.c2
-rw-r--r--usr.sbin/ip6addrctl/ip6addrctl.c2
-rw-r--r--usr.sbin/mfiutil/mfi_flash.c2
-rw-r--r--usr.sbin/mfiutil/mfi_show.c2
-rw-r--r--usr.sbin/mfiutil/mfiutil.c2
-rw-r--r--usr.sbin/mfiutil/mfiutil.h1
-rw-r--r--usr.sbin/nfscbd/nfscbd.c6
-rw-r--r--usr.sbin/nfsd/nfsd.c18
-rw-r--r--usr.sbin/pkg/elf_tables.h11
-rw-r--r--usr.sbin/pkg_install/version/perform.c6
-rw-r--r--usr.sbin/pmccontrol/pmccontrol.c13
-rw-r--r--usr.sbin/pmcstat/pmcpl_calltree.c6
-rw-r--r--usr.sbin/pmcstat/pmcstat.c13
-rw-r--r--usr.sbin/pmcstat/pmcstat_log.c8
-rw-r--r--usr.sbin/pmcstat/pmcstat_log.h4
-rw-r--r--usr.sbin/quotaon/quotaon.c19
-rw-r--r--usr.sbin/repquota/repquota.c19
-rw-r--r--usr.sbin/vidcontrol/vidcontrol.c2
23 files changed, 73 insertions, 92 deletions
diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c
index 85e5e0e..b0a751c 100644
--- a/usr.sbin/acpi/acpidump/acpi.c
+++ b/usr.sbin/acpi/acpidump/acpi.c
@@ -340,12 +340,13 @@ acpi_print_local_nmi(u_int lint, uint16_t mps_flags)
acpi_print_mps_flags(mps_flags);
}
-const char *apic_types[] = { "Local APIC", "IO APIC", "INT Override", "NMI",
- "Local APIC NMI", "Local APIC Override",
- "IO SAPIC", "Local SAPIC", "Platform Interrupt",
- "Local X2APIC", "Local X2APIC NMI" };
-const char *platform_int_types[] = { "0 (unknown)", "PMI", "INIT",
- "Corrected Platform Error" };
+static const char *apic_types[] = { "Local APIC", "IO APIC", "INT Override",
+ "NMI", "Local APIC NMI",
+ "Local APIC Override", "IO SAPIC",
+ "Local SAPIC", "Platform Interrupt",
+ "Local X2APIC", "Local X2APIC NMI" };
+static const char *platform_int_types[] = { "0 (unknown)", "PMI", "INIT",
+ "Corrected Platform Error" };
static void
acpi_print_madt(ACPI_SUBTABLE_HEADER *mp)
@@ -747,7 +748,7 @@ acpi_print_srat_memory(ACPI_SRAT_MEM_AFFINITY *mp)
printf("\tProximity Domain=%d\n", mp->ProximityDomain);
}
-const char *srat_types[] = { "CPU", "Memory", "X2APIC" };
+static const char *srat_types[] = { "CPU", "Memory", "X2APIC" };
static void
acpi_print_srat(ACPI_SUBTABLE_HEADER *srat)
diff --git a/usr.sbin/acpi/acpidump/acpi_user.c b/usr.sbin/acpi/acpidump/acpi_user.c
index 86e581f..0b2beb2 100644
--- a/usr.sbin/acpi/acpidump/acpi_user.c
+++ b/usr.sbin/acpi/acpidump/acpi_user.c
@@ -53,7 +53,7 @@ struct acpi_user_mapping {
size_t size;
};
-LIST_HEAD(acpi_user_mapping_list, acpi_user_mapping) maplist;
+static LIST_HEAD(acpi_user_mapping_list, acpi_user_mapping) maplist;
static void
acpi_user_init(void)
diff --git a/usr.sbin/cpucontrol/cpucontrol.c b/usr.sbin/cpucontrol/cpucontrol.c
index 8738612..c0d5a31 100644
--- a/usr.sbin/cpucontrol/cpucontrol.c
+++ b/usr.sbin/cpucontrol/cpucontrol.c
@@ -86,7 +86,7 @@ struct datadir {
};
static SLIST_HEAD(, datadir) datadirs = SLIST_HEAD_INITIALIZER(datadirs);
-struct ucode_handler {
+static struct ucode_handler {
ucode_probe_t *probe;
ucode_update_t *update;
} handlers[] = {
diff --git a/usr.sbin/ctladm/ctladm.c b/usr.sbin/ctladm/ctladm.c
index 9497101..2a743da 100644
--- a/usr.sbin/ctladm/ctladm.c
+++ b/usr.sbin/ctladm/ctladm.c
@@ -164,7 +164,7 @@ typedef enum {
static const char rw_opts[] = "Nb:c:d:f:l:";
static const char startstop_opts[] = "io";
-struct ctladm_opts option_table[] = {
+static struct ctladm_opts option_table[] = {
{"adddev", CTLADM_CMD_ADDDEV, CTLADM_ARG_NONE, NULL},
{"bbrread", CTLADM_CMD_BBRREAD, CTLADM_ARG_NEED_TL, "d:l:"},
{"create", CTLADM_CMD_CREATE, CTLADM_ARG_NONE, "b:B:d:l:o:s:S:t:"},
@@ -572,7 +572,7 @@ typedef enum {
CCTL_PORT_MODE_OFF
} cctl_port_mode;
-struct ctladm_opts cctl_fe_table[] = {
+static struct ctladm_opts cctl_fe_table[] = {
{"fc", CTL_PORT_FC, CTLADM_ARG_NONE, NULL},
{"scsi", CTL_PORT_SCSI, CTLADM_ARG_NONE, NULL},
{"internal", CTL_PORT_INTERNAL, CTLADM_ARG_NONE, NULL},
@@ -999,7 +999,7 @@ bailout:
return (retval);
}
-struct ctladm_opts cctl_err_types[] = {
+static struct ctladm_opts cctl_err_types[] = {
{"aborted", CTL_LUN_INJ_ABORTED, CTLADM_ARG_NONE, NULL},
{"mediumerr", CTL_LUN_INJ_MEDIUM_ERR, CTLADM_ARG_NONE, NULL},
{"ua", CTL_LUN_INJ_UA, CTLADM_ARG_NONE, NULL},
@@ -1008,7 +1008,7 @@ struct ctladm_opts cctl_err_types[] = {
};
-struct ctladm_opts cctl_err_patterns[] = {
+static struct ctladm_opts cctl_err_patterns[] = {
{"read", CTL_LUN_PAT_READ, CTLADM_ARG_NONE, NULL},
{"write", CTL_LUN_PAT_WRITE, CTLADM_ARG_NONE, NULL},
{"rw", CTL_LUN_PAT_READWRITE, CTLADM_ARG_NONE, NULL},
diff --git a/usr.sbin/ctladm/util.c b/usr.sbin/ctladm/util.c
index df13357..52d8d17 100644
--- a/usr.sbin/ctladm/util.c
+++ b/usr.sbin/ctladm/util.c
@@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$");
#include <camlib.h>
#include "ctladm.h"
-int verbose;
+static int verbose;
/* iget: Integer argument callback
*/
diff --git a/usr.sbin/gpioctl/gpioctl.c b/usr.sbin/gpioctl/gpioctl.c
index 8956ef4..9d76e1d 100644
--- a/usr.sbin/gpioctl/gpioctl.c
+++ b/usr.sbin/gpioctl/gpioctl.c
@@ -43,7 +43,7 @@ struct flag_desc {
uint32_t flag;
};
-struct flag_desc gpio_flags[] = {
+static struct flag_desc gpio_flags[] = {
{ "IN", GPIO_PIN_INPUT },
{ "OUT", GPIO_PIN_OUTPUT },
{ "OD", GPIO_PIN_OPENDRAIN },
diff --git a/usr.sbin/ip6addrctl/ip6addrctl.c b/usr.sbin/ip6addrctl/ip6addrctl.c
index 7514522..6a730ff 100644
--- a/usr.sbin/ip6addrctl/ip6addrctl.c
+++ b/usr.sbin/ip6addrctl/ip6addrctl.c
@@ -59,7 +59,7 @@ struct policyqueue {
struct in6_addrpolicy pc_policy;
};
TAILQ_HEAD(policyhead, policyqueue);
-struct policyhead policyhead;
+static struct policyhead policyhead;
static void usage(void);
static void get_policy(void);
diff --git a/usr.sbin/mfiutil/mfi_flash.c b/usr.sbin/mfiutil/mfi_flash.c
index 2601025..2b82529 100644
--- a/usr.sbin/mfiutil/mfi_flash.c
+++ b/usr.sbin/mfiutil/mfi_flash.c
@@ -42,8 +42,6 @@
#define FLASH_BUF_SIZE (64 * 1024)
-int fw_name_width, fw_version_width, fw_date_width, fw_time_width;
-
static void
scan_firmware(struct mfi_info_component *comp)
{
diff --git a/usr.sbin/mfiutil/mfi_show.c b/usr.sbin/mfiutil/mfi_show.c
index 28a2604..c8b4377 100644
--- a/usr.sbin/mfiutil/mfi_show.c
+++ b/usr.sbin/mfiutil/mfi_show.c
@@ -570,8 +570,6 @@ error:
}
MFI_COMMAND(show, drives, show_drives);
-int fw_name_width, fw_version_width, fw_date_width, fw_time_width;
-
static void
scan_firmware(struct mfi_info_component *comp)
{
diff --git a/usr.sbin/mfiutil/mfiutil.c b/usr.sbin/mfiutil/mfiutil.c
index 7a8833d..b0b6353 100644
--- a/usr.sbin/mfiutil/mfiutil.c
+++ b/usr.sbin/mfiutil/mfiutil.c
@@ -44,8 +44,8 @@ MFI_TABLE(top, stop);
MFI_TABLE(top, abort);
int mfi_unit;
-
u_int mfi_opts;
+int fw_name_width, fw_version_width, fw_date_width, fw_time_width;
static void
usage(void)
diff --git a/usr.sbin/mfiutil/mfiutil.h b/usr.sbin/mfiutil/mfiutil.h
index bb9366f..c696a05 100644
--- a/usr.sbin/mfiutil/mfiutil.h
+++ b/usr.sbin/mfiutil/mfiutil.h
@@ -122,6 +122,7 @@ struct mfiutil_command {
extern int mfi_unit;
extern u_int mfi_opts;
+extern int fw_name_width, fw_version_width, fw_date_width, fw_time_width;
void mbox_store_ldref(uint8_t *mbox, union mfi_ld_ref *ref);
void mbox_store_pdref(uint8_t *mbox, union mfi_pd_ref *ref);
diff --git a/usr.sbin/nfscbd/nfscbd.c b/usr.sbin/nfscbd/nfscbd.c
index ba09311..c9153b4 100644
--- a/usr.sbin/nfscbd/nfscbd.c
+++ b/usr.sbin/nfscbd/nfscbd.c
@@ -66,12 +66,12 @@ __FBSDID("$FreeBSD$");
/* Global defs */
#ifdef DEBUG
#define syslog(e, s) fprintf(stderr,(s))
-int debug = 1;
+static int debug = 1;
#else
-int debug = 0;
+static int debug = 0;
#endif
-pid_t children;
+static pid_t children;
static void nonfs(int);
static void reapchild(int);
diff --git a/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c
index c5cec5e..7f6f659 100644
--- a/usr.sbin/nfsd/nfsd.c
+++ b/usr.sbin/nfsd/nfsd.c
@@ -75,22 +75,22 @@ static const char rcsid[] =
/* Global defs */
#ifdef DEBUG
#define syslog(e, s...) fprintf(stderr,s)
-int debug = 1;
+static int debug = 1;
#else
-int debug = 0;
+static int debug = 0;
#endif
#define NFSD_STABLERESTART "/var/db/nfs-stablerestart"
#define NFSD_STABLEBACKUP "/var/db/nfs-stablerestart.bak"
#define MAXNFSDCNT 256
#define DEFNFSDCNT 4
-pid_t children[MAXNFSDCNT]; /* PIDs of children */
-int nfsdcnt; /* number of children */
-int new_syscall;
-int run_v4server = 1; /* Force running of nfsv4 server */
-int nfssvc_nfsd; /* Set to correct NFSSVC_xxx flag */
-int stablefd = -1; /* Fd for the stable restart file */
-int backupfd; /* Fd for the backup stable restart file */
+static pid_t children[MAXNFSDCNT]; /* PIDs of children */
+static int nfsdcnt; /* number of children */
+static int new_syscall;
+static int run_v4server = 1; /* Force running of nfsv4 server */
+static int nfssvc_nfsd; /* Set to correct NFSSVC_xxx flag */
+static int stablefd = -1; /* Fd for the stable restart file */
+static int backupfd; /* Fd for the backup stable restart file */
void cleanup(int);
void child_cleanup(int);
diff --git a/usr.sbin/pkg/elf_tables.h b/usr.sbin/pkg/elf_tables.h
index e02a2f7..d3d689a 100644
--- a/usr.sbin/pkg/elf_tables.h
+++ b/usr.sbin/pkg/elf_tables.h
@@ -34,7 +34,7 @@ struct _elf_corres {
const char *string;
};
-struct _elf_corres mach_corres[] = {
+static struct _elf_corres mach_corres[] = {
{ EM_386, "x86" },
{ EM_AMD64, "x86" },
{ EM_ARM, "arm" },
@@ -46,23 +46,18 @@ struct _elf_corres mach_corres[] = {
{ -1, NULL },
};
-struct _elf_corres wordsize_corres[] = {
+static struct _elf_corres wordsize_corres[] = {
{ ELFCLASS32, "32" },
{ ELFCLASS64, "64" },
{ -1, NULL},
};
-struct _elf_corres endian_corres[] = {
+static struct _elf_corres endian_corres[] = {
{ ELFDATA2MSB, "eb" },
{ ELFDATA2LSB, "el" },
{ -1, NULL}
};
-struct _elf_corres os_corres[] = {
- { ELFOSABI_FREEBSD, "freebsd" },
- { -1, NULL }
-};
-
#define EF_MIPS_ABI 0x0000F000
#define E_MIPS_ABI_O32 0x00001000
#define E_MIPS_ABI_N32 0x00000020
diff --git a/usr.sbin/pkg_install/version/perform.c b/usr.sbin/pkg_install/version/perform.c
index a5ac36f..426d979 100644
--- a/usr.sbin/pkg_install/version/perform.c
+++ b/usr.sbin/pkg_install/version/perform.c
@@ -27,9 +27,9 @@ __FBSDID("$FreeBSD$");
#include <fetch.h>
#include <signal.h>
-FILE *IndexFile;
-char IndexPath[PATH_MAX] = "";
-struct index_head Index = SLIST_HEAD_INITIALIZER(Index);
+static FILE *IndexFile;
+static char IndexPath[PATH_MAX] = "";
+static struct index_head Index = SLIST_HEAD_INITIALIZER(Index);
static int pkg_do(char *);
static void show_version(Package, const char *, const char *);
diff --git a/usr.sbin/pmccontrol/pmccontrol.c b/usr.sbin/pmccontrol/pmccontrol.c
index bc0ebdc..b3585d0 100644
--- a/usr.sbin/pmccontrol/pmccontrol.c
+++ b/usr.sbin/pmccontrol/pmccontrol.c
@@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$");
#define PMCC_PROGRAM_NAME "pmccontrol"
-STAILQ_HEAD(pmcc_op_list, pmcc_op) head = STAILQ_HEAD_INITIALIZER(head);
+static STAILQ_HEAD(pmcc_op_list, pmcc_op) head = STAILQ_HEAD_INITIALIZER(head);
struct pmcc_op {
char op_cpu;
@@ -94,7 +94,7 @@ static char usage_message[] =
" " PMCC_PROGRAM_NAME " [-e pmc | -d pmc | -c cpu] ...";
#if DEBUG
-FILE *debug_stream = NULL;
+static FILE *debug_stream = NULL;
#endif
#if DEBUG
@@ -104,15 +104,6 @@ FILE *debug_stream = NULL;
#define DEBUG_MSG(m) /* */
#endif /* !DEBUG */
-int pmc_syscall = -1;
-
-#define PMC_CALL(cmd, params) \
-if ((error = syscall(pmc_syscall, PMC_OP_##cmd, (params))) != 0) \
-{ \
- DEBUG_MSG("ERROR: syscall [" #cmd "]"); \
- exit(EX_OSERR); \
-}
-
#if DEBUG
/* log debug messages to a separate file */
static void
diff --git a/usr.sbin/pmcstat/pmcpl_calltree.c b/usr.sbin/pmcstat/pmcpl_calltree.c
index 6b8bc61..3d0127d 100644
--- a/usr.sbin/pmcstat/pmcpl_calltree.c
+++ b/usr.sbin/pmcstat/pmcpl_calltree.c
@@ -125,7 +125,7 @@ struct pmcpl_ct_node_hash {
STAILQ_ENTRY(pmcpl_ct_node_hash) pch_next;
};
-struct pmcpl_ct_sample pmcpl_ct_callid;
+static struct pmcpl_ct_sample pmcpl_ct_callid;
#define PMCPL_CT_MAXCOL PMC_CALLCHAIN_DEPTH_MAX
#define PMCPL_CT_MAXLINE 1024 /* TODO: dynamic. */
@@ -135,8 +135,8 @@ struct pmcpl_ct_line {
unsigned ln_index;
};
-struct pmcpl_ct_line pmcpl_ct_topmax[PMCPL_CT_MAXLINE+1];
-struct pmcpl_ct_node
+static struct pmcpl_ct_line pmcpl_ct_topmax[PMCPL_CT_MAXLINE+1];
+static struct pmcpl_ct_node
*pmcpl_ct_topscreen[PMCPL_CT_MAXCOL+1][PMCPL_CT_MAXLINE+1];
/*
diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c
index 6808eed..cc43b82 100644
--- a/usr.sbin/pmcstat/pmcstat.c
+++ b/usr.sbin/pmcstat/pmcstat.c
@@ -105,13 +105,12 @@ __FBSDID("$FreeBSD$");
/* Globals */
-int pmcstat_interrupt = 0;
-int pmcstat_displayheight = DEFAULT_DISPLAY_HEIGHT;
-int pmcstat_displaywidth = DEFAULT_DISPLAY_WIDTH;
-int pmcstat_sockpair[NSOCKPAIRFD];
-int pmcstat_kq;
-kvm_t *pmcstat_kvm;
-struct kinfo_proc *pmcstat_plist;
+int pmcstat_displayheight = DEFAULT_DISPLAY_HEIGHT;
+int pmcstat_displaywidth = DEFAULT_DISPLAY_WIDTH;
+static int pmcstat_sockpair[NSOCKPAIRFD];
+static int pmcstat_kq;
+static kvm_t *pmcstat_kvm;
+static struct kinfo_proc *pmcstat_plist;
struct pmcstat_args args;
static void
diff --git a/usr.sbin/pmcstat/pmcstat_log.c b/usr.sbin/pmcstat/pmcstat_log.c
index e5fee35..fdcf9c4 100644
--- a/usr.sbin/pmcstat/pmcstat_log.c
+++ b/usr.sbin/pmcstat/pmcstat_log.c
@@ -142,7 +142,7 @@ struct pmcstat_image_hash_list pmcstat_image_hash[PMCSTAT_NHASH];
struct pmcstat_process_hash_list pmcstat_process_hash[PMCSTAT_NHASH];
struct pmcstat_stats pmcstat_stats; /* statistics */
-int ps_samples_period; /* samples count between top refresh. */
+static int ps_samples_period; /* samples count between top refresh. */
struct pmcstat_process *pmcstat_kernproc; /* kernel 'process' */
@@ -151,7 +151,7 @@ struct pmcstat_process *pmcstat_kernproc; /* kernel 'process' */
#include "pmcpl_annotate.h"
#include "pmcpl_calltree.h"
-struct pmc_plugins {
+static struct pmc_plugins {
const char *pl_name; /* name */
/* configure */
@@ -218,7 +218,7 @@ struct pmc_plugins {
}
};
-int pmcstat_mergepmc;
+static int pmcstat_mergepmc;
int pmcstat_pmcinfilter = 0; /* PMC filter for top mode. */
float pmcstat_threshold = 0.5; /* Cost filter for top mode. */
@@ -275,7 +275,7 @@ int pmcstat_npmcs;
/*
* PMC Top mode pause state.
*/
-int pmcstat_pause;
+static int pmcstat_pause;
static void
pmcstat_stats_reset(int reset_global)
diff --git a/usr.sbin/pmcstat/pmcstat_log.h b/usr.sbin/pmcstat/pmcstat_log.h
index bfa925c..b4ced4d 100644
--- a/usr.sbin/pmcstat/pmcstat_log.h
+++ b/usr.sbin/pmcstat/pmcstat_log.h
@@ -176,8 +176,8 @@ extern int pmcstat_npmcs; /* PMC count. */
/*
* Top mode global options.
*/
-float pmcstat_threshold; /* Threshold to filter node. */
-int pmcstat_pmcinfilter; /* PMC index displayed. */
+extern float pmcstat_threshold; /* Threshold to filter node. */
+extern int pmcstat_pmcinfilter; /* PMC index displayed. */
/* Function prototypes */
const char *pmcstat_pmcid_to_name(pmc_id_t _pmcid);
diff --git a/usr.sbin/quotaon/quotaon.c b/usr.sbin/quotaon/quotaon.c
index 8d52983..740df39 100644
--- a/usr.sbin/quotaon/quotaon.c
+++ b/usr.sbin/quotaon/quotaon.c
@@ -59,16 +59,15 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#include <unistd.h>
-const char *qfname = QUOTAFILENAME;
-const char *qfextension[] = INITQFNAMES;
+static const char *qfextension[] = INITQFNAMES;
-int aflag; /* all filesystems */
-int gflag; /* operate on group quotas */
-int uflag; /* operate on user quotas */
-int vflag; /* verbose */
+static int aflag; /* all filesystems */
+static int gflag; /* operate on group quotas */
+static int uflag; /* operate on user quotas */
+static int vflag; /* verbose */
-int oneof(char *, char *[], int);
-int quotaonoff(struct fstab *fs, int, int);
+static int oneof(char *, char *[], int);
+static int quotaonoff(struct fstab *fs, int, int);
static void usage(void);
int
@@ -150,7 +149,7 @@ usage(void)
exit(1);
}
-int
+static int
quotaonoff(struct fstab *fs, int offmode, int type)
{
struct quotafile *qf;
@@ -181,7 +180,7 @@ quotaonoff(struct fstab *fs, int offmode, int type)
/*
* Check to see if target appears in list of size cnt.
*/
-int
+static int
oneof(char *target, char *list[], int cnt)
{
int i;
diff --git a/usr.sbin/repquota/repquota.c b/usr.sbin/repquota/repquota.c
index 8fdea20..4ffc2e6 100644
--- a/usr.sbin/repquota/repquota.c
+++ b/usr.sbin/repquota/repquota.c
@@ -79,8 +79,7 @@ __FBSDID("$FreeBSD$");
#define max(a,b) ((a) >= (b) ? (a) : (b))
-const char *qfname = QUOTAFILENAME;
-const char *qfextension[] = INITQFNAMES;
+static const char *qfextension[] = INITQFNAMES;
struct fileusage {
struct fileusage *fu_next;
@@ -89,15 +88,15 @@ struct fileusage {
/* actually bigger */
};
#define FUHASH 1024 /* must be power of two */
-struct fileusage *fuhead[MAXQUOTAS][FUHASH];
-struct fileusage *lookup(u_long, int);
-struct fileusage *addid(u_long, int, char *);
-u_long highid[MAXQUOTAS]; /* highest addid()'ed identifier per type */
+static struct fileusage *fuhead[MAXQUOTAS][FUHASH];
+static struct fileusage *lookup(u_long, int);
+static struct fileusage *addid(u_long, int, char *);
+static u_long highid[MAXQUOTAS]; /* highest addid()'ed identifier per type */
-int vflag; /* verbose */
-int aflag; /* all filesystems */
-int nflag; /* display user/group by id */
-int hflag; /* display in human readable format */
+static int vflag; /* verbose */
+static int aflag; /* all filesystems */
+static int nflag; /* display user/group by id */
+static int hflag; /* display in human readable format */
int oneof(char *, char *[], int);
int repquota(struct fstab *, int);
diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c
index 630de74..d07f892 100644
--- a/usr.sbin/vidcontrol/vidcontrol.c
+++ b/usr.sbin/vidcontrol/vidcontrol.c
@@ -70,7 +70,7 @@ static const char *legal_colors[16] = {
"lightred", "lightmagenta", "yellow", "lightwhite"
};
-struct {
+static struct {
int active_vty;
vid_info_t console_info;
unsigned char screen_map[256];
OpenPOWER on IntegriCloud