aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2011-01-01 03:43:20 +0000
committerNicholas Marriott <nicm@openbsd.org>2011-01-01 03:43:20 +0000
commitf833b885a17463658d8d5e814a4b3e269c3678c9 (patch)
tree7b78b8dd1c7525d3572651e2f7620c1b9cc47311
parent67ee86085cc8e13222a6d5b4cc67c5f0934f0b3b (diff)
downloadrtmux-f833b885a17463658d8d5e814a4b3e269c3678c9.tar.gz
rtmux-f833b885a17463658d8d5e814a4b3e269c3678c9.tar.bz2
rtmux-f833b885a17463658d8d5e814a4b3e269c3678c9.zip
Last few tables that should be const.
-rw-r--r--input-keys.c12
-rw-r--r--key-string.c2
-rw-r--r--xterm-keys.c14
3 files changed, 14 insertions, 14 deletions
diff --git a/input-keys.c b/input-keys.c
index 81976123..ac759684 100644
--- a/input-keys.c
+++ b/input-keys.c
@@ -40,7 +40,7 @@ struct input_key_ent {
#define INPUTKEY_CURSOR 0x2 /* cursor key */
};
-struct input_key_ent input_keys[] = {
+const struct input_key_ent input_keys[] = {
/* Backspace key. */
{ KEYC_BSPACE, "\177", 0 },
@@ -137,11 +137,11 @@ struct input_key_ent input_keys[] = {
void
input_key(struct window_pane *wp, int key)
{
- struct input_key_ent *ike;
- u_int i;
- size_t dlen;
- char *out;
- u_char ch;
+ const struct input_key_ent *ike;
+ u_int i;
+ size_t dlen;
+ char *out;
+ u_char ch;
log_debug2("writing key 0x%x", key);
diff --git a/key-string.c b/key-string.c
index 20240407..2d768aef 100644
--- a/key-string.c
+++ b/key-string.c
@@ -25,7 +25,7 @@
int key_string_search_table(const char *);
int key_string_get_modifiers(const char **);
-struct {
+const struct {
const char *string;
int key;
} key_string_table[] = {
diff --git a/xterm-keys.c b/xterm-keys.c
index 5f8db986..1e5583f7 100644
--- a/xterm-keys.c
+++ b/xterm-keys.c
@@ -48,7 +48,7 @@ struct xterm_keys_entry {
const char *template;
};
-struct xterm_keys_entry xterm_keys_table[] = {
+const struct xterm_keys_entry xterm_keys_table[] = {
{ KEYC_F1, "\033[1;_P" },
{ KEYC_F1, "\033O_P" },
{ KEYC_F2, "\033[1;_Q" },
@@ -140,8 +140,8 @@ xterm_keys_modifiers(const char *template, const char *buf, size_t len)
int
xterm_keys_find(const char *buf, size_t len, size_t *size, int *key)
{
- struct xterm_keys_entry *entry;
- u_int i;
+ const struct xterm_keys_entry *entry;
+ u_int i;
for (i = 0; i < nitems(xterm_keys_table); i++) {
entry = &xterm_keys_table[i];
@@ -162,10 +162,10 @@ xterm_keys_find(const char *buf, size_t len, size_t *size, int *key)
char *
xterm_keys_lookup(int key)
{
- struct xterm_keys_entry *entry;
- u_int i;
- int modifiers;
- char *out;
+ const struct xterm_keys_entry *entry;
+ u_int i;
+ int modifiers;
+ char *out;
modifiers = 1;
if (key & KEYC_SHIFT)