Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libedit make constant arrays a const
details: https://anonhg.NetBSD.org/src/rev/046ebf61fe9c
branches: trunk
changeset: 501943:046ebf61fe9c
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Tue Jan 09 17:31:04 2001 +0000
description:
make constant arrays a const
diffstat:
lib/libedit/sig.c | 6 +++---
lib/libedit/tty.c | 21 +++++++++++----------
2 files changed, 14 insertions(+), 13 deletions(-)
diffs (111 lines):
diff -r 64ee84cf26f7 -r 046ebf61fe9c lib/libedit/sig.c
--- a/lib/libedit/sig.c Tue Jan 09 17:30:29 2001 +0000
+++ b/lib/libedit/sig.c Tue Jan 09 17:31:04 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sig.c,v 1.7 2001/01/04 15:55:03 christos Exp $ */
+/* $NetBSD: sig.c,v 1.8 2001/01/09 17:31:04 jdolecek Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: sig.c,v 1.7 2001/01/04 15:55:03 christos Exp $");
+__RCSID("$NetBSD: sig.c,v 1.8 2001/01/09 17:31:04 jdolecek Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -56,7 +56,7 @@
private EditLine *sel = NULL;
-private int sighdl[] = {
+private const int sighdl[] = {
#define _DO(a) (a),
ALLSIGS
#undef _DO
diff -r 64ee84cf26f7 -r 046ebf61fe9c lib/libedit/tty.c
--- a/lib/libedit/tty.c Tue Jan 09 17:30:29 2001 +0000
+++ b/lib/libedit/tty.c Tue Jan 09 17:31:04 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tty.c,v 1.13 2000/09/04 22:06:33 lukem Exp $ */
+/* $NetBSD: tty.c,v 1.14 2001/01/09 17:31:04 jdolecek Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: tty.c,v 1.13 2000/09/04 22:06:33 lukem Exp $");
+__RCSID("$NetBSD: tty.c,v 1.14 2001/01/09 17:31:04 jdolecek Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -53,7 +53,7 @@
#include "el.h"
typedef struct ttymodes_t {
- char *m_name;
+ const char *m_name;
u_int m_value;
int m_type;
} ttymodes_t;
@@ -64,7 +64,7 @@
} ttymap_t;
-private ttyperm_t ttyperm = {
+private const ttyperm_t ttyperm = {
{
{"iflag:", ICRNL, (INLCR | IGNCR)},
{"oflag:", (OPOST | ONLCR), ONLRET},
@@ -92,7 +92,7 @@
}
};
-private ttychar_t ttychar = {
+private const ttychar_t ttychar = {
{
CINTR, CQUIT, CERASE, CKILL,
CEOF, CEOL, CEOL2, CSWTCH,
@@ -122,7 +122,7 @@
}
};
-private ttymap_t tty_map[] = {
+private const ttymap_t tty_map[] = {
#ifdef VERASE
{C_ERASE, VERASE,
{ED_DELETE_PREV_CHAR, VI_DELETE_PREV_CHAR, ED_PREV_CHAR}},
@@ -159,7 +159,7 @@
{ED_UNASSIGNED, ED_UNASSIGNED, ED_UNASSIGNED}}
};
-private ttymodes_t ttymodes[] = {
+private const ttymodes_t ttymodes[] = {
#ifdef IGNBRK
{"ignbrk", IGNBRK, MD_INP},
#endif /* IGNBRK */
@@ -764,8 +764,9 @@
unsigned char *t_n = el->el_tty.t_c[ED_IO];
unsigned char *t_o = el->el_tty.t_ed.c_cc;
char new[2], old[2];
- ttymap_t *tp;
- el_action_t *dmap, *dalt, *map, *alt;
+ const ttymap_t *tp;
+ el_action_t *map, *alt;
+ const el_action_t *dmap, *dalt;
new[1] = old[1] = '\0';
map = el->el_map.key;
@@ -1043,7 +1044,7 @@
/*ARGSUSED*/
tty_stty(EditLine *el, int argc, char **argv)
{
- ttymodes_t *m;
+ const ttymodes_t *m;
char x, *d;
int aflag = 0;
char *s;
Home |
Main Index |
Thread Index |
Old Index