diff options
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/at/privs.h | 12 | ||||
-rw-r--r-- | usr.bin/calendar/calendar.c | 4 | ||||
-rw-r--r-- | usr.bin/calendar/dates.c | 11 | ||||
-rw-r--r-- | usr.bin/calendar/day.c | 2 | ||||
-rw-r--r-- | usr.bin/calendar/io.c | 6 | ||||
-rw-r--r-- | usr.bin/chat/chat.c | 53 | ||||
-rw-r--r-- | usr.bin/ctlstat/ctlstat.c | 2 | ||||
-rw-r--r-- | usr.bin/elfdump/elfdump.c | 111 | ||||
-rw-r--r-- | usr.bin/fetch/fetch.c | 82 | ||||
-rw-r--r-- | usr.bin/finger/finger.c | 3 | ||||
-rw-r--r-- | usr.bin/gencat/gencat.c | 2 | ||||
-rw-r--r-- | usr.bin/grep/grep.c | 7 | ||||
-rw-r--r-- | usr.bin/grep/regex/xmalloc.c | 4 | ||||
-rw-r--r-- | usr.bin/gzip/zuncompress.c | 7 | ||||
-rw-r--r-- | usr.bin/msgs/msgs.c | 80 | ||||
-rw-r--r-- | usr.bin/ncal/ncal.c | 172 | ||||
-rw-r--r-- | usr.bin/rlogin/rlogin.c | 98 | ||||
-rw-r--r-- | usr.bin/rpcgen/rpc_main.c | 2 | ||||
-rw-r--r-- | usr.bin/rpcgen/rpc_svcout.c | 2 | ||||
-rw-r--r-- | usr.bin/rpcgen/rpc_util.c | 4 | ||||
-rw-r--r-- | usr.bin/sort/sort.c | 2 | ||||
-rw-r--r-- | usr.bin/stat/stat.c | 4 | ||||
-rw-r--r-- | usr.bin/tftp/main.c | 4 | ||||
-rw-r--r-- | usr.bin/tset/extern.h | 3 | ||||
-rw-r--r-- | usr.bin/tset/map.c | 9 | ||||
-rw-r--r-- | usr.bin/tset/term.c | 2 |
26 files changed, 347 insertions, 341 deletions
diff --git a/usr.bin/at/privs.h b/usr.bin/at/privs.h index 50dd6b1..3f70ce8 100644 --- a/usr.bin/at/privs.h +++ b/usr.bin/at/privs.h @@ -59,15 +59,13 @@ * to the real userid before calling any of them. */ -#ifndef MAIN -extern -#endif -uid_t real_uid, effective_uid; +extern uid_t real_uid, effective_uid; +extern gid_t real_gid, effective_gid; -#ifndef MAIN -extern -#endif +#ifdef MAIN +uid_t real_uid, effective_uid; gid_t real_gid, effective_gid; +#endif #define RELINQUISH_PRIVS { \ real_uid = getuid(); \ diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c index bd03e02..2a107c2 100644 --- a/usr.bin/calendar/calendar.c +++ b/usr.bin/calendar/calendar.c @@ -60,8 +60,8 @@ __FBSDID("$FreeBSD$"); struct passwd *pw; int doall = 0; int debug = 0; -char *DEBUG = NULL; -time_t f_time = 0; +static char *DEBUG = NULL; +static time_t f_time = 0; double UTCOffset = UTCOFFSET_NOTSET; int EastLongitude = LONGITUDE_NOTSET; diff --git a/usr.bin/calendar/dates.c b/usr.bin/calendar/dates.c index 3f8b89f..989f29c 100644 --- a/usr.bin/calendar/dates.c +++ b/usr.bin/calendar/dates.c @@ -43,7 +43,7 @@ struct cal_year { int firstdayofweek; /* 0 .. 6 */ struct cal_month *months; struct cal_year *nextyear; -} cal_year; +}; struct cal_month { int month; /* 01 .. 12 */ @@ -52,7 +52,7 @@ struct cal_month { struct cal_year *year; /* points back */ struct cal_day *days; struct cal_month *nextmonth; -} cal_month; +}; struct cal_day { int dayofmonth; /* 01 .. 31 */ @@ -62,19 +62,18 @@ struct cal_day { struct cal_month *month; /* points back */ struct cal_year *year; /* points back */ struct event *events; -} cal_day; +}; int debug_remember = 0; -struct cal_year *hyear = NULL; +static struct cal_year *hyear = NULL; /* 1-based month, 0-based days, cumulative */ -int *cumdays; int cumdaytab[][14] = { {0, -1, 30, 58, 89, 119, 150, 180, 211, 242, 272, 303, 333, 364}, {0, -1, 30, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365}, }; /* 1-based month, individual */ -int *mondays; +static int *mondays; int mondaytab[][14] = { {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30}, {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 30}, diff --git a/usr.bin/calendar/day.c b/usr.bin/calendar/day.c index 237b6b5..dac6115 100644 --- a/usr.bin/calendar/day.c +++ b/usr.bin/calendar/day.c @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include "calendar.h" -time_t time1, time2; +static time_t time1, time2; const struct tm tm0; char dayname[100]; int year1, year2; diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index e1ed21d..1625717 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -60,10 +60,10 @@ __FBSDID("$FreeBSD$"); #include "calendar.h" const char *calendarFile = "calendar"; /* default calendar file */ -const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ -const char *calendarNoMail = "nomail"; /* don't sent mail if this file exist */ +static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ +static const char *calendarNoMail = "nomail";/* don't sent mail if file exist */ -char path[MAXPATHLEN]; +static char path[MAXPATHLEN]; struct fixs neaster, npaskha, ncny, nfullmoon, nnewmoon; struct fixs nmarequinox, nsepequinox, njunsolstice, ndecsolstice; diff --git a/usr.bin/chat/chat.c b/usr.bin/chat/chat.c index 86e6cfb..522762d 100644 --- a/usr.bin/chat/chat.c +++ b/usr.bin/chat/chat.c @@ -109,40 +109,39 @@ __FBSDID("$FreeBSD$"); #define MAX_REPORTS 50 #define DEFAULT_CHAT_TIMEOUT 45 -int echo = 0; -int verbose = 0; -int to_log = 1; -int to_stderr = 0; -int Verbose = 0; -int quiet = 0; -int exit_code = 0; -FILE* report_fp = (FILE *) 0; -char *report_file = (char *) 0; -char *chat_file = (char *) 0; -char *phone_num = (char *) 0; -char *phone_num2 = (char *) 0; -int timeout = DEFAULT_CHAT_TIMEOUT; +static int echo; +static int verbose; +static int to_log; +static int to_stderr; +static int Verbose; +static int quiet; +static int exit_code; +static FILE* report_fp; +static char *report_file; +static char *chat_file; +static char *phone_num; +static char *phone_num2; +static int timeout = DEFAULT_CHAT_TIMEOUT; static char blank[] = ""; -int have_tty_parameters = 0; +static int have_tty_parameters; #define term_parms struct termios #define get_term_param(param) tcgetattr(0, param) #define set_term_param(param) tcsetattr(0, TCSANOW, param) -struct termios saved_tty_parameters; +static struct termios saved_tty_parameters; -char *abort_string[MAX_ABORTS], *fail_reason = (char *)0, - fail_buffer[50]; -int n_aborts = 0, abort_next = 0, timeout_next = 0, echo_next = 0; -int clear_abort_next = 0; +static char *abort_string[MAX_ABORTS], *fail_reason, fail_buffer[50]; +static int n_aborts, abort_next, timeout_next, echo_next; +static int clear_abort_next; -char *report_string[MAX_REPORTS] ; -char report_buffer[50] ; -int n_reports = 0, report_next = 0, report_gathering = 0 ; -int clear_report_next = 0; +static char *report_string[MAX_REPORTS]; +static char report_buffer[50]; +static int n_reports, report_next, report_gathering; +static int clear_report_next; -int say_next = 0, hup_next = 0; +static int say_next, hup_next; void *dup_mem(void *b, size_t c); void *copy_of(char *s); @@ -396,14 +395,13 @@ usage(void) exit(1); } -char line[1024]; - /* * Send a message to syslog and/or stderr. */ void chat_logf(const char *fmt, ...) { + char line[1024]; va_list args; va_start(args, fmt); @@ -422,6 +420,7 @@ chat_logf(const char *fmt, ...) void fatal(int code, const char *fmt, ...) { + char line[1024]; va_list args; va_start(args, fmt); @@ -434,7 +433,7 @@ fatal(int code, const char *fmt, ...) terminate(code); } -int alarmed = 0; +static int alarmed; SIGTYPE sigalrm(int signo __unused) { diff --git a/usr.bin/ctlstat/ctlstat.c b/usr.bin/ctlstat/ctlstat.c index 4d73401..1462ab9 100644 --- a/usr.bin/ctlstat/ctlstat.c +++ b/usr.bin/ctlstat/ctlstat.c @@ -329,7 +329,7 @@ compute_stats(struct ctl_lun_io_stats *cur_stats, #define PRINT_BINTIME(prefix, bt) \ printf("%s %jd s %ju frac\n", prefix, (intmax_t)(bt).sec, \ (uintmax_t)(bt).frac) -const char *iotypes[] = {"NO IO", "READ", "WRITE"}; +static const char *iotypes[] = {"NO IO", "READ", "WRITE"}; static void ctlstat_dump(struct ctlstat_context *ctx) { diff --git a/usr.bin/elfdump/elfdump.c b/usr.bin/elfdump/elfdump.c index 99ae8bf..f966f84 100644 --- a/usr.bin/elfdump/elfdump.c +++ b/usr.bin/elfdump/elfdump.c @@ -83,7 +83,7 @@ enum elf_member { typedef enum elf_member elf_member_t; -int elf32_offsets[] = { +static int elf32_offsets[] = { 0, offsetof(Elf32_Dyn, d_tag), offsetof(Elf32_Dyn, d_un.d_ptr), @@ -124,7 +124,7 @@ int elf32_offsets[] = { offsetof(Elf32_Rela, r_addend) }; -int elf64_offsets[] = { +static int elf64_offsets[] = { 0, offsetof(Elf64_Dyn, d_tag), offsetof(Elf64_Dyn, d_un.d_ptr), @@ -266,23 +266,23 @@ e_machines(u_int mach) return (machdesc); } -const char *e_types[] = { +static const char *e_types[] = { "ET_NONE", "ET_REL", "ET_EXEC", "ET_DYN", "ET_CORE" }; -const char *ei_versions[] = { +static const char *ei_versions[] = { "EV_NONE", "EV_CURRENT" }; -const char *ei_classes[] = { +static const char *ei_classes[] = { "ELFCLASSNONE", "ELFCLASS32", "ELFCLASS64" }; -const char *ei_data[] = { +static const char *ei_data[] = { "ELFDATANONE", "ELFDATA2LSB", "ELFDATA2MSB" }; -const char *ei_abis[256] = { +static const char *ei_abis[256] = { "ELFOSABI_SYSV", "ELFOSABI_HPUX", "ELFOSABI_NETBSD", "ELFOSABI_LINUX", "ELFOSABI_HURD", "ELFOSABI_86OPEN", "ELFOSABI_SOLARIS", "ELFOSABI_AIX", "ELFOSABI_IRIX", "ELFOSABI_FREEBSD", "ELFOSABI_TRU64", @@ -290,12 +290,12 @@ const char *ei_abis[256] = { [255] = "ELFOSABI_STANDALONE" }; -const char *p_types[] = { +static const char *p_types[] = { "PT_NULL", "PT_LOAD", "PT_DYNAMIC", "PT_INTERP", "PT_NOTE", "PT_SHLIB", "PT_PHDR", "PT_TLS" }; -const char *p_flags[] = { +static const char *p_flags[] = { "", "PF_X", "PF_W", "PF_X|PF_W", "PF_R", "PF_X|PF_R", "PF_W|PF_R", "PF_X|PF_W|PF_R" }; @@ -339,44 +339,47 @@ sh_types(u_int64_t sht) { } } -const char *sh_flags[] = { +static const char *sh_flags[] = { "", "SHF_WRITE", "SHF_ALLOC", "SHF_WRITE|SHF_ALLOC", "SHF_EXECINSTR", "SHF_WRITE|SHF_EXECINSTR", "SHF_ALLOC|SHF_EXECINSTR", "SHF_WRITE|SHF_ALLOC|SHF_EXECINSTR" }; -const char *st_types[] = { +static const char *st_types[] = { "STT_NOTYPE", "STT_OBJECT", "STT_FUNC", "STT_SECTION", "STT_FILE" }; -const char *st_bindings[] = { +static const char *st_bindings[] = { "STB_LOCAL", "STB_GLOBAL", "STB_WEAK" }; -char *dynstr; -char *shstrtab; -char *strtab; -FILE *out; - -u_int64_t elf_get_byte(Elf32_Ehdr *e, void *base, elf_member_t member); -u_int64_t elf_get_quarter(Elf32_Ehdr *e, void *base, elf_member_t member); -u_int64_t elf_get_half(Elf32_Ehdr *e, void *base, elf_member_t member); -u_int64_t elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member); -u_int64_t elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member); - -void elf_print_ehdr(Elf32_Ehdr *e); -void elf_print_phdr(Elf32_Ehdr *e, void *p); -void elf_print_shdr(Elf32_Ehdr *e, void *sh); -void elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str); -void elf_print_dynamic(Elf32_Ehdr *e, void *sh); -void elf_print_rel(Elf32_Ehdr *e, void *r); -void elf_print_rela(Elf32_Ehdr *e, void *ra); -void elf_print_interp(Elf32_Ehdr *e, void *p); -void elf_print_got(Elf32_Ehdr *e, void *sh); -void elf_print_hash(Elf32_Ehdr *e, void *sh); -void elf_print_note(Elf32_Ehdr *e, void *sh); - -void usage(void); +static char *dynstr; +static char *shstrtab; +static char *strtab; +static FILE *out; + +static u_int64_t elf_get_byte(Elf32_Ehdr *e, void *base, elf_member_t member); +static u_int64_t elf_get_quarter(Elf32_Ehdr *e, void *base, + elf_member_t member); +#if 0 +static u_int64_t elf_get_half(Elf32_Ehdr *e, void *base, elf_member_t member); +#endif +static u_int64_t elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member); +static u_int64_t elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member); + +static void elf_print_ehdr(Elf32_Ehdr *e); +static void elf_print_phdr(Elf32_Ehdr *e, void *p); +static void elf_print_shdr(Elf32_Ehdr *e, void *sh); +static void elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str); +static void elf_print_dynamic(Elf32_Ehdr *e, void *sh); +static void elf_print_rel(Elf32_Ehdr *e, void *r); +static void elf_print_rela(Elf32_Ehdr *e, void *ra); +static void elf_print_interp(Elf32_Ehdr *e, void *p); +static void elf_print_got(Elf32_Ehdr *e, void *sh); +static void elf_print_hash(Elf32_Ehdr *e, void *sh); +static void elf_print_note(Elf32_Ehdr *e, void *sh); + +static void usage(void); int main(int ac, char **av) @@ -551,7 +554,7 @@ main(int ac, char **av) return 0; } -void +static void elf_print_ehdr(Elf32_Ehdr *e) { u_int64_t class; @@ -606,7 +609,7 @@ elf_print_ehdr(Elf32_Ehdr *e) fprintf(out, "\te_shstrndx: %jd\n", (intmax_t)shstrndx); } -void +static void elf_print_phdr(Elf32_Ehdr *e, void *p) { u_int64_t phentsize; @@ -648,7 +651,7 @@ elf_print_phdr(Elf32_Ehdr *e, void *p) } } -void +static void elf_print_shdr(Elf32_Ehdr *e, void *sh) { u_int64_t shentsize; @@ -696,7 +699,7 @@ elf_print_shdr(Elf32_Ehdr *e, void *sh) } } -void +static void elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str) { u_int64_t offset; @@ -735,7 +738,7 @@ elf_print_symtab(Elf32_Ehdr *e, void *sh, char *str) } } -void +static void elf_print_dynamic(Elf32_Ehdr *e, void *sh) { u_int64_t offset; @@ -795,7 +798,7 @@ elf_print_dynamic(Elf32_Ehdr *e, void *sh) } } -void +static void elf_print_rela(Elf32_Ehdr *e, void *sh) { u_int64_t offset; @@ -827,7 +830,7 @@ elf_print_rela(Elf32_Ehdr *e, void *sh) } } -void +static void elf_print_rel(Elf32_Ehdr *e, void *sh) { u_int64_t offset; @@ -856,7 +859,7 @@ elf_print_rel(Elf32_Ehdr *e, void *sh) } } -void +static void elf_print_interp(Elf32_Ehdr *e, void *p) { u_int64_t offset; @@ -868,7 +871,7 @@ elf_print_interp(Elf32_Ehdr *e, void *p) fprintf(out, "\t%s\n", s); } -void +static void elf_print_got(Elf32_Ehdr *e, void *sh) { u_int64_t offset; @@ -891,12 +894,12 @@ elf_print_got(Elf32_Ehdr *e, void *sh) } } -void +static void elf_print_hash(Elf32_Ehdr *e __unused, void *sh __unused) { } -void +static void elf_print_note(Elf32_Ehdr *e, void *sh) { u_int64_t offset; @@ -922,7 +925,7 @@ elf_print_note(Elf32_Ehdr *e, void *sh) } } -u_int64_t +static u_int64_t elf_get_byte(Elf32_Ehdr *e, void *base, elf_member_t member) { u_int64_t val; @@ -942,7 +945,7 @@ elf_get_byte(Elf32_Ehdr *e, void *base, elf_member_t member) return val; } -u_int64_t +static u_int64_t elf_get_quarter(Elf32_Ehdr *e, void *base, elf_member_t member) { u_int64_t val; @@ -982,7 +985,8 @@ elf_get_quarter(Elf32_Ehdr *e, void *base, elf_member_t member) return val; } -u_int64_t +#if 0 +static u_int64_t elf_get_half(Elf32_Ehdr *e, void *base, elf_member_t member) { u_int64_t val; @@ -1021,8 +1025,9 @@ elf_get_half(Elf32_Ehdr *e, void *base, elf_member_t member) return val; } +#endif -u_int64_t +static u_int64_t elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member) { u_int64_t val; @@ -1062,7 +1067,7 @@ elf_get_word(Elf32_Ehdr *e, void *base, elf_member_t member) return val; } -u_int64_t +static u_int64_t elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member) { u_int64_t val; @@ -1102,7 +1107,7 @@ elf_get_quad(Elf32_Ehdr *e, void *base, elf_member_t member) return val; } -void +static void usage(void) { fprintf(stderr, "usage: elfdump -a | -cdeGhinprs [-w file] file\n"); diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index e8b7318..3e897d7 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -51,47 +51,47 @@ __FBSDID("$FreeBSD$"); #define TIMEOUT 120 /* Option flags */ -int A_flag; /* -A: do not follow 302 redirects */ -int a_flag; /* -a: auto retry */ -off_t B_size; /* -B: buffer size */ -int b_flag; /*! -b: workaround TCP bug */ -char *c_dirname; /* -c: remote directory */ -int d_flag; /* -d: direct connection */ -int F_flag; /* -F: restart without checking mtime */ -char *f_filename; /* -f: file to fetch */ -char *h_hostname; /* -h: host to fetch from */ -int i_flag; /* -i: specify input file for mtime comparison */ -char *i_filename; /* name of input file */ -int l_flag; /* -l: link rather than copy file: URLs */ -int m_flag; /* -[Mm]: mirror mode */ -char *N_filename; /* -N: netrc file name */ -int n_flag; /* -n: do not preserve modification time */ -int o_flag; /* -o: specify output file */ -int o_directory; /* output file is a directory */ -char *o_filename; /* name of output file */ -int o_stdout; /* output file is stdout */ -int once_flag; /* -1: stop at first successful file */ -int p_flag; /* -[Pp]: use passive FTP */ -int R_flag; /* -R: don't delete partially transferred files */ -int r_flag; /* -r: restart previously interrupted transfer */ -off_t S_size; /* -S: require size to match */ -int s_flag; /* -s: show size, don't fetch */ -long T_secs; /* -T: transfer timeout in seconds */ -int t_flag; /*! -t: workaround TCP bug */ -int U_flag; /* -U: do not use high ports */ -int v_level = 1; /* -v: verbosity level */ -int v_tty; /* stdout is a tty */ -pid_t pgrp; /* our process group */ -long w_secs; /* -w: retry delay */ -int family = PF_UNSPEC; /* -[46]: address family to use */ - -int sigalrm; /* SIGALRM received */ -int siginfo; /* SIGINFO received */ -int sigint; /* SIGINT received */ - -long ftp_timeout = TIMEOUT; /* default timeout for FTP transfers */ -long http_timeout = TIMEOUT; /* default timeout for HTTP transfers */ -char *buf; /* transfer buffer */ +static int A_flag; /* -A: do not follow 302 redirects */ +static int a_flag; /* -a: auto retry */ +static off_t B_size; /* -B: buffer size */ +static int b_flag; /*! -b: workaround TCP bug */ +static char *c_dirname; /* -c: remote directory */ +static int d_flag; /* -d: direct connection */ +static int F_flag; /* -F: restart without checking mtime */ +static char *f_filename; /* -f: file to fetch */ +static char *h_hostname; /* -h: host to fetch from */ +static int i_flag; /* -i: specify file for mtime comparison */ +static char *i_filename; /* name of input file */ +static int l_flag; /* -l: link rather than copy file: URLs */ +static int m_flag; /* -[Mm]: mirror mode */ +static char *N_filename; /* -N: netrc file name */ +static int n_flag; /* -n: do not preserve modification time */ +static int o_flag; /* -o: specify output file */ +static int o_directory; /* output file is a directory */ +static char *o_filename; /* name of output file */ +static int o_stdout; /* output file is stdout */ +static int once_flag; /* -1: stop at first successful file */ +static int p_flag; /* -[Pp]: use passive FTP */ +static int R_flag; /* -R: don't delete partial files */ +static int r_flag; /* -r: restart previous transfer */ +static off_t S_size; /* -S: require size to match */ +static int s_flag; /* -s: show size, don't fetch */ +static long T_secs; /* -T: transfer timeout in seconds */ +static int t_flag; /*! -t: workaround TCP bug */ +static int U_flag; /* -U: do not use high ports */ +static int v_level = 1; /* -v: verbosity level */ +static int v_tty; /* stdout is a tty */ +static pid_t pgrp; /* our process group */ +static long w_secs; /* -w: retry delay */ +static int family = PF_UNSPEC; /* -[46]: address family to use */ + +static int sigalrm; /* SIGALRM received */ +static int siginfo; /* SIGINFO received */ +static int sigint; /* SIGINT received */ + +static long ftp_timeout = TIMEOUT; /* default timeout for FTP transfers */ +static long http_timeout = TIMEOUT;/* default timeout for HTTP transfers */ +static char *buf; /* transfer buffer */ /* diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c index 7519f15..0a4e952 100644 --- a/usr.bin/finger/finger.c +++ b/usr.bin/finger/finger.c @@ -87,7 +87,8 @@ __FBSDID("$FreeBSD$"); DB *db; time_t now; -int entries, gflag, kflag, lflag, mflag, pplan, sflag, oflag; +static int kflag, mflag, sflag; +int entries, gflag, lflag, pplan, oflag; sa_family_t family = PF_UNSPEC; int d_first = -1; char tbuf[1024]; diff --git a/usr.bin/gencat/gencat.c b/usr.bin/gencat/gencat.c index 40d68fc..031c27a 100644 --- a/usr.bin/gencat/gencat.c +++ b/usr.bin/gencat/gencat.c @@ -96,7 +96,7 @@ struct _setT { LIST_ENTRY(_setT) entries; }; -LIST_HEAD(sethead, _setT) sethead; +static LIST_HEAD(sethead, _setT) sethead; static struct _setT *curSet; static char *curline = NULL; diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 8133f44..43d9334 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -82,14 +82,15 @@ int eflags = REG_STARTEND; bool matchall; /* Searching patterns */ -unsigned int patterns, pattern_sz; +unsigned int patterns; +static unsigned int pattern_sz; struct pat *pattern; regex_t *r_pattern; fastmatch_t *fg_pattern; /* Filename exclusion/inclusion patterns */ -unsigned int fpatterns, fpattern_sz; -unsigned int dpatterns, dpattern_sz; +unsigned int fpatterns, dpatterns; +static unsigned int fpattern_sz, dpattern_sz; struct epat *dpattern, *fpattern; /* For regex errors */ diff --git a/usr.bin/grep/regex/xmalloc.c b/usr.bin/grep/regex/xmalloc.c index b1acc9c..0fc5cd2 100644 --- a/usr.bin/grep/regex/xmalloc.c +++ b/usr.bin/grep/regex/xmalloc.c @@ -39,9 +39,9 @@ typedef struct { } hashTable; static int xmalloc_peak; -int xmalloc_current; +static int xmalloc_current; static int xmalloc_peak_blocks; -int xmalloc_current_blocks; +static int xmalloc_current_blocks; static int xmalloc_fail_after; #define TABLE_BITS 8 diff --git a/usr.bin/gzip/zuncompress.c b/usr.bin/gzip/zuncompress.c index f7f50af..f1b05fd 100644 --- a/usr.bin/gzip/zuncompress.c +++ b/usr.bin/gzip/zuncompress.c @@ -77,10 +77,9 @@ static char_type magic_header[] = static char_type rmask[9] = {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; -/* XXX zuncompress global */ -off_t total_compressed_bytes; -size_t compressed_prelen; -char *compressed_pre; +static off_t total_compressed_bytes; +static size_t compressed_prelen; +static char *compressed_pre; struct s_zstate { FILE *zs_fp; /* File stream for I/O */ diff --git a/usr.bin/msgs/msgs.c b/usr.bin/msgs/msgs.c index 8139b3f..e534fac 100644 --- a/usr.bin/msgs/msgs.c +++ b/usr.bin/msgs/msgs.c @@ -105,47 +105,47 @@ __FBSDID("$FreeBSD$"); typedef char bool; -FILE *msgsrc; -FILE *newmsg; -const char *sep = "-"; -char inbuf[BUFSIZ]; -char fname[MAXPATHLEN]; -char cmdbuf[MAXPATHLEN + MAXPATHLEN]; -char subj[128]; -char from[128]; -char date[128]; -char *ptr; -char *in; -bool local; -bool ruptible; -bool totty; -bool seenfrom; -bool seensubj; -bool blankline; -bool printing = NO; -bool mailing = NO; -bool quitit = NO; -bool sending = NO; -bool intrpflg = NO; -uid_t uid; -int msg; -int prevmsg; -int lct; -int nlines; -int Lpp = 0; -time_t t; -time_t keep; +static FILE *msgsrc; +static FILE *newmsg; +static const char *sep = "-"; +static char inbuf[BUFSIZ]; +static char fname[MAXPATHLEN]; +static char cmdbuf[MAXPATHLEN + MAXPATHLEN]; +static char subj[128]; +static char from[128]; +static char date[128]; +static char *ptr; +static char *in; +static bool local; +static bool ruptible; +static bool totty; +static bool seenfrom; +static bool seensubj; +static bool blankline; +static bool printing = NO; +static bool mailing = NO; +static bool quitit = NO; +static bool sending = NO; +static bool intrpflg = NO; +static uid_t uid; +static int msg; +static int prevmsg; +static int lct; +static int nlines; +static int Lpp = 0; +static time_t t; +static time_t keep; /* option initialization */ -bool hdrs = NO; -bool qopt = NO; -bool hush = NO; -bool send_msg = NO; -bool locomode = NO; -bool use_pager = NO; -bool clean = NO; -bool lastcmd = NO; -jmp_buf tstpbuf; +static bool hdrs = NO; +static bool qopt = NO; +static bool hush = NO; +static bool send_msg = NO; +static bool locomode = NO; +static bool use_pager = NO; +static bool clean = NO; +static bool lastcmd = NO; +static jmp_buf tstpbuf; static void ask(const char *); static void gfrsub(FILE *); @@ -155,7 +155,7 @@ static char *nxtfld(char *); static void onsusp(int); static void onintr(int); static void prmesg(int); -static void usage(void); +static void usage(void); int main(int argc, char *argv[]) diff --git a/usr.bin/ncal/ncal.c b/usr.bin/ncal/ncal.c index 02eb587..48b8c1a 100644 --- a/usr.bin/ncal/ncal.c +++ b/usr.bin/ncal/ncal.c @@ -24,10 +24,8 @@ * SUCH DAMAGE. */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); #include <calendar.h> #include <ctype.h> @@ -111,77 +109,81 @@ static struct djswitch { {"YU", "Yugoslavia", {1919, 3, 4}} }; -struct djswitch *dftswitch = +static struct djswitch *dftswitch = switches + sizeof(switches) / sizeof(struct djswitch) - 2; /* default switch (should be "US") */ /* Table used to print day of month and week numbers */ -char daystr[] = " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15" - " 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31" - " 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47" - " 48 49 50 51 52 53"; +static char daystr[] = " 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15" + " 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31" + " 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47" + " 48 49 50 51 52 53"; /* Table used to print day of year and week numbers */ -char jdaystr[] = " 1 2 3 4 5 6 7 8 9" - " 10 11 12 13 14 15 16 17 18 19" - " 20 21 22 23 24 25 26 27 28 29" - " 30 31 32 33 34 35 36 37 38 39" - " 40 41 42 43 44 45 46 47 48 49" - " 50 51 52 53 54 55 56 57 58 59" - " 60 61 62 63 64 65 66 67 68 69" - " 70 71 72 73 74 75 76 77 78 79" - " 80 81 82 83 84 85 86 87 88 89" - " 90 91 92 93 94 95 96 97 98 99" - " 100 101 102 103 104 105 106 107 108 109" - " 110 111 112 113 114 115 116 117 118 119" - " 120 121 122 123 124 125 126 127 128 129" - " 130 131 132 133 134 135 136 137 138 139" - " 140 141 142 143 144 145 146 147 148 149" - " 150 151 152 153 154 155 156 157 158 159" - " 160 161 162 163 164 165 166 167 168 169" - " 170 171 172 173 174 175 176 177 178 179" - " 180 181 182 183 184 185 186 187 188 189" - " 190 191 192 193 194 195 196 197 198 199" - " 200 201 202 203 204 205 206 207 208 209" - " 210 211 212 213 214 215 216 217 218 219" - " 220 221 222 223 224 225 226 227 228 229" - " 230 231 232 233 234 235 236 237 238 239" - " 240 241 242 243 244 245 246 247 248 249" - " 250 251 252 253 254 255 256 257 258 259" - " 260 261 262 263 264 265 266 267 268 269" - " 270 271 272 273 274 275 276 277 278 279" - " 280 281 282 283 284 285 286 287 288 289" - " 290 291 292 293 294 295 296 297 298 299" - " 300 301 302 303 304 305 306 307 308 309" - " 310 311 312 313 314 315 316 317 318 319" - " 320 321 322 323 324 325 326 327 328 329" - " 330 331 332 333 334 335 336 337 338 339" - " 340 341 342 343 344 345 346 347 348 349" - " 350 351 352 353 354 355 356 357 358 359" - " 360 361 362 363 364 365 366"; - -int flag_nohighlight; /* user doesn't want a highlighted today */ -int flag_weeks; /* user wants number of week */ -int nswitch; /* user defined switch date */ -int nswitchb; /* switch date for backward compatibility */ -int highlightdate; - -char *center(char *s, char *t, int w); -wchar_t *wcenter(wchar_t *s, wchar_t *t, int w); -int firstday(int y, int m); -void highlight(char *dst, char *src, int len, int *extraletters); -void mkmonthr(int year, int month, int jd_flag, struct monthlines * monthl); -void mkmonthb(int year, int month, int jd_flag, struct monthlines * monthl); -void mkweekdays(struct weekdays * wds); -void monthranger(int year, int m, int jd_flag, int before, int after); -void monthrangeb(int year, int m, int jd_flag, int before, int after); -int parsemonth(const char *s, int *m, int *y); -void printcc(void); -void printeaster(int year, int julian, int orthodox); -date *sdater(int ndays, struct date * d); -date *sdateb(int ndays, struct date * d); -int sndaysr(struct date * d); -int sndaysb(struct date * d); +static char jdaystr[] = " 1 2 3 4 5 6 7 8 9" + " 10 11 12 13 14 15 16 17 18 19" + " 20 21 22 23 24 25 26 27 28 29" + " 30 31 32 33 34 35 36 37 38 39" + " 40 41 42 43 44 45 46 47 48 49" + " 50 51 52 53 54 55 56 57 58 59" + " 60 61 62 63 64 65 66 67 68 69" + " 70 71 72 73 74 75 76 77 78 79" + " 80 81 82 83 84 85 86 87 88 89" + " 90 91 92 93 94 95 96 97 98 99" + " 100 101 102 103 104 105 106 107 108 109" + " 110 111 112 113 114 115 116 117 118 119" + " 120 121 122 123 124 125 126 127 128 129" + " 130 131 132 133 134 135 136 137 138 139" + " 140 141 142 143 144 145 146 147 148 149" + " 150 151 152 153 154 155 156 157 158 159" + " 160 161 162 163 164 165 166 167 168 169" + " 170 171 172 173 174 175 176 177 178 179" + " 180 181 182 183 184 185 186 187 188 189" + " 190 191 192 193 194 195 196 197 198 199" + " 200 201 202 203 204 205 206 207 208 209" + " 210 211 212 213 214 215 216 217 218 219" + " 220 221 222 223 224 225 226 227 228 229" + " 230 231 232 233 234 235 236 237 238 239" + " 240 241 242 243 244 245 246 247 248 249" + " 250 251 252 253 254 255 256 257 258 259" + " 260 261 262 263 264 265 266 267 268 269" + " 270 271 272 273 274 275 276 277 278 279" + " 280 281 282 283 284 285 286 287 288 289" + " 290 291 292 293 294 295 296 297 298 299" + " 300 301 302 303 304 305 306 307 308 309" + " 310 311 312 313 314 315 316 317 318 319" + " 320 321 322 323 324 325 326 327 328 329" + " 330 331 332 333 334 335 336 337 338 339" + " 340 341 342 343 344 345 346 347 348 349" + " 350 351 352 353 354 355 356 357 358 359" + " 360 361 362 363 364 365 366"; + +static int flag_nohighlight; /* user doesn't want a highlighted today */ +static int flag_weeks; /* user wants number of week */ +static int nswitch; /* user defined switch date */ +static int nswitchb; /* switch date for backward compatibility */ +static int highlightdate; + +static char *center(char *s, char *t, int w); +static wchar_t *wcenter(wchar_t *s, wchar_t *t, int w); +static int firstday(int y, int m); +static void highlight(char *dst, char *src, int len, int *extraletters); +static void mkmonthr(int year, int month, int jd_flag, + struct monthlines * monthl); +static void mkmonthb(int year, int month, int jd_flag, + struct monthlines * monthl); +static void mkweekdays(struct weekdays * wds); +static void monthranger(int year, int m, int jd_flag, + int before, int after); +static void monthrangeb(int year, int m, int jd_flag, + int before, int after); +static int parsemonth(const char *s, int *m, int *y); +static void printcc(void); +static void printeaster(int year, int julian, int orthodox); +static date *sdater(int ndays, struct date * d); +static date *sdateb(int ndays, struct date * d); +static int sndaysr(struct date * d); +static int sndaysb(struct date * d); static void usage(void); int @@ -513,7 +515,7 @@ usage(void) } /* Print the assumed switches for all countries. */ -void +static void printcc(void) { struct djswitch *p; @@ -534,7 +536,7 @@ printcc(void) } /* Print the date of easter sunday. */ -void +static void printeaster(int y, int julian, int orthodox) { date dt; @@ -579,7 +581,7 @@ printeaster(int y, int julian, int orthodox) #define M2M(m) (1 + (m) % 12) /* Print all months for the period in the range [ before .. y-m .. after ]. */ -void +static void monthrangeb(int y, int m, int jd_flag, int before, int after) { struct monthlines year[12]; @@ -669,7 +671,7 @@ monthrangeb(int y, int m, int jd_flag, int before, int after) } } -void +static void monthranger(int y, int m, int jd_flag, int before, int after) { struct monthlines year[12]; @@ -757,7 +759,7 @@ monthranger(int y, int m, int jd_flag, int before, int after) return; } -void +static void mkmonthr(int y, int m, int jd_flag, struct monthlines *mlines) { @@ -848,7 +850,7 @@ mkmonthr(int y, int m, int jd_flag, struct monthlines *mlines) } } -void +static void mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines) { @@ -945,7 +947,7 @@ mkmonthb(int y, int m, int jd_flag, struct monthlines *mlines) } /* Put the local names of weekdays into the wds. */ -void +static void mkweekdays(struct weekdays *wds) { int i, len, width = 0; @@ -973,7 +975,7 @@ mkweekdays(struct weekdays *wds) * Compute the day number of the first existing date after the first day in * month. (the first day in month and even the month might not exist!) */ -int +static int firstday(int y, int m) { date dt; @@ -997,7 +999,7 @@ firstday(int y, int m) * Compute the number of days from date, obey the local switch from * Julian to Gregorian if specified by the user. */ -int +static int sndaysr(struct date *d) { @@ -1014,7 +1016,7 @@ sndaysr(struct date *d) * Compute the number of days from date, obey the switch from * Julian to Gregorian as used by UK and her colonies. */ -int +static int sndaysb(struct date *d) { @@ -1025,7 +1027,7 @@ sndaysb(struct date *d) } /* Inverse of sndays. */ -struct date * +static struct date * sdater(int nd, struct date *d) { @@ -1036,7 +1038,7 @@ sdater(int nd, struct date *d) } /* Inverse of sndaysb. */ -struct date * +static struct date * sdateb(int nd, struct date *d) { @@ -1047,7 +1049,7 @@ sdateb(int nd, struct date *d) } /* Center string t in string s of length w by putting enough leading blanks. */ -char * +static char * center(char *s, char *t, int w) { char blanks[MAX_WIDTH]; @@ -1058,7 +1060,7 @@ center(char *s, char *t, int w) } /* Center string t in string s of length w by putting enough leading blanks. */ -wchar_t * +static wchar_t * wcenter(wchar_t *s, wchar_t *t, int w) { char blanks[MAX_WIDTH]; @@ -1068,7 +1070,7 @@ wcenter(wchar_t *s, wchar_t *t, int w) return (s); } -int +static int parsemonth(const char *s, int *m, int *y) { int nm, ny; @@ -1101,7 +1103,7 @@ parsemonth(const char *s, int *m, int *y) return (1); } -void +static void highlight(char *dst, char *src, int len, int *extralen) { static int first = 1; diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c index b134679..646630b 100644 --- a/usr.bin/rlogin/rlogin.c +++ b/usr.bin/rlogin/rlogin.c @@ -92,35 +92,35 @@ __FBSDID("$FreeBSD$"); #define SIGUSR1 30 #endif -int eight, rem; -struct termios deftty; +static int eight, rem; +static struct termios deftty; -int family = PF_UNSPEC; +static int family = PF_UNSPEC; -int noescape; -u_char escapechar = '~'; +static int noescape; +static u_char escapechar = '~'; #define get_window_size(fd, wp) ioctl(fd, TIOCGWINSZ, wp) -struct winsize winsize; - -void catch_child(int); -void copytochild(int); -void doit(long) __dead2; -void done(int) __dead2; -void echo(char); -u_int getescape(const char *); -void lostpeer(int); -void mode(int); -void msg(const char *); -void oob(int); -int reader(int); -void sendwindow(void); -void setsignal(int); -void sigwinch(int); -void stop(char); -void usage(void) __dead2; -void writer(void); -void writeroob(int); +static struct winsize winsize; + +static void catch_child(int); +static void copytochild(int); +static _Noreturn void doit(long); +static _Noreturn void done(int); +static void echo(char); +static u_int getescape(const char *); +static void lostpeer(int); +static void mode(int); +static void msg(const char *); +static void oob(int); +static int reader(int); +static void sendwindow(void); +static void setsignal(int); +static void sigwinch(int); +static void stop(char); +static _Noreturn void usage(void); +static void writer(void); +static void writeroob(int); int main(int argc, char *argv[]) @@ -269,9 +269,9 @@ main(int argc, char *argv[]) /*NOTREACHED*/ } -int child; +static int child; -void +static void doit(long omask) { @@ -309,7 +309,7 @@ doit(long omask) } /* trap a signal, unless it is being ignored. */ -void +static void setsignal(int sig) { int omask = sigblock(sigmask(sig)); @@ -319,7 +319,7 @@ setsignal(int sig) (void)sigsetmask(omask); } -void +static void done(int status) { int w, wstatus; @@ -334,14 +334,14 @@ done(int status) exit(status); } -int dosigwinch; +static int dosigwinch; /* * This is called when the reader process gets the out-of-band (urgent) * request to turn on the window-changing protocol. */ /* ARGSUSED */ -void +static void writeroob(int signo __unused) { if (dosigwinch == 0) { @@ -352,7 +352,7 @@ writeroob(int signo __unused) } /* ARGSUSED */ -void +static void catch_child(int signo __unused) { pid_t pid; @@ -375,7 +375,7 @@ catch_child(int signo __unused) * ~^Z suspend rlogin process. * ~<delayed-suspend char> suspend rlogin process, but leave reader alone. */ -void +static void writer(void) { int bol, local, n; @@ -432,7 +432,7 @@ writer(void) } } -void +static void echo(char c) { char *p; @@ -454,7 +454,7 @@ echo(char c) (void)write(STDOUT_FILENO, buf, p - buf); } -void +static void stop(char cmdc) { mode(0); @@ -466,7 +466,7 @@ stop(char cmdc) } /* ARGSUSED */ -void +static void sigwinch(int signo __unused) { struct winsize ws; @@ -481,7 +481,7 @@ sigwinch(int signo __unused) /* * Send the window size to the server via the magic escape */ -void +static void sendwindow(void) { struct winsize ws; @@ -506,13 +506,13 @@ sendwindow(void) #define READING 1 #define WRITING 2 -jmp_buf rcvtop; -int rcvcnt, rcvstate; -pid_t ppid; -char rcvbuf[8 * 1024]; +static jmp_buf rcvtop; +static int rcvcnt, rcvstate; +static pid_t ppid; +static char rcvbuf[8 * 1024]; /* ARGSUSED */ -void +static void oob(int signo __unused) { struct termios tty; @@ -593,7 +593,7 @@ oob(int signo __unused) } /* reader: read from remote: line -> 1 */ -int +static int reader(int omask) { int n, remaining; @@ -636,7 +636,7 @@ reader(int omask) } } -void +static void mode(int f) { struct termios tty; @@ -667,7 +667,7 @@ mode(int f) } /* ARGSUSED */ -void +static void lostpeer(int signo __unused) { (void)signal(SIGPIPE, SIG_IGN); @@ -677,19 +677,19 @@ lostpeer(int signo __unused) /* copy SIGURGs to the child process via SIGUSR1. */ /* ARGSUSED */ -void +static void copytochild(int signo __unused) { (void)kill(child, SIGUSR1); } -void +static void msg(const char *str) { (void)fprintf(stderr, "rlogin: %s\r\n", str); } -void +static void usage(void) { (void)fprintf(stderr, @@ -698,7 +698,7 @@ usage(void) exit(1); } -u_int +static u_int getescape(const char *p) { long val; diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c index a54c3e9..3755f4c 100644 --- a/usr.bin/rpcgen/rpc_main.c +++ b/usr.bin/rpcgen/rpc_main.c @@ -435,7 +435,7 @@ c_initialize(void) } -const char rpcgen_table_dcl[] = "struct rpcgen_table {\n\ +static const char rpcgen_table_dcl[] = "struct rpcgen_table {\n\ char *(*proc)(); \n\ xdrproc_t xdr_arg; \n\ unsigned len_arg; \n\ diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c index 08cf94c..4b951a3 100644 --- a/usr.bin/rpcgen/rpc_svcout.c +++ b/usr.bin/rpcgen/rpc_svcout.c @@ -54,7 +54,7 @@ static char RESULT[] = "result"; static char ROUTINE[] = "local"; static char RETVAL[] = "retval"; -char _errbuf[256]; /* For all messages */ +static char _errbuf[256]; /* For all messages */ void internal_proctype( proc_list * ); static void write_real_program( definition * ); diff --git a/usr.bin/rpcgen/rpc_util.c b/usr.bin/rpcgen/rpc_util.c index 9d1c85b..bf0ca5d 100644 --- a/usr.bin/rpcgen/rpc_util.c +++ b/usr.bin/rpcgen/rpc_util.c @@ -59,8 +59,8 @@ int linenum = 0; /* current line number */ const char *infilename; /* input filename */ #define NFILES 7 -const char *outfiles[NFILES]; /* output file names */ -int nfiles; +static const char *outfiles[NFILES]; /* output file names */ +static int nfiles; FILE *fout; /* file pointer of current output */ FILE *fin; /* file pointer of current input */ diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c index 0668bdf..1f7f947 100644 --- a/usr.bin/sort/sort.c +++ b/usr.bin/sort/sort.c @@ -146,7 +146,7 @@ enum #define NUMBER_OF_MUTUALLY_EXCLUSIVE_FLAGS 6 static const char mutually_exclusive_flags[NUMBER_OF_MUTUALLY_EXCLUSIVE_FLAGS] = { 'M', 'n', 'g', 'R', 'h', 'V' }; -struct option long_options[] = { +static struct option long_options[] = { { "batch-size", required_argument, NULL, BS_OPT }, { "buffer-size", required_argument, NULL, 'S' }, { "check", optional_argument, NULL, 'c' }, diff --git a/usr.bin/stat/stat.c b/usr.bin/stat/stat.c index 31e2bd9..984ec7b 100644 --- a/usr.bin/stat/stat.c +++ b/usr.bin/stat/stat.c @@ -189,8 +189,8 @@ int format1(const struct stat *, /* stat info */ char *xfflagstostr(unsigned long); #endif -const char *timefmt; -int linkfail; +static const char *timefmt; +static int linkfail; #define addchar(s, c, nl) \ do { \ diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c index 669299b..c0f5088 100644 --- a/usr.bin/tftp/main.c +++ b/usr.bin/tftp/main.c @@ -80,7 +80,7 @@ __FBSDID("$FreeBSD$"); typedef struct sockaddr_storage peeraddr; static int connected; static char mode[32]; -jmp_buf toplevel; +static jmp_buf toplevel; volatile int txrx_error; static int peer; @@ -89,7 +89,7 @@ static int margc; static char *margv[MAX_MARGV]; int verbose; -char *port = NULL; +static char *port = NULL; static void get(int, char **); static void help(int, char **); diff --git a/usr.bin/tset/extern.h b/usr.bin/tset/extern.h index 833870e..f4a6514 100644 --- a/usr.bin/tset/extern.h +++ b/usr.bin/tset/extern.h @@ -30,9 +30,12 @@ * $FreeBSD$ */ +#include <termios.h> + extern struct termios mode, oldmode; extern int Columns, isreset, Lines; extern int erasech, intrchar, killch; +extern speed_t Ospeed; void add_mapping(const char *, char *); void cat(char *); diff --git a/usr.bin/tset/map.c b/usr.bin/tset/map.c index 8de594f..715f514 100644 --- a/usr.bin/tset/map.c +++ b/usr.bin/tset/map.c @@ -44,8 +44,7 @@ static const char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/9/93"; #include "extern.h" -extern speed_t Ospeed; -speed_t tset_baudrate(char *); +static speed_t tset_baudrate(char *); /* Baud rate conditionals for mapping. */ #define GT 0x01 @@ -63,7 +62,7 @@ typedef struct map { speed_t speed; /* Baud rate to compare against. */ } MAP; -MAP *cur, *maplist; +static MAP *cur, *maplist; /* * Syntax for -m: @@ -224,7 +223,7 @@ typedef struct speeds { speed_t speed; } SPEEDS; -SPEEDS speeds[] = { +static SPEEDS speeds[] = { { "0", B0 }, { "134.5", B134 }, { "exta", B19200 }, @@ -232,7 +231,7 @@ SPEEDS speeds[] = { { NULL, 0 } }; -speed_t +static speed_t tset_baudrate(char *rate) { SPEEDS *sp; diff --git a/usr.bin/tset/term.c b/usr.bin/tset/term.c index 544e928..106c98f 100644 --- a/usr.bin/tset/term.c +++ b/usr.bin/tset/term.c @@ -46,7 +46,7 @@ static const char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/9/93"; #include <ttyent.h> #include "extern.h" -char tbuf[1024]; /* Termcap entry. */ +static char tbuf[1024]; /* Termcap entry. */ const char *askuser(const char *); char *ttys(char *); |