summaryrefslogtreecommitdiffstats
path: root/usr.bin/tset/map.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2001-12-11 23:29:45 +0000
committermarkm <markm@FreeBSD.org>2001-12-11 23:29:45 +0000
commit279222ba62c185d7d7ec09017bb3e7760fd333f0 (patch)
treef93561aa7b038071d9b73c25694be6d55b9b3663 /usr.bin/tset/map.c
parenta71a530c96758135360c74dec808c73a5fa1ef8d (diff)
downloadFreeBSD-src-279222ba62c185d7d7ec09017bb3e7760fd333f0.zip
FreeBSD-src-279222ba62c185d7d7ec09017bb3e7760fd333f0.tar.gz
WARNS=2 fixes, use __FBSDID().
Diffstat (limited to 'usr.bin/tset/map.c')
-rw-r--r--usr.bin/tset/map.c33
1 files changed, 18 insertions, 15 deletions
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
OpenPOWER on IntegriCloud