comparison osdep/getch2.c @ 35854:08c22970003b

Tables should be "static".
author reimar
date Sun, 10 Mar 2013 15:17:44 +0000
parents 3ee9fd074b8c
children 2f68de22fba6
comparison
equal deleted inserted replaced
35853:3ee9fd074b8c 35854:08c22970003b
222 goto found; 222 goto found;
223 } 223 }
224 } 224 }
225 if ((c == '[' || c == 'O') && getch2_len >= 3) { 225 if ((c == '[' || c == 'O') && getch2_len >= 3) {
226 int c = getch2_buf[2]; 226 int c = getch2_buf[2];
227 const unsigned ctable[] = { 227 static const unsigned ctable[] = {
228 KEY_UP, KEY_DOWN, KEY_RIGHT, KEY_LEFT, 0, 228 KEY_UP, KEY_DOWN, KEY_RIGHT, KEY_LEFT, 0,
229 KEY_END, KEY_PGDWN, KEY_HOME, KEY_PGUP, 0, 0, KEY_INS, 0, 0, 0, 229 KEY_END, KEY_PGDWN, KEY_HOME, KEY_PGUP, 0, 0, KEY_INS, 0, 0, 0,
230 KEY_F+1, KEY_F+2, KEY_F+3, KEY_F+4}; 230 KEY_F+1, KEY_F+2, KEY_F+3, KEY_F+4};
231 if (c >= 'A' && c <= 'S') 231 if (c >= 'A' && c <= 'S')
232 if (ctable[c - 'A']) { 232 if (ctable[c - 'A']) {
235 goto found; 235 goto found;
236 } 236 }
237 } 237 }
238 if (getch2_len >= 4 && c == '[' && getch2_buf[3] == '~') { 238 if (getch2_len >= 4 && c == '[' && getch2_buf[3] == '~') {
239 int c = getch2_buf[2]; 239 int c = getch2_buf[2];
240 const int ctable[8] = {KEY_HOME, KEY_INS, KEY_DEL, KEY_END, KEY_PGUP, KEY_PGDWN, KEY_HOME, KEY_END}; 240 static const int ctable[8] = {KEY_HOME, KEY_INS, KEY_DEL, KEY_END, KEY_PGUP, KEY_PGDWN, KEY_HOME, KEY_END};
241 if (c >= '1' && c <= '8') { 241 if (c >= '1' && c <= '8') {
242 code = ctable[c - '1']; 242 code = ctable[c - '1'];
243 len = 4; 243 len = 4;
244 goto found; 244 goto found;
245 } 245 }
246 } 246 }
247 if (getch2_len >= 5 && c == '[' && getch2_buf[4] == '~') { 247 if (getch2_len >= 5 && c == '[' && getch2_buf[4] == '~') {
248 int i = getch2_buf[2] - '0'; 248 int i = getch2_buf[2] - '0';
249 int j = getch2_buf[3] - '0'; 249 int j = getch2_buf[3] - '0';
250 if (i >= 0 && i <= 9 && j >= 0 && j <= 9) { 250 if (i >= 0 && i <= 9 && j >= 0 && j <= 9) {
251 const uint8_t ftable[20] = { 251 static const uint8_t ftable[20] = {
252 11,12,13,14,15, 17,18,19,20,21, 252 11,12,13,14,15, 17,18,19,20,21,
253 23,24,25,26,28, 29,31,32,33,34 }; 253 23,24,25,26,28, 29,31,32,33,34 };
254 int a = i*10 + j; 254 int a = i*10 + j;
255 for (i = 0; i < 20; i++) 255 for (i = 0; i < 20; i++)
256 if (ftable[i] == a) { 256 if (ftable[i] == a) {