changeset 111539:ad93f2dd2d38

Add const to array elements. * keyboard.c (modify_event_symbol) : Add const to array elements of arg NAME_TABLE. (lispy_accent_keys, lispy_function_keys, lispy_multimedia_keys) (lispy_kana_keys, iso_lispy_function_keys, lispy_wheel_names) (lispy_wheel_names, lispy_drag_n_drop_names, modifier_names): Add const to array elements. (scroll_bar_parts): Make static. Fix position of const. * w32fns.c (lispy_function_keys): Add const to extern. * w32inevt.c (lispy_function_keys): Likewise.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Sun, 14 Nov 2010 15:55:27 +0900
parents a36ab2f7cad2
children ca297dbe1d56
files src/ChangeLog src/keyboard.c src/w32fns.c src/w32inevt.c
diffstat 4 files changed, 28 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Sat Nov 13 21:09:11 2010 -0500
+++ b/src/ChangeLog	Sun Nov 14 15:55:27 2010 +0900
@@ -1,3 +1,17 @@
+2010-11-14  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* keyboard.c (modify_event_symbol) : Add const to array elements of
+	arg NAME_TABLE.
+	(lispy_accent_keys, lispy_function_keys, lispy_multimedia_keys)
+	(lispy_kana_keys, iso_lispy_function_keys, lispy_wheel_names)
+	(lispy_wheel_names, lispy_drag_n_drop_names, modifier_names):
+	Add const to array elements.
+	(scroll_bar_parts): Make static.  Fix position of const.
+
+	* w32fns.c (lispy_function_keys): Add const to extern.
+
+	* w32inevt.c (lispy_function_keys): Likewise.
+
 2010-11-14  Chong Yidong  <cyd@stupidchicken.com>
 
 	* xfns.c (Fx_create_frame): Don't check for the cursorColor
--- a/src/keyboard.c	Sat Nov 13 21:09:11 2010 -0500
+++ b/src/keyboard.c	Sun Nov 14 15:55:27 2010 +0900
@@ -620,7 +620,7 @@
                                         unsigned long);
 #endif
 static Lisp_Object modify_event_symbol (EMACS_INT, unsigned, Lisp_Object,
-                                        Lisp_Object, const char **,
+                                        Lisp_Object, const char *const *,
                                         Lisp_Object *, unsigned);
 static Lisp_Object make_lispy_switch_frame (Lisp_Object);
 static void save_getcjmp (jmp_buf);
@@ -4752,7 +4752,7 @@
 /* This is a list of Lisp names for special "accent" characters.
    It parallels lispy_accent_codes.  */
 
-static const char *lispy_accent_keys[] =
+static const char *const lispy_accent_keys[] =
 {
   "dead-circumflex",
   "dead-grave",
@@ -4779,7 +4779,7 @@
 #ifdef HAVE_NTGUI
 #define FUNCTION_KEY_OFFSET 0x0
 
-char const *lispy_function_keys[] =
+const char *const lispy_function_keys[] =
   {
     0,                /* 0                      */
 
@@ -4973,7 +4973,7 @@
 
 /* Some of these duplicate the "Media keys" on newer keyboards,
    but they are delivered to the application in a different way.  */
-static const char *lispy_multimedia_keys[] =
+static const char *const lispy_multimedia_keys[] =
   {
     0,
     "browser-back",
@@ -5037,7 +5037,7 @@
    the XK_kana_A case below.  */
 #if 0
 #ifdef XK_kana_A
-static const char *lispy_kana_keys[] =
+static const char *const lispy_kana_keys[] =
   {
     /* X Keysym value */
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	/* 0x400 .. 0x40f */
@@ -5076,7 +5076,7 @@
 
 /* You'll notice that this table is arranged to be conveniently
    indexed by X Windows keysym values.  */
-static const char *lispy_function_keys[] =
+static const char *const lispy_function_keys[] =
   {
     /* X Keysym value */
 
@@ -5162,7 +5162,7 @@
 /* ISO 9995 Function and Modifier Keys; the first byte is 0xFE.  */
 #define ISO_FUNCTION_KEY_OFFSET 0xfe00
 
-static const char *iso_lispy_function_keys[] =
+static const char *const iso_lispy_function_keys[] =
   {
     0, 0, 0, 0, 0, 0, 0, 0,	/* 0xfe00 */
     0, 0, 0, 0, 0, 0, 0, 0,	/* 0xfe08 */
@@ -5185,14 +5185,14 @@
 
 Lisp_Object Vlispy_mouse_stem;
 
-static const char *lispy_wheel_names[] =
+static const char *const lispy_wheel_names[] =
 {
   "wheel-up", "wheel-down", "wheel-left", "wheel-right"
 };
 
 /* drag-n-drop events are generated when a set of selected files are
    dragged from another application and dropped onto an Emacs window.  */
-static const char *lispy_drag_n_drop_names[] =
+static const char *const lispy_drag_n_drop_names[] =
 {
   "drag-n-drop"
 };
@@ -5203,7 +5203,7 @@
 Lisp_Object Qtop, Qratio;
 
 /* An array of scroll bar parts, indexed by an enum scroll_bar_part value.  */
-const Lisp_Object *scroll_bar_parts[] = {
+static Lisp_Object *const scroll_bar_parts[] = {
   &Qabove_handle, &Qhandle, &Qbelow_handle,
   &Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio
 };
@@ -6351,7 +6351,7 @@
 }
 
 
-static const char *modifier_names[] =
+static const char *const modifier_names[] =
 {
   "up", "down", "drag", "click", "double", "triple", 0, 0,
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -6571,7 +6571,7 @@
 
 static Lisp_Object
 modify_event_symbol (EMACS_INT symbol_num, unsigned int modifiers, Lisp_Object symbol_kind,
-		     Lisp_Object name_alist_or_stem, const char **name_table,
+		     Lisp_Object name_alist_or_stem, const char *const *name_table,
 		     Lisp_Object *symbol_table, unsigned int table_size)
 {
   Lisp_Object value;
--- a/src/w32fns.c	Sat Nov 13 21:09:11 2010 -0500
+++ b/src/w32fns.c	Sun Nov 14 15:55:27 2010 +0900
@@ -82,7 +82,7 @@
 
 extern int quit_char;
 
-extern char *lispy_function_keys[];
+extern const char *const lispy_function_keys[];
 
 /* The colormap for converting color names to RGB values */
 Lisp_Object Vw32_color_map;
--- a/src/w32inevt.c	Sat Nov 13 21:09:11 2010 -0500
+++ b/src/w32inevt.c	Sun Nov 14 15:55:27 2010 +0900
@@ -282,7 +282,7 @@
 }
 
 
-extern char *lispy_function_keys[];
+extern const char *const lispy_function_keys[];
 
 static int faked_key = 0;