summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-22 09:15:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-22 09:15:20 +0000
commitdcbd4928bd97b1e9011c207e5cab1da61b369a5d (patch)
tree794a8cd1d2552da5702d2a59163eec022e64e96c /bin
parent03d1fd68d142937c86932285aff35cf6c3c17617 (diff)
const
Diffstat (limited to 'bin')
-rw-r--r--bin/stty/cchar.c9
-rw-r--r--bin/stty/extern.h4
-rw-r--r--bin/stty/gfmt.c8
-rw-r--r--bin/stty/modes.c18
-rw-r--r--bin/stty/print.c10
-rw-r--r--bin/stty/stty.h4
6 files changed, 26 insertions, 27 deletions
diff --git a/bin/stty/cchar.c b/bin/stty/cchar.c
index cd814a7873c..650d1caf0a2 100644
--- a/bin/stty/cchar.c
+++ b/bin/stty/cchar.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cchar.c,v 1.9 1995/03/21 09:11:15 cgd Exp $ */
+/* $NetBSD: cchar.c,v 1.10 1996/05/07 18:20:05 jtc Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)cchar.c 8.5 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$NetBSD: cchar.c,v 1.9 1995/03/21 09:11:15 cgd Exp $";
+static char rcsid[] = "$NetBSD: cchar.c,v 1.10 1996/05/07 18:20:05 jtc Exp $";
#endif
#endif /* not lint */
@@ -59,7 +59,7 @@ static char rcsid[] = "$NetBSD: cchar.c,v 1.9 1995/03/21 09:11:15 cgd Exp $";
* The first are displayed, but both are recognized on the
* command line.
*/
-struct cchar cchars1[] = {
+const struct cchar cchars1[] = {
{ "discard", VDISCARD, CDISCARD },
{ "dsusp", VDSUSP, CDSUSP },
{ "eof", VEOF, CEOF },
@@ -81,7 +81,7 @@ struct cchar cchars1[] = {
{ NULL },
};
-struct cchar cchars2[] = {
+const struct cchar cchars2[] = {
{ "brk", VEOL, CEOL },
{ "flush", VDISCARD, CDISCARD },
{ "rprnt", VREPRINT, CREPRINT },
@@ -92,7 +92,6 @@ static int
c_cchar(a, b)
const void *a, *b;
{
-
return (strcmp(((struct cchar *)a)->name, ((struct cchar *)b)->name));
}
diff --git a/bin/stty/extern.h b/bin/stty/extern.h
index 32c4b443559..064cb5e0677 100644
--- a/bin/stty/extern.h
+++ b/bin/stty/extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.7 1995/03/21 09:11:16 cgd Exp $ */
+/* $NetBSD: extern.h,v 1.8 1996/05/07 18:20:06 jtc Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -47,4 +47,4 @@ void optlist __P((void));
void print __P((struct termios *, struct winsize *, int, enum FMT));
void usage __P((void));
-extern struct cchar cchars1[], cchars2[];
+extern const struct cchar cchars1[], cchars2[];
diff --git a/bin/stty/gfmt.c b/bin/stty/gfmt.c
index 4822bd452c5..4f866b0d2b5 100644
--- a/bin/stty/gfmt.c
+++ b/bin/stty/gfmt.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gfmt.c,v 1.9 1995/03/21 09:11:19 cgd Exp $ */
+/* $NetBSD: gfmt.c,v 1.10 1996/05/07 18:20:08 jtc Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)gfmt.c 8.6 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$NetBSD: gfmt.c,v 1.9 1995/03/21 09:11:19 cgd Exp $";
+static char rcsid[] = "$NetBSD: gfmt.c,v 1.10 1996/05/07 18:20:08 jtc Exp $";
#endif
#endif /* not lint */
@@ -66,7 +66,7 @@ gprint(tp, wp, ldisc)
struct winsize *wp;
int ldisc;
{
- struct cchar *cp;
+ const struct cchar *cp;
(void)printf("gfmt1:cflag=%x:iflag=%x:lflag=%x:oflag=%x:",
tp->c_cflag, tp->c_iflag, tp->c_lflag, tp->c_oflag);
@@ -80,7 +80,7 @@ gread(tp, s)
struct termios *tp;
char *s;
{
- struct cchar *cp;
+ const struct cchar *cp;
char *ep, *p;
long tmp;
diff --git a/bin/stty/modes.c b/bin/stty/modes.c
index 5b8c93fae72..18acbccc93a 100644
--- a/bin/stty/modes.c
+++ b/bin/stty/modes.c
@@ -1,4 +1,4 @@
-/* $NetBSD: modes.c,v 1.8 1995/03/21 09:11:23 cgd Exp $ */
+/* $NetBSD: modes.c,v 1.9 1996/05/07 18:20:09 jtc Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)modes.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$NetBSD: modes.c,v 1.8 1995/03/21 09:11:23 cgd Exp $";
+static char rcsid[] = "$NetBSD: modes.c,v 1.9 1996/05/07 18:20:09 jtc Exp $";
#endif
#endif /* not lint */
@@ -47,7 +47,7 @@ static char rcsid[] = "$NetBSD: modes.c,v 1.8 1995/03/21 09:11:23 cgd Exp $";
#include "stty.h"
struct modes {
- char *name;
+ const char *name;
long set;
long unset;
};
@@ -56,7 +56,7 @@ struct modes {
* The code in optlist() depends on minus options following regular
* options, i.e. "foo" must immediately precede "-foo".
*/
-struct modes cmodes[] = {
+const struct modes cmodes[] = {
{ "cs5", CS5, CSIZE },
{ "cs6", CS6, CSIZE },
{ "cs7", CS7, CSIZE },
@@ -90,7 +90,7 @@ struct modes cmodes[] = {
{ NULL },
};
-struct modes imodes[] = {
+const struct modes imodes[] = {
{ "ignbrk", IGNBRK, 0 },
{ "-ignbrk", 0, IGNBRK },
{ "brkint", BRKINT, 0 },
@@ -126,7 +126,7 @@ struct modes imodes[] = {
{ NULL },
};
-struct modes lmodes[] = {
+const struct modes lmodes[] = {
{ "echo", ECHO, 0 },
{ "-echo", 0, ECHO },
{ "echoe", ECHOE, 0 },
@@ -178,7 +178,7 @@ struct modes lmodes[] = {
{ NULL },
};
-struct modes omodes[] = {
+const struct modes omodes[] = {
{ "opost", OPOST, 0 },
{ "-opost", 0, OPOST },
{ "litout", 0, OPOST },
@@ -192,14 +192,14 @@ struct modes omodes[] = {
{ NULL },
};
-#define CHK(s) (*name == s[0] && !strcmp(name, s))
+#define CHK(s) (!strcmp(name, s))
int
msearch(argvp, ip)
char ***argvp;
struct info *ip;
{
- struct modes *mp;
+ const struct modes *mp;
char *name;
name = **argvp;
diff --git a/bin/stty/print.c b/bin/stty/print.c
index 9888e77dc6a..524a709cea9 100644
--- a/bin/stty/print.c
+++ b/bin/stty/print.c
@@ -1,4 +1,4 @@
-/* $NetBSD: print.c,v 1.10 1995/03/21 09:11:24 cgd Exp $ */
+/* $NetBSD: print.c,v 1.11 1996/05/07 18:20:10 jtc Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
-static char rcsid[] = "$NetBSD: print.c,v 1.10 1995/03/21 09:11:24 cgd Exp $";
+static char rcsid[] = "$NetBSD: print.c,v 1.11 1996/05/07 18:20:10 jtc Exp $";
#endif
#endif /* not lint */
@@ -52,7 +52,7 @@ static char rcsid[] = "$NetBSD: print.c,v 1.10 1995/03/21 09:11:24 cgd Exp $";
static void binit __P((char *));
static void bput __P((char *));
-static char *ccval __P((struct cchar *, int));
+static char *ccval __P((const struct cchar *, int));
void
print(tp, wp, ldisc, fmt)
@@ -61,7 +61,7 @@ print(tp, wp, ldisc, fmt)
int ldisc;
enum FMT fmt;
{
- struct cchar *p;
+ const struct cchar *p;
long tmp;
u_char *cc;
int cnt, ispeed, ospeed;
@@ -241,7 +241,7 @@ bput(s)
static char *
ccval(p, c)
- struct cchar *p;
+ const struct cchar *p;
int c;
{
static char buf[5];
diff --git a/bin/stty/stty.h b/bin/stty/stty.h
index 56e8a05e64e..a72d7503a71 100644
--- a/bin/stty/stty.h
+++ b/bin/stty/stty.h
@@ -1,4 +1,4 @@
-/* $NetBSD: stty.h,v 1.6 1995/03/21 09:11:31 cgd Exp $ */
+/* $NetBSD: stty.h,v 1.7 1996/05/07 18:20:11 jtc Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -50,7 +50,7 @@ struct info {
};
struct cchar {
- char *name;
+ const char *name;
int sub;
u_char def;
};