WARNS=2 fixes, use __FBSDID().
This commit is contained in:
parent
7e52b238c7
commit
defd4957cc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87701
@ -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));
|
||||
|
@ -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
|
||||
|
@ -31,20 +31,21 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/9/93";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/9/93";
|
||||
#endif
|
||||
|
||||
#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
|
||||
|
@ -31,17 +31,18 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)set.c 8.2 (Berkeley) 2/28/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$FreeBSD$";
|
||||
#endif /* not lint */
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "@(#)set.c 8.2 (Berkeley) 2/28/94";
|
||||
#endif
|
||||
|
||||
#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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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(':');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user