提交 be7fb97f 编写于 作者: B blueswir1

Make keysym tables const

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5396 c046a42c-6fe2-441c-8c8c-71466251a162
上级 88b4e9db
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#define CURSES_KEYS KEY_MAX /* KEY_MAX defined in <curses.h> */ #define CURSES_KEYS KEY_MAX /* KEY_MAX defined in <curses.h> */
static int curses2keycode[CURSES_KEYS] = { static const int curses2keycode[CURSES_KEYS] = {
[0 ... (CURSES_KEYS - 1)] = -1, [0 ... (CURSES_KEYS - 1)] = -1,
[0x01b] = 1, /* Escape */ [0x01b] = 1, /* Escape */
...@@ -216,7 +216,7 @@ static int curses2keycode[CURSES_KEYS] = { ...@@ -216,7 +216,7 @@ static int curses2keycode[CURSES_KEYS] = {
}; };
static int curses2keysym[CURSES_KEYS] = { static const int curses2keysym[CURSES_KEYS] = {
[0 ... (CURSES_KEYS - 1)] = -1, [0 ... (CURSES_KEYS - 1)] = -1,
['\n'] = '\n', ['\n'] = '\n',
...@@ -244,7 +244,7 @@ typedef struct { ...@@ -244,7 +244,7 @@ typedef struct {
int keysym; int keysym;
} name2keysym_t; } name2keysym_t;
static name2keysym_t name2keysym[] = { static const name2keysym_t name2keysym[] = {
/* Plain ASCII */ /* Plain ASCII */
{ "space", 0x020 }, { "space", 0x020 },
{ "exclam", 0x021 }, { "exclam", 0x021 },
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
static int get_keysym(const char *name) static int get_keysym(const char *name)
{ {
name2keysym_t *p; const name2keysym_t *p;
for(p = name2keysym; p->name != NULL; p++) { for(p = name2keysym; p->name != NULL; p++) {
if (!strcmp(p->name, name)) if (!strcmp(p->name, name))
return p->keysym; return p->keysym;
......
...@@ -2,7 +2,7 @@ typedef struct { ...@@ -2,7 +2,7 @@ typedef struct {
const char* name; const char* name;
int keysym; int keysym;
} name2keysym_t; } name2keysym_t;
static name2keysym_t name2keysym[]={ static const name2keysym_t name2keysym[]={
/* ascii */ /* ascii */
{ "space", 0x020}, { "space", 0x020},
{ "exclam", 0x021}, { "exclam", 0x021},
......
...@@ -2,7 +2,7 @@ typedef struct { ...@@ -2,7 +2,7 @@ typedef struct {
const char* name; const char* name;
int keysym; int keysym;
} name2keysym_t; } name2keysym_t;
static name2keysym_t name2keysym[]={ static const name2keysym_t name2keysym[]={
/* ascii */ /* ascii */
{ "space", 0x020}, { "space", 0x020},
{ "exclam", 0x021}, { "exclam", 0x021},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册