Sprinkle static; avoid nested externs.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Edward Tomasz Napierala 2018-02-04 19:05:13 +00:00
parent 1776dc9fd6
commit 9c33cc93cd
3 changed files with 16 additions and 16 deletions

View File

@ -35,6 +35,8 @@
struct delayval;
struct termios;
extern char **environ;
extern char editedhost[];
extern char hostname[];
extern struct termios tmode, omode;
extern struct gettyflags gettyflags[];

View File

@ -93,23 +93,23 @@ struct termios omode;
/* current mode */
struct termios tmode;
int crmod, digit, lower, upper;
static int crmod, digit, lower, upper;
char hostname[MAXHOSTNAMELEN];
char name[MAXLOGNAME*3];
char dev[] = _PATH_DEV;
char ttyn[32];
static char name[MAXLOGNAME*3];
static char dev[] = _PATH_DEV;
static char ttyn[32];
#define OBUFSIZ 128
#define TABBUFSIZ 512
char defent[TABBUFSIZ];
char tabent[TABBUFSIZ];
const char *tname;
static char defent[TABBUFSIZ];
static char tabent[TABBUFSIZ];
static const char *tname;
char *env[128];
static char *env[128];
char partab[] = {
static char partab[] = {
0001,0201,0201,0001,0201,0001,0001,0201,
0202,0004,0003,0205,0005,0206,0201,0001,
0201,0001,0001,0201,0001,0201,0201,0001,
@ -150,7 +150,7 @@ static char *get_line(int);
static void setttymode(int);
static int opentty(const char *, int);
jmp_buf timeout;
static jmp_buf timeout;
static void
dingdong(int signo __unused)
@ -159,7 +159,7 @@ dingdong(int signo __unused)
longjmp(timeout, 1);
}
jmp_buf intrupt;
static jmp_buf intrupt;
static void
interrupt(int signo __unused)
@ -181,7 +181,6 @@ timeoverrun(int signo __unused)
int
main(int argc, char *argv[])
{
extern char **environ;
int first_sleep = 1, first_time = 1;
struct rlimit limit;
int rval;
@ -666,8 +665,8 @@ puts(const char *s)
putchr(*s++);
}
char outbuf[OBUFSIZ];
int obufcnt = 0;
static char outbuf[OBUFSIZ];
static int obufcnt = 0;
static void
putchr(int cc)
@ -733,7 +732,6 @@ get_line(int fd)
static void
putf(const char *cp)
{
extern char editedhost[];
time_t t;
char *slash, db[100];

View File

@ -588,7 +588,7 @@ makeenv(char *env[])
* baud rate. This string indicates the user's actual speed.
* The routine below returns the terminal type mapped from derived speed.
*/
struct portselect {
static struct portselect {
const char *ps_baud;
const char *ps_type;
} portspeeds[] = {