diff options
| author | David Walter Seikel | 2014-01-31 14:32:51 +1000 |
|---|---|---|
| committer | David Walter Seikel | 2014-01-31 14:32:51 +1000 |
| commit | 6e61d0b2736fb22d3d573244d6cab49a3db817d8 (patch) | |
| tree | 0f6d0129129d3e87741bb93215186d8506e0e460 | |
| parent | Stop using null terminated array. (diff) | |
| download | boxes-6e61d0b2736fb22d3d573244d6cab49a3db817d8.zip boxes-6e61d0b2736fb22d3d573244d6cab49a3db817d8.tar.gz boxes-6e61d0b2736fb22d3d573244d6cab49a3db817d8.tar.bz2 boxes-6e61d0b2736fb22d3d573244d6cab49a3db817d8.tar.xz | |
Move CSI variable declarations to where they are used.
| -rw-r--r-- | handlekeys.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/handlekeys.c b/handlekeys.c index 205f94a..4ce14f5 100644 --- a/handlekeys.c +++ b/handlekeys.c | |||
| @@ -331,22 +331,24 @@ void handle_keys(long extra, int (*handle_sequence)(long extra, char *sequence), | |||
| 331 | TODO So abort the current CSI and start from scratch. | 331 | TODO So abort the current CSI and start from scratch. |
| 332 | */ | 332 | */ |
| 333 | 333 | ||
| 334 | char *t, csFinal[8]; | ||
| 335 | int csIndex = 1, csParams[8]; | ||
| 336 | |||
| 337 | csFinal[0] = 0; | ||
| 338 | p = 0; | ||
| 339 | // Unspecified params default to a value that is command dependant. | ||
| 340 | // However, they will never be negative, so we can use -1 to flag a default value. | ||
| 341 | for (j = 0; j < (sizeof(csParams) / sizeof(*csParams)); j++) | ||
| 342 | csParams[j] = -1; | ||
| 343 | |||
| 344 | if ('M' == buffer[1]) | 334 | if ('M' == buffer[1]) |
| 345 | { | 335 | { |
| 346 | // TODO - We have a mouse report, which is CSI M ..., where the rest is binary encoded, more or less. Not fitting into the CSI format. | 336 | // TODO - We have a mouse report, which is CSI M ..., where the rest is binary encoded, more or less. Not fitting into the CSI format. |
| 347 | } | 337 | } |
| 348 | else | 338 | else |
| 349 | { | 339 | { |
| 340 | char *t, csFinal[8]; | ||
| 341 | int csIndex = 1, csParams[8]; | ||
| 342 | |||
| 343 | csFinal[0] = 0; | ||
| 344 | p = 0; | ||
| 345 | |||
| 346 | // Unspecified params default to a value that is command dependant. | ||
| 347 | // However, they will never be negative, so we can use -1 to flag | ||
| 348 | // a default value. | ||
| 349 | for (j = 0; j < (sizeof(csParams) / sizeof(*csParams)); j++) | ||
| 350 | csParams[j] = -1; | ||
| 351 | |||
| 350 | // Check for the private bit. | 352 | // Check for the private bit. |
| 351 | if (index("<=>?", buffer[1])) | 353 | if (index("<=>?", buffer[1])) |
| 352 | { | 354 | { |
