diff options
author | markm <markm@FreeBSD.org> | 2001-12-11 23:29:45 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2001-12-11 23:29:45 +0000 |
commit | 279222ba62c185d7d7ec09017bb3e7760fd333f0 (patch) | |
tree | f93561aa7b038071d9b73c25694be6d55b9b3663 /usr.bin/tset | |
parent | a71a530c96758135360c74dec808c73a5fa1ef8d (diff) | |
download | FreeBSD-src-279222ba62c185d7d7ec09017bb3e7760fd333f0.zip FreeBSD-src-279222ba62c185d7d7ec09017bb3e7760fd333f0.tar.gz |
WARNS=2 fixes, use __FBSDID().
Diffstat (limited to 'usr.bin/tset')
-rw-r--r-- | usr.bin/tset/extern.h | 6 | ||||
-rw-r--r-- | usr.bin/tset/map.c | 33 | ||||
-rw-r--r-- | usr.bin/tset/misc.c | 15 | ||||
-rw-r--r-- | usr.bin/tset/set.c | 16 | ||||
-rw-r--r-- | usr.bin/tset/term.c | 21 | ||||
-rw-r--r-- | usr.bin/tset/tset.c | 29 | ||||
-rw-r--r-- | usr.bin/tset/wrterm.c | 16 |
7 files changed, 74 insertions, 62 deletions
diff --git a/usr.bin/tset/extern.h b/usr.bin/tset/extern.h index 8cce228..b7e1599 100644 --- a/usr.bin/tset/extern.h +++ b/usr.bin/tset/extern.h @@ -40,10 +40,10 @@ extern struct termios mode, oldmode; extern int Columns, isreset, Lines; extern int erasech, intrchar, killch; -void add_mapping __P((char *, char *)); +void add_mapping __P((const char *, char *)); void cat __P((char *)); -char *get_termcap_entry __P((char *, char **)); -char *mapped __P((char *)); +const char *get_termcap_entry __P((char *, char **)); +const char *mapped __P((const char *)); int outc __P((int)); void reset_mode __P((void)); void set_control_chars __P((void)); diff --git a/usr.bin/tset/map.c b/usr.bin/tset/map.c index 4c11a67..e65cbfe 100644 --- a/usr.bin/tset/map.c +++ b/usr.bin/tset/map.c @@ -31,19 +31,21 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> + +__FBSDID("$FreeBSD$"); + #ifndef lint -#if 0 -static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/9/93"; +static const char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/9/93"; #endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ #include <sys/types.h> + #include <err.h> #include <stdlib.h> #include <string.h> #include <termios.h> + #include "extern.h" extern speed_t Ospeed; @@ -74,7 +76,8 @@ MAP *cur, *maplist; */ void add_mapping(port, arg) - char *port, *arg; + const char *port; + char *arg; { MAP *mapp; char *copy, *p, *termp; @@ -159,7 +162,7 @@ next: if (*arg == ':') { done: if (port) { if (mapp->porttype) badmopt: errx(1, "illegal -m option format: %s", copy); - mapp->porttype = port; + mapp->porttype = strdup(port); } #ifdef MAPDEBUG @@ -186,9 +189,9 @@ badmopt: errx(1, "illegal -m option format: %s", copy); * by the first applicable mapping in 'map'. If no mappings apply, return * 'type'. */ -char * +const char * mapped(type) - char *type; + const char *type; { MAP *mapp; int match; @@ -223,16 +226,16 @@ mapped(type) } typedef struct speeds { - char *string; + const char *string; speed_t speed; } SPEEDS; SPEEDS speeds[] = { - "0", B0, - "134.5", B134, - "exta", B19200, - "extb", B38400, - NULL + { "0", B0 }, + { "134.5", B134 }, + { "exta", B19200 }, + { "extb", B38400 }, + { NULL, 0 } }; speed_t diff --git a/usr.bin/tset/misc.c b/usr.bin/tset/misc.c index 4d8d705..52358e7 100644 --- a/usr.bin/tset/misc.c +++ b/usr.bin/tset/misc.c @@ -31,20 +31,21 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> + +__FBSDID("$FreeBSD$"); + #ifndef lint -#if 0 -static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/9/93"; +static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/9/93"; #endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ -#include <fcntl.h> #include <err.h> -#include <unistd.h> +#include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> + #include "extern.h" void diff --git a/usr.bin/tset/set.c b/usr.bin/tset/set.c index 515a87d..88d27c3 100644 --- a/usr.bin/tset/set.c +++ b/usr.bin/tset/set.c @@ -31,17 +31,18 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> + +__FBSDID("$FreeBSD$"); + #ifndef lint -#if 0 -static char sccsid[] = "@(#)set.c 8.2 (Berkeley) 2/28/94"; +static const char sccsid[] = "@(#)set.c 8.2 (Berkeley) 2/28/94"; #endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ +#include <stdio.h> #include <termios.h> #include <unistd.h> -#include <stdio.h> + #include "extern.h" #define CHK(val, dft) (val <= 0 ? dft : val) @@ -285,8 +286,9 @@ set_tabs() { int c; char *capsp, *clear_tabs; - char *set_column, *set_pos, *Set_tab, *tg_out; + char *set_column, *set_pos, *Set_tab; char caps[1024]; + const char *tg_out; capsp = caps; Set_tab = tgetstr("st", &capsp); diff --git a/usr.bin/tset/term.c b/usr.bin/tset/term.c index 857f9b1..79f8b5a 100644 --- a/usr.bin/tset/term.c +++ b/usr.bin/tset/term.c @@ -31,13 +31,13 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> + +__FBSDID("$FreeBSD$"); + #ifndef lint -#if 0 -static char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/9/93"; +static const char sccsid[] = "@(#)term.c 8.1 (Berkeley) 6/9/93"; #endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ #include <sys/types.h> #include <err.h> @@ -51,20 +51,21 @@ static const char rcsid[] = char tbuf[1024]; /* Termcap entry. */ -char *askuser __P((char *)); +const char *askuser __P((const char *)); char *ttys __P((char *)); /* * Figure out what kind of terminal we're dealing with, and then read in * its termcap entry. */ -char * +const char * get_termcap_entry(userarg, tcapbufp) char *userarg, **tcapbufp; { struct ttyent *t; int rval; - char *p, *ttype, *ttypath; + char *p, *ttypath; + const char *ttype; if (userarg) { ttype = userarg; @@ -123,9 +124,9 @@ found: if ((p = getenv("TERMCAP")) != NULL && *p != '/') } /* Prompt the user for a terminal type. */ -char * +const char * askuser(dflt) - char *dflt; + const char *dflt; { static char answer[256]; char *p; diff --git a/usr.bin/tset/tset.c b/usr.bin/tset/tset.c index ca299ab..40953c3 100644 --- a/usr.bin/tset/tset.c +++ b/usr.bin/tset/tset.c @@ -31,33 +31,35 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> + +__FBSDID("$FreeBSD$"); + #ifndef lint static const char copyright[] = "@(#) Copyright (c) 1980, 1991, 1993\n\ The Regents of the University of California. All rights reserved.\n"; -#endif /* not lint */ +#endif #ifndef lint -#if 0 -static char sccsid[] = "@(#)tset.c 8.1 (Berkeley) 6/9/93"; +static const char sccsid[] = "@(#)tset.c 8.1 (Berkeley) 6/9/93"; #endif -static const char rcdif[] = - "$FreeBSD$"; -#endif /* not lint */ #include <sys/types.h> #include <sys/ioctl.h> + #include <ctype.h> #include <err.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <unistd.h> #include <termios.h> +#include <unistd.h> + #include "extern.h" void obsolete __P((char *[])); -void report __P((char *, int, u_int)); +void report __P((const char *, int, u_int)); void usage __P((void)); struct termios mode, oldmode; @@ -78,7 +80,8 @@ main(argc, argv) struct winsize win; #endif int ch, noinit, noset, quiet, Sflag, sflag, showterm, usingupper; - char *p, *tcapbuf, *ttype; + char *p, *tcapbuf; + const char *ttype; if (tcgetattr(STDERR_FILENO, &mode) < 0) err(1, "standard error"); @@ -240,7 +243,7 @@ main(argc, argv) */ void report(name, which, def) - char *name; + const char *name; int which; u_int def; { @@ -280,13 +283,13 @@ obsolete(argv) continue; switch(argv[0][1]) { case 'e': - argv[0] = "-e^H"; + argv[0] = strdup("-e^H"); break; case 'i': - argv[0] = "-i^C"; + argv[0] = strdup("-i^C"); break; case 'k': - argv[0] = "-k^U"; + argv[0] = strdup("-k^U"); break; } } diff --git a/usr.bin/tset/wrterm.c b/usr.bin/tset/wrterm.c index 8c59368..9d14918 100644 --- a/usr.bin/tset/wrterm.c +++ b/usr.bin/tset/wrterm.c @@ -31,19 +31,21 @@ * SUCH DAMAGE. */ +#include <sys/cdefs.h> + +__FBSDID("$FreeBSD$"); + #ifndef lint -#if 0 -static char sccsid[] = "@(#)wrterm.c 8.1 (Berkeley) 6/9/93"; +static const char sccsid[] = "@(#)wrterm.c 8.1 (Berkeley) 6/9/93"; #endif -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ #include <sys/types.h> + #include <ctype.h> #include <err.h> #include <stdio.h> #include <string.h> + #include "extern.h" /* @@ -64,11 +66,11 @@ wrtermcap(bp) *t++ = '\0'; /* Output terminal names that don't have whitespace. */ - sep = ""; + sep = strdup(""); while ((p = strsep(&bp, "|")) != NULL) if (*p != '\0' && strpbrk(p, " \t") == NULL) { (void)printf("%s%s", sep, p); - sep = "|"; + sep = strdup("|"); } (void)putchar(':'); |