Use const qualifier as appropriate
This commit is contained in:
parent
159c1ab1cd
commit
4f6f2f00e0
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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[];
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue