aboutsummaryrefslogtreecommitdiff
path: root/termkey.c
diff options
context:
space:
mode:
authorPaul LeoNerd Evans <leonerd@leonerd.org.uk>2013-07-15 01:03:35 +0100
committerPaul LeoNerd Evans <leonerd@leonerd.org.uk>2013-07-15 01:03:35 +0100
commit89ac8b058cb7bb8f7bc47a4a42fa5642abc84dae (patch)
treefc5c8e50b8dde9ec35a87c148e8f06bcc9cad7eb /termkey.c
parentb4067d8afb3f6d24b341eca46bb031f56011ab05 (diff)
downloadtermo-89ac8b058cb7bb8f7bc47a4a42fa5642abc84dae.tar.gz
termo-89ac8b058cb7bb8f7bc47a4a42fa5642abc84dae.tar.xz
termo-89ac8b058cb7bb8f7bc47a4a42fa5642abc84dae.zip
Make some more things 'const' that should be
Diffstat (limited to 'termkey.c')
-rw-r--r--termkey.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/termkey.c b/termkey.c
index 1ed92fc..5813b9e 100644
--- a/termkey.c
+++ b/termkey.c
@@ -1113,7 +1113,7 @@ const char *termkey_get_keyname(TermKey *tk, TermKeySym sym)
return "UNKNOWN";
}
-char *termkey_lookup_keyname(TermKey *tk, const char *str, TermKeySym *sym)
+const char *termkey_lookup_keyname(TermKey *tk, const char *str, TermKeySym *sym)
{
/* We store an array, so we can't do better than a linear search. Doesn't
* matter because user won't be calling this too often */
@@ -1133,7 +1133,7 @@ char *termkey_lookup_keyname(TermKey *tk, const char *str, TermKeySym *sym)
TermKeySym termkey_keyname2sym(TermKey *tk, const char *keyname)
{
TermKeySym sym;
- char *endp = termkey_lookup_keyname(tk, keyname, &sym);
+ const char *endp = termkey_lookup_keyname(tk, keyname, &sym);
if(!endp || endp[0])
return TERMKEY_SYM_UNKNOWN;
return sym;
@@ -1255,7 +1255,7 @@ size_t termkey_strfkey(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, T
int line, col;
termkey_interpret_mouse(tk, key, &ev, &button, &line, &col);
- static char *evnames[] = { "Unknown", "Press", "Drag", "Release" };
+ static const char *evnames[] = { "Unknown", "Press", "Drag", "Release" };
l = snprintf(buffer + pos, len - pos, "Mouse%s(%d)",
evnames[ev], button);
@@ -1297,7 +1297,7 @@ size_t termkey_strfkey(TermKey *tk, char *buffer, size_t len, TermKeyKey *key, T
return pos;
}
-char *termkey_strpkey(TermKey *tk, const char *str, TermKeyKey *key, TermKeyFormat format)
+const char *termkey_strpkey(TermKey *tk, const char *str, TermKeyKey *key, TermKeyFormat format)
{
struct modnames *mods = &modnames[!!(format & TERMKEY_FORMAT_LONGMOD) +
!!(format & TERMKEY_FORMAT_ALTISMETA) * 2];
@@ -1340,7 +1340,7 @@ char *termkey_strpkey(TermKey *tk, const char *str, TermKeyKey *key, TermKeyForm
size_t nbytes;
ssize_t snbytes;
- char *endstr;
+ const char *endstr;
if((endstr = termkey_lookup_keyname(tk, str, &key->code.sym))) {
key->type = TERMKEY_TYPE_KEYSYM;
@@ -1351,7 +1351,7 @@ char *termkey_strpkey(TermKey *tk, const char *str, TermKeyKey *key, TermKeyForm
str += snbytes;
}
// Unicode must be last
- else if(parse_utf8((unsigned char *)str, strlen(str), &key->code.codepoint, &nbytes) == TERMKEY_RES_KEY) {
+ else if(parse_utf8((unsigned const char *)str, strlen(str), &key->code.codepoint, &nbytes) == TERMKEY_RES_KEY) {
key->type = TERMKEY_TYPE_UNICODE;
fill_utf8(key);
str += nbytes;