Von: Thomas Zimmermann
authorSam Lantinga <slouken@libsdl.org>
Wed, 03 Jun 2009 04:37:27 +0000
changeset 3162dc1eb82ffdaa
parent 3161 494559cc723b
child 3163 a252014ce27d
Von: Thomas Zimmermann
Betreff: [SDL] [PATCH] Make static variables const
Datum: Tue, 19 May 2009 19:45:37 +0200

Hi,

this is a set of simple changes which make some of SDL's internal static
arrays constant. The purpose is to shrink the number of write-able
static bytes and thus increase the number of memory pages shared between
SDL applications.

The patch set is against trunk@4513. Each of the attached patch files is
specific to a sub-system. The set is completed by a second mail, because
of the list's 40 KiB limit.

The files readelf-r4513.txt and readelf-const-patch.txt where made by
calling 'readelf -S libSDL.so'. They show the difference in ELF sections
without and with the patch. Some numbers measured on my x86-64:

Before

[13] .rodata PROGBITS 00000000000eaaa0 000eaaa0
0000000000008170 0000000000000000 A 0 0 32
[19] .data.rel.ro PROGBITS 00000000003045e0 001045e0
00000000000023d0 0000000000000000 WA 0 0 32
[23] .data PROGBITS 00000000003076e0 001076e0
0000000000004988 0000000000000000 WA 0 0 32

After

[13] .rodata PROGBITS 00000000000eaaa0 000eaaa0
0000000000009a50 0000000000000000 A 0 0 32
[19] .data.rel.ro PROGBITS 0000000000306040 00106040
0000000000002608 0000000000000000 WA 0 0 32
[23] .data PROGBITS 0000000000309360 00109360
0000000000002e88 0000000000000000 WA 0 0 32

The size of the write-able data section decreased considerably. Some
entries became const-after-relocation, while most of its content went
straight into the read-only data section.

Best regards, Thomas
src/SDL_fatal.c
src/audio/SDL_audio.c
src/audio/esd/SDL_esdaudio.c
src/events/SDL_keyboard.c
src/events/blank_cursor.h
src/events/default_cursor.h
src/events/scancodes_darwin.h
src/events/scancodes_linux.h
src/events/scancodes_win32.h
src/events/scancodes_xfree86.h
src/libm/e_log.c
src/libm/e_rem_pio2.c
src/libm/e_sqrt.c
src/libm/k_cos.c
src/libm/k_rem_pio2.c
src/libm/k_sin.c
src/libm/s_copysign.c
src/libm/s_cos.c
src/libm/s_fabs.c
src/libm/s_floor.c
src/libm/s_scalbn.c
src/libm/s_sin.c
src/stdlib/SDL_qsort.c
src/thread/pthread/SDL_systhread.c
src/video/SDL_RLEaccel.c
src/video/SDL_blit_0.c
src/video/SDL_blit_1.c
src/video/SDL_blit_N.c
src/video/SDL_video.c
src/video/x11/SDL_x11keyboard.c
src/video/x11/imKStoUCS.c
     1.1 --- a/src/SDL_fatal.c	Sun May 31 11:53:12 2009 +0000
     1.2 +++ b/src/SDL_fatal.c	Wed Jun 03 04:37:27 2009 +0000
     1.3 @@ -43,7 +43,7 @@
     1.4      raise(sig);
     1.5  }
     1.6  
     1.7 -static int SDL_fatal_signals[] = {
     1.8 +static const int SDL_fatal_signals[] = {
     1.9      SIGSEGV,
    1.10  #ifdef SIGBUS
    1.11      SIGBUS,
     2.1 --- a/src/audio/SDL_audio.c	Sun May 31 11:53:12 2009 +0000
     2.2 +++ b/src/audio/SDL_audio.c	Wed Jun 03 04:37:27 2009 +0000
     2.3 @@ -77,7 +77,7 @@
     2.4  
     2.5  
     2.6  /* Available audio drivers */
     2.7 -static AudioBootStrap *bootstrap[] = {
     2.8 +static const AudioBootStrap *const bootstrap[] = {
     2.9  #if SDL_AUDIO_DRIVER_BSD
    2.10      &BSD_AUDIO_bootstrap,
    2.11  #endif
     3.1 --- a/src/audio/esd/SDL_esdaudio.c	Sun May 31 11:53:12 2009 +0000
     3.2 +++ b/src/audio/esd/SDL_esdaudio.c	Wed Jun 03 04:37:27 2009 +0000
     3.3 @@ -60,9 +60,11 @@
     3.4  {
     3.5      const char *name;
     3.6      void **func;
     3.7 -} esd_functions[] = {
     3.8 -SDL_ESD_SYM(esd_open_sound),
     3.9 -        SDL_ESD_SYM(esd_close), SDL_ESD_SYM(esd_play_stream),};
    3.10 +} const esd_functions[] = {
    3.11 +    SDL_ESD_SYM(esd_open_sound),
    3.12 +    SDL_ESD_SYM(esd_close), SDL_ESD_SYM(esd_play_stream),
    3.13 +};
    3.14 +
    3.15  #undef SDL_ESD_SYM
    3.16  
    3.17  static void
     4.1 --- a/src/events/SDL_keyboard.c	Sun May 31 11:53:12 2009 +0000
     4.2 +++ b/src/events/SDL_keyboard.c	Wed Jun 03 04:37:27 2009 +0000
     4.3 @@ -34,7 +34,7 @@
     4.4  static int SDL_current_keyboard;
     4.5  static SDL_Keyboard **SDL_keyboards;
     4.6  
     4.7 -static SDLKey SDL_default_keymap[SDL_NUM_SCANCODES] = {
     4.8 +static const SDLKey SDL_default_keymap[SDL_NUM_SCANCODES] = {
     4.9      0, 0, 0, 0,
    4.10      'a',
    4.11      'b',
     5.1 --- a/src/events/blank_cursor.h	Sun May 31 11:53:12 2009 +0000
     5.2 +++ b/src/events/blank_cursor.h	Wed Jun 03 04:37:27 2009 +0000
     5.3 @@ -28,7 +28,7 @@
     5.4  #define BLANK_CHOTX	0
     5.5  #define BLANK_CHOTY	0
     5.6  
     5.7 -static unsigned char blank_cdata[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
     5.8 -static unsigned char blank_cmask[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
     5.9 +static const unsigned char blank_cdata[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
    5.10 +static const unsigned char blank_cmask[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
    5.11  
    5.12  /* vi: set ts=4 sw=4 expandtab: */
     6.1 --- a/src/events/default_cursor.h	Sun May 31 11:53:12 2009 +0000
     6.2 +++ b/src/events/default_cursor.h	Wed Jun 03 04:37:27 2009 +0000
     6.3 @@ -33,7 +33,7 @@
     6.4  
     6.5  #ifdef USE_MACOS_CURSOR
     6.6  
     6.7 -static unsigned char default_cdata[] = {
     6.8 +static const unsigned char default_cdata[] = {
     6.9      0x00, 0x00,
    6.10      0x40, 0x00,
    6.11      0x60, 0x00,
    6.12 @@ -52,7 +52,7 @@
    6.13      0x00, 0x00
    6.14  };
    6.15  
    6.16 -static unsigned char default_cmask[] = {
    6.17 +static const unsigned char default_cmask[] = {
    6.18      0xC0, 0x00,
    6.19      0xE0, 0x00,
    6.20      0xF0, 0x00,
    6.21 @@ -73,7 +73,7 @@
    6.22  
    6.23  #else
    6.24  
    6.25 -static unsigned char default_cdata[] = {
    6.26 +static const unsigned char default_cdata[] = {
    6.27      0x00, 0x00,
    6.28      0x40, 0x00,
    6.29      0x60, 0x00,
    6.30 @@ -92,7 +92,7 @@
    6.31      0x00, 0x00
    6.32  };
    6.33  
    6.34 -static unsigned char default_cmask[] = {
    6.35 +static const unsigned char default_cmask[] = {
    6.36      0x40, 0x00,
    6.37      0xE0, 0x00,
    6.38      0xF0, 0x00,
     7.1 --- a/src/events/scancodes_darwin.h	Sun May 31 11:53:12 2009 +0000
     7.2 +++ b/src/events/scancodes_darwin.h	Wed Jun 03 04:37:27 2009 +0000
     7.3 @@ -27,7 +27,7 @@
     7.4     - experimentation on various ADB and USB ISO keyboards and one ADB ANSI keyboard
     7.5  */
     7.6  /* *INDENT-OFF* */
     7.7 -static SDL_scancode darwin_scancode_table[] = {
     7.8 +static const SDL_scancode darwin_scancode_table[] = {
     7.9      /*   0 */   SDL_SCANCODE_A,
    7.10      /*   1 */   SDL_SCANCODE_S,
    7.11      /*   2 */   SDL_SCANCODE_D,
     8.1 --- a/src/events/scancodes_linux.h	Sun May 31 11:53:12 2009 +0000
     8.2 +++ b/src/events/scancodes_linux.h	Wed Jun 03 04:37:27 2009 +0000
     8.3 @@ -26,7 +26,7 @@
     8.4     - Linux kernel source input.h
     8.5  */
     8.6  /* *INDENT-OFF* */
     8.7 -static SDL_scancode linux_scancode_table[] = {
     8.8 +static SDL_scancode const linux_scancode_table[] = {
     8.9      /*  0 */    SDL_SCANCODE_UNKNOWN,
    8.10      /*  1 */    SDL_SCANCODE_ESCAPE,
    8.11      /*  2 */    SDL_SCANCODE_1,
     9.1 --- a/src/events/scancodes_win32.h	Sun May 31 11:53:12 2009 +0000
     9.2 +++ b/src/events/scancodes_win32.h	Wed Jun 03 04:37:27 2009 +0000
     9.3 @@ -26,7 +26,7 @@
     9.4     - msdn.microsoft.com
     9.5  */
     9.6  /* *INDENT-OFF* */
     9.7 -static SDL_scancode win32_scancode_table[] = {
     9.8 +static const SDL_scancode win32_scancode_table[] = {
     9.9      /*  0, 0x00 */      SDL_SCANCODE_UNKNOWN,
    9.10      /*  1, 0x01 */      SDL_SCANCODE_UNKNOWN,
    9.11      /*  2, 0x02 */      SDL_SCANCODE_UNKNOWN,
    10.1 --- a/src/events/scancodes_xfree86.h	Sun May 31 11:53:12 2009 +0000
    10.2 +++ b/src/events/scancodes_xfree86.h	Wed Jun 03 04:37:27 2009 +0000
    10.3 @@ -26,7 +26,7 @@
    10.4     - atKeyNames.h from XFree86 source code
    10.5  */
    10.6  /* *INDENT-OFF* */
    10.7 -static SDL_scancode xfree86_scancode_table[] = {
    10.8 +static const SDL_scancode xfree86_scancode_table[] = {
    10.9      /*  0 */    SDL_SCANCODE_UNKNOWN,
   10.10      /*  1 */    SDL_SCANCODE_ESCAPE,
   10.11      /*  2 */    SDL_SCANCODE_1,
   10.12 @@ -177,7 +177,7 @@
   10.13  };
   10.14  
   10.15  /* for wireless usb keyboard (manufacturer TRUST) without numpad. */
   10.16 -static SDL_scancode xfree86_scancode_table2[] = {
   10.17 +static const SDL_scancode xfree86_scancode_table2[] = {
   10.18      /*  0 */    SDL_SCANCODE_UNKNOWN,
   10.19      /*  1 */    SDL_SCANCODE_ESCAPE,
   10.20      /*  2 */    SDL_SCANCODE_1,
    11.1 --- a/src/libm/e_log.c	Sun May 31 11:53:12 2009 +0000
    11.2 +++ b/src/libm/e_log.c	Wed Jun 03 04:37:27 2009 +0000
    11.3 @@ -11,7 +11,8 @@
    11.4   */
    11.5  
    11.6  #if defined(LIBM_SCCS) && !defined(lint)
    11.7 -static char rcsid[] = "$NetBSD: e_log.c,v 1.8 1995/05/10 20:45:49 jtc Exp $";
    11.8 +static const char rcsid[] =
    11.9 +    "$NetBSD: e_log.c,v 1.8 1995/05/10 20:45:49 jtc Exp $";
   11.10  #endif
   11.11  
   11.12  /* __ieee754_log(x)
    12.1 --- a/src/libm/e_rem_pio2.c	Sun May 31 11:53:12 2009 +0000
    12.2 +++ b/src/libm/e_rem_pio2.c	Wed Jun 03 04:37:27 2009 +0000
    12.3 @@ -11,7 +11,7 @@
    12.4   */
    12.5  
    12.6  #if defined(LIBM_SCCS) && !defined(lint)
    12.7 -static char rcsid[] =
    12.8 +static const char rcsid[] =
    12.9      "$NetBSD: e_rem_pio2.c,v 1.8 1995/05/10 20:46:02 jtc Exp $";
   12.10  #endif
   12.11  
    13.1 --- a/src/libm/e_sqrt.c	Sun May 31 11:53:12 2009 +0000
    13.2 +++ b/src/libm/e_sqrt.c	Wed Jun 03 04:37:27 2009 +0000
    13.3 @@ -11,7 +11,8 @@
    13.4   */
    13.5  
    13.6  #if defined(LIBM_SCCS) && !defined(lint)
    13.7 -static char rcsid[] = "$NetBSD: e_sqrt.c,v 1.8 1995/05/10 20:46:17 jtc Exp $";
    13.8 +static const char rcsid[] =
    13.9 +    "$NetBSD: e_sqrt.c,v 1.8 1995/05/10 20:46:17 jtc Exp $";
   13.10  #endif
   13.11  
   13.12  /* __ieee754_sqrt(x)
    14.1 --- a/src/libm/k_cos.c	Sun May 31 11:53:12 2009 +0000
    14.2 +++ b/src/libm/k_cos.c	Wed Jun 03 04:37:27 2009 +0000
    14.3 @@ -11,7 +11,8 @@
    14.4   */
    14.5  
    14.6  #if defined(LIBM_SCCS) && !defined(lint)
    14.7 -static char rcsid[] = "$NetBSD: k_cos.c,v 1.8 1995/05/10 20:46:22 jtc Exp $";
    14.8 +static const char rcsid[] =
    14.9 +    "$NetBSD: k_cos.c,v 1.8 1995/05/10 20:46:22 jtc Exp $";
   14.10  #endif
   14.11  
   14.12  /*
    15.1 --- a/src/libm/k_rem_pio2.c	Sun May 31 11:53:12 2009 +0000
    15.2 +++ b/src/libm/k_rem_pio2.c	Wed Jun 03 04:37:27 2009 +0000
    15.3 @@ -11,7 +11,7 @@
    15.4   */
    15.5  
    15.6  #if defined(LIBM_SCCS) && !defined(lint)
    15.7 -static char rcsid[] =
    15.8 +static const char rcsid[] =
    15.9      "$NetBSD: k_rem_pio2.c,v 1.7 1995/05/10 20:46:25 jtc Exp $";
   15.10  #endif
   15.11  
    16.1 --- a/src/libm/k_sin.c	Sun May 31 11:53:12 2009 +0000
    16.2 +++ b/src/libm/k_sin.c	Wed Jun 03 04:37:27 2009 +0000
    16.3 @@ -11,7 +11,8 @@
    16.4   */
    16.5  
    16.6  #if defined(LIBM_SCCS) && !defined(lint)
    16.7 -static char rcsid[] = "$NetBSD: k_sin.c,v 1.8 1995/05/10 20:46:31 jtc Exp $";
    16.8 +static const char rcsid[] =
    16.9 +    "$NetBSD: k_sin.c,v 1.8 1995/05/10 20:46:31 jtc Exp $";
   16.10  #endif
   16.11  
   16.12  /* __kernel_sin( x, y, iy)
    17.1 --- a/src/libm/s_copysign.c	Sun May 31 11:53:12 2009 +0000
    17.2 +++ b/src/libm/s_copysign.c	Wed Jun 03 04:37:27 2009 +0000
    17.3 @@ -11,7 +11,7 @@
    17.4   */
    17.5  
    17.6  #if defined(LIBM_SCCS) && !defined(lint)
    17.7 -static char rcsid[] =
    17.8 +static const char rcsid[] =
    17.9      "$NetBSD: s_copysign.c,v 1.8 1995/05/10 20:46:57 jtc Exp $";
   17.10  #endif
   17.11  
    18.1 --- a/src/libm/s_cos.c	Sun May 31 11:53:12 2009 +0000
    18.2 +++ b/src/libm/s_cos.c	Wed Jun 03 04:37:27 2009 +0000
    18.3 @@ -11,7 +11,8 @@
    18.4   */
    18.5  
    18.6  #if defined(LIBM_SCCS) && !defined(lint)
    18.7 -static char rcsid[] = "$NetBSD: s_cos.c,v 1.7 1995/05/10 20:47:02 jtc Exp $";
    18.8 +static const char rcsid[] =
    18.9 +    "$NetBSD: s_cos.c,v 1.7 1995/05/10 20:47:02 jtc Exp $";
   18.10  #endif
   18.11  
   18.12  /* cos(x)
    19.1 --- a/src/libm/s_fabs.c	Sun May 31 11:53:12 2009 +0000
    19.2 +++ b/src/libm/s_fabs.c	Wed Jun 03 04:37:27 2009 +0000
    19.3 @@ -11,7 +11,8 @@
    19.4   */
    19.5  
    19.6  #if defined(LIBM_SCCS) && !defined(lint)
    19.7 -static char rcsid[] = "$NetBSD: s_fabs.c,v 1.7 1995/05/10 20:47:13 jtc Exp $";
    19.8 +static const char rcsid[] =
    19.9 +    "$NetBSD: s_fabs.c,v 1.7 1995/05/10 20:47:13 jtc Exp $";
   19.10  #endif
   19.11  
   19.12  /*
    20.1 --- a/src/libm/s_floor.c	Sun May 31 11:53:12 2009 +0000
    20.2 +++ b/src/libm/s_floor.c	Wed Jun 03 04:37:27 2009 +0000
    20.3 @@ -11,7 +11,7 @@
    20.4   */
    20.5  
    20.6  #if defined(LIBM_SCCS) && !defined(lint)
    20.7 -static char rcsid[] =
    20.8 +static const char rcsid[] =
    20.9      "$NetBSD: s_floor.c,v 1.8 1995/05/10 20:47:20 jtc Exp $";
   20.10  #endif
   20.11  
    21.1 --- a/src/libm/s_scalbn.c	Sun May 31 11:53:12 2009 +0000
    21.2 +++ b/src/libm/s_scalbn.c	Wed Jun 03 04:37:27 2009 +0000
    21.3 @@ -11,7 +11,7 @@
    21.4   */
    21.5  
    21.6  #if defined(LIBM_SCCS) && !defined(lint)
    21.7 -static char rcsid[] =
    21.8 +static const char rcsid[] =
    21.9      "$NetBSD: s_scalbn.c,v 1.8 1995/05/10 20:48:08 jtc Exp $";
   21.10  #endif
   21.11  
    22.1 --- a/src/libm/s_sin.c	Sun May 31 11:53:12 2009 +0000
    22.2 +++ b/src/libm/s_sin.c	Wed Jun 03 04:37:27 2009 +0000
    22.3 @@ -11,7 +11,8 @@
    22.4   */
    22.5  
    22.6  #if defined(LIBM_SCCS) && !defined(lint)
    22.7 -static char rcsid[] = "$NetBSD: s_sin.c,v 1.7 1995/05/10 20:48:15 jtc Exp $";
    22.8 +static const char rcsid[] =
    22.9 +    "$NetBSD: s_sin.c,v 1.7 1995/05/10 20:48:15 jtc Exp $";
   22.10  #endif
   22.11  
   22.12  /* sin(x)
    23.1 --- a/src/stdlib/SDL_qsort.c	Sun May 31 11:53:12 2009 +0000
    23.2 +++ b/src/stdlib/SDL_qsort.c	Wed Jun 03 04:37:27 2009 +0000
    23.3 @@ -60,7 +60,7 @@
    23.4  
    23.5  #ifndef HAVE_QSORT
    23.6  
    23.7 -static char _ID[] = "<qsort.c gjm 1.12 1998-03-19>";
    23.8 +static const char _ID[] = "<qsort.c gjm 1.12 1998-03-19>";
    23.9  
   23.10  /* How many bytes are there per word? (Must be a power of 2,
   23.11   * and must in fact equal sizeof(int).)
    24.1 --- a/src/thread/pthread/SDL_systhread.c	Sun May 31 11:53:12 2009 +0000
    24.2 +++ b/src/thread/pthread/SDL_systhread.c	Wed Jun 03 04:37:27 2009 +0000
    24.3 @@ -29,7 +29,7 @@
    24.4  #include "../SDL_systhread.h"
    24.5  
    24.6  /* List of signals to mask in the subthreads */
    24.7 -static int sig_list[] = {
    24.8 +static const int sig_list[] = {
    24.9      SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
   24.10      SIGVTALRM, SIGPROF, 0
   24.11  };
    25.1 --- a/src/video/SDL_RLEaccel.c	Sun May 31 11:53:12 2009 +0000
    25.2 +++ b/src/video/SDL_RLEaccel.c	Wed Jun 03 04:37:27 2009 +0000
    25.3 @@ -1259,7 +1259,7 @@
    25.4  
    25.5  typedef Uint32(*getpix_func) (Uint8 *);
    25.6  
    25.7 -static getpix_func getpixes[4] = {
    25.8 +static const getpix_func getpixes[4] = {
    25.9      getpix_8, getpix_16, getpix_24, getpix_32
   25.10  };
   25.11  
    26.1 --- a/src/video/SDL_blit_0.c	Sun May 31 11:53:12 2009 +0000
    26.2 +++ b/src/video/SDL_blit_0.c	Wed Jun 03 04:37:27 2009 +0000
    26.3 @@ -443,11 +443,11 @@
    26.4      }
    26.5  }
    26.6  
    26.7 -static SDL_BlitFunc bitmap_blit[] = {
    26.8 +static const SDL_BlitFunc bitmap_blit[] = {
    26.9      NULL, BlitBto1, BlitBto2, BlitBto3, BlitBto4
   26.10  };
   26.11  
   26.12 -static SDL_BlitFunc colorkey_blit[] = {
   26.13 +static const SDL_BlitFunc colorkey_blit[] = {
   26.14      NULL, BlitBto1Key, BlitBto2Key, BlitBto3Key, BlitBto4Key
   26.15  };
   26.16  
    27.1 --- a/src/video/SDL_blit_1.c	Sun May 31 11:53:12 2009 +0000
    27.2 +++ b/src/video/SDL_blit_1.c	Wed Jun 03 04:37:27 2009 +0000
    27.3 @@ -512,11 +512,11 @@
    27.4      }
    27.5  }
    27.6  
    27.7 -static SDL_BlitFunc one_blit[] = {
    27.8 +static const SDL_BlitFunc one_blit[] = {
    27.9      NULL, Blit1to1, Blit1to2, Blit1to3, Blit1to4
   27.10  };
   27.11  
   27.12 -static SDL_BlitFunc one_blitkey[] = {
   27.13 +static const SDL_BlitFunc one_blitkey[] = {
   27.14      NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key
   27.15  };
   27.16  
    28.1 --- a/src/video/SDL_blit_N.c	Sun May 31 11:53:12 2009 +0000
    28.2 +++ b/src/video/SDL_blit_N.c	Wed Jun 03 04:37:27 2009 +0000
    28.3 @@ -113,7 +113,7 @@
    28.4       *  leave alpha with a zero mask, but we should still swizzle the bits.
    28.5       */
    28.6      /* ARGB */
    28.7 -    const static struct SDL_PixelFormat default_pixel_format = {
    28.8 +    const static const struct SDL_PixelFormat default_pixel_format = {
    28.9          NULL, 32, 4,
   28.10          0, 0, 0, 0,
   28.11          16, 8, 0, 24,
   28.12 @@ -2404,7 +2404,7 @@
   28.13      {0, 0, 0, 0, 0, 0, 0, 0, BlitNtoN, 0}
   28.14  };
   28.15  
   28.16 -static const struct blit_table *normal_blit[] = {
   28.17 +static const struct blit_table *const normal_blit[] = {
   28.18      normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4
   28.19  };
   28.20  
    29.1 --- a/src/video/SDL_video.c	Sun May 31 11:53:12 2009 +0000
    29.2 +++ b/src/video/SDL_video.c	Wed Jun 03 04:37:27 2009 +0000
    29.3 @@ -48,7 +48,7 @@
    29.4  #endif /* SDL_VIDEO_OPENGL */
    29.5  
    29.6  /* Available video drivers */
    29.7 -static VideoBootStrap *bootstrap[] = {
    29.8 +static const VideoBootStrap *const bootstrap[] = {
    29.9  #if SDL_VIDEO_DRIVER_COCOA
   29.10      &COCOA_bootstrap,
   29.11  #endif
    30.1 --- a/src/video/x11/SDL_x11keyboard.c	Sun May 31 11:53:12 2009 +0000
    30.2 +++ b/src/video/x11/SDL_x11keyboard.c	Wed Jun 03 04:37:27 2009 +0000
    30.3 @@ -32,7 +32,7 @@
    30.4  #include "imKStoUCS.h"
    30.5  
    30.6  /* *INDENT-OFF* */
    30.7 -static struct {
    30.8 +static const struct {
    30.9      KeySym keysym;
   30.10      SDLKey sdlkey;
   30.11  } KeySymToSDLKey[] = {
   30.12 @@ -132,9 +132,9 @@
   30.13      { XK_Mode_switch, SDLK_MODE },
   30.14  };
   30.15  
   30.16 -static struct
   30.17 +static const struct
   30.18  {
   30.19 -    SDL_scancode *table;
   30.20 +    const SDL_scancode const *table;
   30.21      int table_size;
   30.22  } scancode_set[] = {
   30.23      { darwin_scancode_table, SDL_arraysize(darwin_scancode_table) },
    31.1 --- a/src/video/x11/imKStoUCS.c	Sun May 31 11:53:12 2009 +0000
    31.2 +++ b/src/video/x11/imKStoUCS.c	Wed Jun 03 04:37:27 2009 +0000
    31.3 @@ -102,7 +102,7 @@
    31.4      0x06a9, 0x06af, 0x06ba, 0x06be, 0x06cc, 0x06d2, 0x06c1      /* 0x05f8-0x05fe */
    31.5  };
    31.6  
    31.7 -static unsigned short keysym_to_unicode_680_6ff[] = {
    31.8 +static unsigned short const keysym_to_unicode_680_6ff[] = {
    31.9      0x0492, 0x0496, 0x049a, 0x049c, 0x04a2, 0x04ae, 0x04b0, 0x04b2,     /* 0x0680-0x0687 */
   31.10      0x04b6, 0x04b8, 0x04ba, 0x0000, 0x04d8, 0x04e2, 0x04e8, 0x04ee,     /* 0x0688-0x068f */
   31.11      0x0493, 0x0497, 0x049b, 0x049d, 0x04a3, 0x04af, 0x04b1, 0x04b3,     /* 0x0690-0x0697 */
   31.12 @@ -214,7 +214,7 @@
   31.13      0x11eb, 0x0000, 0x11f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x20a9,     /* 0x0ef8-0x0eff */
   31.14  };
   31.15  
   31.16 -static unsigned short keysym_to_unicode_12a1_12fe[] = {
   31.17 +static unsigned short const keysym_to_unicode_12a1_12fe[] = {
   31.18      0x1e02, 0x1e03, 0x0000, 0x0000, 0x0000, 0x1e0a, 0x0000,     /* 0x12a0-0x12a7 */
   31.19      0x1e80, 0x0000, 0x1e82, 0x1e0b, 0x1ef2, 0x0000, 0x0000, 0x0000,     /* 0x12a8-0x12af */
   31.20      0x1e1e, 0x1e1f, 0x0000, 0x0000, 0x1e40, 0x1e41, 0x0000, 0x1e56,     /* 0x12b0-0x12b7 */
   31.21 @@ -233,7 +233,7 @@
   31.22      0x0152, 0x0153, 0x0178      /* 0x13b8-0x13bf */
   31.23  };
   31.24  
   31.25 -static unsigned short keysym_to_unicode_14a1_14ff[] = {
   31.26 +static unsigned short const keysym_to_unicode_14a1_14ff[] = {
   31.27      0x2741, 0x00a7, 0x0589, 0x0029, 0x0028, 0x00bb, 0x00ab,     /* 0x14a0-0x14a7 */
   31.28      0x2014, 0x002e, 0x055d, 0x002c, 0x2013, 0x058a, 0x2026, 0x055c,     /* 0x14a8-0x14af */
   31.29      0x055b, 0x055e, 0x0531, 0x0561, 0x0532, 0x0562, 0x0533, 0x0563,     /* 0x14b0-0x14b7 */
   31.30 @@ -248,7 +248,7 @@
   31.31      0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x2019, 0x0027,     /* 0x14f8-0x14ff */
   31.32  };
   31.33  
   31.34 -static unsigned short keysym_to_unicode_15d0_15f6[] = {
   31.35 +static unsigned short const keysym_to_unicode_15d0_15f6[] = {
   31.36      0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, 0x10d5, 0x10d6, 0x10d7,     /* 0x15d0-0x15d7 */
   31.37      0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, 0x10dd, 0x10de, 0x10df,     /* 0x15d8-0x15df */
   31.38      0x10e0, 0x10e1, 0x10e2, 0x10e3, 0x10e4, 0x10e5, 0x10e6, 0x10e7,     /* 0x15e0-0x15e7 */
   31.39 @@ -256,7 +256,7 @@
   31.40      0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0x10f6      /* 0x15f0-0x15f7 */
   31.41  };
   31.42  
   31.43 -static unsigned short keysym_to_unicode_16a0_16f6[] = {
   31.44 +static unsigned short const keysym_to_unicode_16a0_16f6[] = {
   31.45      0x0000, 0x0000, 0xf0a2, 0x1e8a, 0x0000, 0xf0a5, 0x012c, 0xf0a7,     /* 0x16a0-0x16a7 */
   31.46      0xf0a8, 0x01b5, 0x01e6, 0x0000, 0x0000, 0x0000, 0x0000, 0x019f,     /* 0x16a8-0x16af */
   31.47      0x0000, 0x0000, 0xf0b2, 0x1e8b, 0x01d1, 0xf0b5, 0x012d, 0xf0b7,     /* 0x16b0-0x16b7 */