Commit 4ae83d01 authored by Bob Pendleton's avatar Bob Pendleton

More typos

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402706
parent 40dcc0ab
...@@ -51,7 +51,7 @@ static SDLKey *keyCodeToSDLKeyTables[] = { ...@@ -51,7 +51,7 @@ static SDLKey *keyCodeToSDLKeyTables[] = {
hardware. hardware.
*/ */
#define KeyCodeTableSize (258) #define KeyCodeTableSize (256)
static SDLKey macKeyCodeToSDLK[KeyCodeTableSize] = static SDLKey macKeyCodeToSDLK[KeyCodeTableSize] =
{ {
/* 0 */ SDLK_UNKNOWN, /* 0 */ SDLK_UNKNOWN,
...@@ -904,12 +904,12 @@ X11_InitKeyboard(_THIS) ...@@ -904,12 +904,12 @@ X11_InitKeyboard(_THIS)
"The key codes of your X server are unknown to SDL. Keys may not be recognized properly. To help get this fixed, report this to the SDL mailing list <sdl@libsdl.org> or to Christian Walther <cwalther@gmx.ch>.\n"); "The key codes of your X server are unknown to SDL. Keys may not be recognized properly. To help get this fixed, report this to the SDL mailing list <sdl@libsdl.org> or to Christian Walther <cwalther@gmx.ch>.\n");
#endif #endif
data->keyCodeToSDLKTable = data->keyCodeToSDLKTable =
SDL_malloc(SDL_arraysize(xorgLinuxKeyCodeToSDLK)); SDL_malloc(KeyCodeTableSize * sizeof(SDLKey));
if (data->keyCodeToSDLKTable == NULL) { if (data->keyCodeToSDLKTable == NULL) {
SDL_OutOfMemory(); SDL_OutOfMemory();
return -1; return -1;
} }
for (code = SDL_arraysize(xorgLinuxKeyCodeToSDLK); code >= 0; code--) { for (code = KeyCodeTableSize; code >= 0; code--) {
data->keyCodeToSDLKTable[code] = data->keyCodeToSDLKTable[code] =
X11_KeySymToSDLKey(XKeycodeToKeysym(data->display, code, 0), X11_KeySymToSDLKey(XKeycodeToKeysym(data->display, code, 0),
SDL_TRUE); SDL_TRUE);
...@@ -918,7 +918,7 @@ X11_InitKeyboard(_THIS) ...@@ -918,7 +918,7 @@ X11_InitKeyboard(_THIS)
/* Set some non-default key names */ /* Set some non-default key names */
for (code = 0; code < SDL_arraysize(xorgLinuxKeyCodeToSDLK); code++) { for (code = 0; code < KeyCodeTableSize; code++) {
sdlkey = data->keyCodeToSDLKTable[code]; sdlkey = data->keyCodeToSDLKTable[code];
switch (sdlkey) { switch (sdlkey) {
/* The SDLK_*META keys are used as XK_Meta_* by some X /* The SDLK_*META keys are used as XK_Meta_* by some X
...@@ -986,12 +986,12 @@ X11_GetLayoutKey(_THIS, SDLKey physicalKey) ...@@ -986,12 +986,12 @@ X11_GetLayoutKey(_THIS, SDLKey physicalKey)
/* Look up physicalKey to get an X11 KeyCode - linear search isn't /* Look up physicalKey to get an X11 KeyCode - linear search isn't
terribly efficient, this might have to be optimized. */ terribly efficient, this might have to be optimized. */
while ((code < SDL_arraysize(xorgLinuxKeyCodeToSDLK)) && while ((code < KeyCodeTableSize) &&
(physicalKey != data->keyCodeToSDLKTable[code])) { (physicalKey != data->keyCodeToSDLKTable[code])) {
code++; code++;
} }
if (code == SDL_arraysize(xorgLinuxKeyCodeToSDLK)) { if (code == KeyCodeTableSize) {
return physicalKey; return physicalKey;
} }
/* Get the corresponding KeySym - this is where the keyboard /* Get the corresponding KeySym - this is where the keyboard
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment