diff options
author | ed <ed@FreeBSD.org> | 2012-10-19 14:49:42 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-10-19 14:49:42 +0000 |
commit | af31e8843c2cc0ba388a33f341de8da1b50de433 (patch) | |
tree | ddffe542a2e921ec48c73d322a2046f559a9d74f /usr.bin/chat/chat.c | |
parent | b1462253851ab8c1f6dde48bb7796b15d3f38253 (diff) | |
download | FreeBSD-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.bin/chat/chat.c')
-rw-r--r-- | usr.bin/chat/chat.c | 53 |
1 files changed, 26 insertions, 27 deletions
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) { |