Commit be7fb97f8a0818dfe7f7582193a80ef27f677615
1 parent
88b4e9db
Make keysym tables const
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5396 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
4 changed files
with
6 additions
and
6 deletions
curses_keys.h
| @@ -37,7 +37,7 @@ | @@ -37,7 +37,7 @@ | ||
| 37 | 37 | ||
| 38 | #define CURSES_KEYS KEY_MAX /* KEY_MAX defined in <curses.h> */ | 38 | #define CURSES_KEYS KEY_MAX /* KEY_MAX defined in <curses.h> */ |
| 39 | 39 | ||
| 40 | -static int curses2keycode[CURSES_KEYS] = { | 40 | +static const int curses2keycode[CURSES_KEYS] = { |
| 41 | [0 ... (CURSES_KEYS - 1)] = -1, | 41 | [0 ... (CURSES_KEYS - 1)] = -1, |
| 42 | 42 | ||
| 43 | [0x01b] = 1, /* Escape */ | 43 | [0x01b] = 1, /* Escape */ |
| @@ -216,7 +216,7 @@ static int curses2keycode[CURSES_KEYS] = { | @@ -216,7 +216,7 @@ static int curses2keycode[CURSES_KEYS] = { | ||
| 216 | 216 | ||
| 217 | }; | 217 | }; |
| 218 | 218 | ||
| 219 | -static int curses2keysym[CURSES_KEYS] = { | 219 | +static const int curses2keysym[CURSES_KEYS] = { |
| 220 | [0 ... (CURSES_KEYS - 1)] = -1, | 220 | [0 ... (CURSES_KEYS - 1)] = -1, |
| 221 | 221 | ||
| 222 | ['\n'] = '\n', | 222 | ['\n'] = '\n', |
| @@ -244,7 +244,7 @@ typedef struct { | @@ -244,7 +244,7 @@ typedef struct { | ||
| 244 | int keysym; | 244 | int keysym; |
| 245 | } name2keysym_t; | 245 | } name2keysym_t; |
| 246 | 246 | ||
| 247 | -static name2keysym_t name2keysym[] = { | 247 | +static const name2keysym_t name2keysym[] = { |
| 248 | /* Plain ASCII */ | 248 | /* Plain ASCII */ |
| 249 | { "space", 0x020 }, | 249 | { "space", 0x020 }, |
| 250 | { "exclam", 0x021 }, | 250 | { "exclam", 0x021 }, |
keymaps.c
| @@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
| 24 | 24 | ||
| 25 | static int get_keysym(const char *name) | 25 | static int get_keysym(const char *name) |
| 26 | { | 26 | { |
| 27 | - name2keysym_t *p; | 27 | + const name2keysym_t *p; |
| 28 | for(p = name2keysym; p->name != NULL; p++) { | 28 | for(p = name2keysym; p->name != NULL; p++) { |
| 29 | if (!strcmp(p->name, name)) | 29 | if (!strcmp(p->name, name)) |
| 30 | return p->keysym; | 30 | return p->keysym; |
sdl_keysym.h
| @@ -2,7 +2,7 @@ typedef struct { | @@ -2,7 +2,7 @@ typedef struct { | ||
| 2 | const char* name; | 2 | const char* name; |
| 3 | int keysym; | 3 | int keysym; |
| 4 | } name2keysym_t; | 4 | } name2keysym_t; |
| 5 | -static name2keysym_t name2keysym[]={ | 5 | +static const name2keysym_t name2keysym[]={ |
| 6 | /* ascii */ | 6 | /* ascii */ |
| 7 | { "space", 0x020}, | 7 | { "space", 0x020}, |
| 8 | { "exclam", 0x021}, | 8 | { "exclam", 0x021}, |
vnc_keysym.h
| @@ -2,7 +2,7 @@ typedef struct { | @@ -2,7 +2,7 @@ typedef struct { | ||
| 2 | const char* name; | 2 | const char* name; |
| 3 | int keysym; | 3 | int keysym; |
| 4 | } name2keysym_t; | 4 | } name2keysym_t; |
| 5 | -static name2keysym_t name2keysym[]={ | 5 | +static const name2keysym_t name2keysym[]={ |
| 6 | /* ascii */ | 6 | /* ascii */ |
| 7 | { "space", 0x020}, | 7 | { "space", 0x020}, |
| 8 | { "exclam", 0x021}, | 8 | { "exclam", 0x021}, |