diff src/video/x11/SDL_x11keyboard.c @ 2297:9f712d1e77f2

More typos
author Bob Pendleton <bob@pendleton.com>
date Sat, 12 Jan 2008 16:53:30 +0000
parents 0869721b488f
children 41d2599b7117
line wrap: on
line diff
--- a/src/video/x11/SDL_x11keyboard.c	Wed Jan 09 23:40:56 2008 +0000
+++ b/src/video/x11/SDL_x11keyboard.c	Sat Jan 12 16:53:30 2008 +0000
@@ -51,7 +51,7 @@
    hardware.
 */
 
-#define KeyCodeTableSize (258)
+#define KeyCodeTableSize (256)
 static SDLKey macKeyCodeToSDLK[KeyCodeTableSize] = 
 {
     /*   0 */   SDLK_UNKNOWN,
@@ -904,12 +904,12 @@
                 "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
         data->keyCodeToSDLKTable =
-            SDL_malloc(SDL_arraysize(xorgLinuxKeyCodeToSDLK));
+        SDL_malloc(KeyCodeTableSize * sizeof(SDLKey));
         if (data->keyCodeToSDLKTable == NULL) {
             SDL_OutOfMemory();
             return -1;
         }
-        for (code = SDL_arraysize(xorgLinuxKeyCodeToSDLK); code >= 0; code--) {
+        for (code = KeyCodeTableSize; code >= 0; code--) {
             data->keyCodeToSDLKTable[code] =
                 X11_KeySymToSDLKey(XKeycodeToKeysym(data->display, code, 0),
                                    SDL_TRUE);
@@ -918,7 +918,7 @@
 
     /* Set some non-default key names */
 
-    for (code = 0; code < SDL_arraysize(xorgLinuxKeyCodeToSDLK); code++) {
+    for (code = 0; code < KeyCodeTableSize; code++) {
         sdlkey = data->keyCodeToSDLKTable[code];
         switch (sdlkey) {
             /* The SDLK_*META keys are used as XK_Meta_* by some X
@@ -986,12 +986,12 @@
 
     /* Look up physicalKey to get an X11 KeyCode - linear search isn't
        terribly efficient, this might have to be optimized. */
-    while ((code < SDL_arraysize(xorgLinuxKeyCodeToSDLK)) &&
+    while ((code < KeyCodeTableSize) &&
            (physicalKey != data->keyCodeToSDLKTable[code])) {
         code++;
     }
 
-    if (code == SDL_arraysize(xorgLinuxKeyCodeToSDLK)) {
+    if (code == KeyCodeTableSize) {
         return physicalKey;
     }
     /* Get the corresponding KeySym - this is where the keyboard