changeset 109664:b6bdd59e60ff

Use const for some arrays and functions. * src/xterm.h (xg_set_icon_from_xpm_data): * src/xfns.c (xg_set_icon_from_xpm_data): * src/term.c (fkeys): * src/keyboard.c (lispy_accent_keys, lispy_function_keys) (lispy_multimedia_keys, lispy_kana_keys, iso_lispy_function_keys) (lispy_drag_n_drop_names, scroll_bar_parts, modify_event_symbol) (frame.c frame_parms): * src/emacs-icon.h (gnu_xpm_bits): * src/callint.c (callint_argfuns): Use const.
author Dan Nicolaescu <dann@ics.uci.edu>
date Fri, 06 Aug 2010 11:41:15 -0700
parents a4c55c0d8da2
children 4dbec9b5cd87
files src/ChangeLog src/callint.c src/emacs-icon.h src/keyboard.c src/term.c src/xfns.c src/xterm.h
diffstat 7 files changed, 30 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Aug 06 19:38:01 2010 +0200
+++ b/src/ChangeLog	Fri Aug 06 11:41:15 2010 -0700
@@ -1,3 +1,16 @@
+2010-08-06  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Use const for some arrays and functions.
+	* xterm.h (xg_set_icon_from_xpm_data):
+	* xfns.c (xg_set_icon_from_xpm_data):
+	* term.c (fkeys):
+	* keyboard.c (lispy_accent_keys, lispy_function_keys)
+	(lispy_multimedia_keys, lispy_kana_keys, iso_lispy_function_keys)
+	(lispy_drag_n_drop_names, scroll_bar_parts, modify_event_symbol)
+	(frame.c frame_parms):
+	* emacs-icon.h (gnu_xpm_bits):
+	* callint.c (callint_argfuns): Use const.
+
 2010-08-06  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* sysdep.c: Move include term.h last of includes (Bug#6812).
--- a/src/callint.c	Fri Aug 06 19:38:01 2010 +0200
+++ b/src/callint.c	Fri Aug 06 11:41:15 2010 -0700
@@ -149,7 +149,7 @@
   return exp;
 }
 
-char *callint_argfuns[]
+static const char *callint_argfuns[]
     = {"", "point", "mark", "region-beginning", "region-end"};
 
 static void
--- a/src/emacs-icon.h	Fri Aug 06 19:38:01 2010 +0200
+++ b/src/emacs-icon.h	Fri Aug 06 11:41:15 2010 -0700
@@ -23,7 +23,7 @@
 /* Note that the GTK port uses gdk to display the icon, so Emacs need
    not have XPM support compiled in.  */
 #if (defined (HAVE_XPM) && defined (HAVE_X_WINDOWS)) || defined (USE_GTK)
-static char * gnu_xpm_bits[] = {
+static const char * gnu_xpm_bits[] = {
 /* width height ncolors chars_per_pixel */
 "32 32 255 2",
 /* colors */
--- a/src/keyboard.c	Fri Aug 06 19:38:01 2010 +0200
+++ b/src/keyboard.c	Fri Aug 06 11:41:15 2010 -0700
@@ -613,7 +613,7 @@
                                         unsigned long);
 #endif
 static Lisp_Object modify_event_symbol (int, unsigned, Lisp_Object,
-                                        Lisp_Object, char **,
+                                        Lisp_Object, const char **,
                                         Lisp_Object *, unsigned);
 static Lisp_Object make_lispy_switch_frame (Lisp_Object);
 static void save_getcjmp (jmp_buf);
@@ -4724,7 +4724,7 @@
 /* This is a list of Lisp names for special "accent" characters.
    It parallels lispy_accent_codes.  */
 
-static char *lispy_accent_keys[] =
+static const char *lispy_accent_keys[] =
 {
   "dead-circumflex",
   "dead-grave",
@@ -4751,7 +4751,7 @@
 #ifdef HAVE_NTGUI
 #define FUNCTION_KEY_OFFSET 0x0
 
-char *lispy_function_keys[] =
+char const *lispy_function_keys[] =
   {
     0,                /* 0                      */
 
@@ -4945,7 +4945,7 @@
 
 /* Some of these duplicate the "Media keys" on newer keyboards,
    but they are delivered to the application in a different way.  */
-static char *lispy_multimedia_keys[] =
+static const char *lispy_multimedia_keys[] =
   {
     0,
     "browser-back",
@@ -5009,7 +5009,7 @@
    the XK_kana_A case below.  */
 #if 0
 #ifdef XK_kana_A
-static char *lispy_kana_keys[] =
+static const char *lispy_kana_keys[] =
   {
     /* X Keysym value */
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,	/* 0x400 .. 0x40f */
@@ -5048,7 +5048,7 @@
 
 /* You'll notice that this table is arranged to be conveniently
    indexed by X Windows keysym values.  */
-static char *lispy_function_keys[] =
+static const char *lispy_function_keys[] =
   {
     /* X Keysym value */
 
@@ -5134,7 +5134,7 @@
 /* ISO 9995 Function and Modifier Keys; the first byte is 0xFE.  */
 #define ISO_FUNCTION_KEY_OFFSET 0xfe00
 
-static char *iso_lispy_function_keys[] =
+static const char *iso_lispy_function_keys[] =
   {
     0, 0, 0, 0, 0, 0, 0, 0,	/* 0xfe00 */
     0, 0, 0, 0, 0, 0, 0, 0,	/* 0xfe08 */
@@ -5157,14 +5157,14 @@
 
 Lisp_Object Vlispy_mouse_stem;
 
-static char *lispy_wheel_names[] =
+static const char *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 char *lispy_drag_n_drop_names[] =
+static const char *lispy_drag_n_drop_names[] =
 {
   "drag-n-drop"
 };
@@ -5175,7 +5175,7 @@
 Lisp_Object Qtop, Qratio;
 
 /* An array of scroll bar parts, indexed by an enum scroll_bar_part value.  */
-Lisp_Object *scroll_bar_parts[] = {
+const Lisp_Object *scroll_bar_parts[] = {
   &Qabove_handle, &Qhandle, &Qbelow_handle,
   &Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio
 };
@@ -6542,7 +6542,7 @@
 
 static Lisp_Object
 modify_event_symbol (int symbol_num, unsigned int modifiers, Lisp_Object symbol_kind,
-		     Lisp_Object name_alist_or_stem, char **name_table,
+		     Lisp_Object name_alist_or_stem, const char **name_table,
 		     Lisp_Object *symbol_table, unsigned int table_size)
 {
   Lisp_Object value;
--- a/src/term.c	Fri Aug 06 19:38:01 2010 +0200
+++ b/src/term.c	Fri Aug 06 11:41:15 2010 -0700
@@ -1266,7 +1266,7 @@
      other keys (as on the IBM PC keyboard) they get overridden.
   */
 
-static struct fkey_table keys[] =
+static const struct fkey_table keys[] =
 {
   {"kh", "home"},	/* termcap */
   {"kl", "left"},	/* termcap */
@@ -2906,7 +2906,6 @@
 	/* Look for a `help-echo' property.  */
 	{
 	  Lisp_Object help;
-	  extern Lisp_Object Qhelp_echo;
 
 	  /* Check overlays first.  */
 	  help = Qnil;
--- a/src/xfns.c	Fri Aug 06 19:38:01 2010 +0200
+++ b/src/xfns.c	Fri Aug 06 11:41:15 2010 -0700
@@ -762,10 +762,10 @@
 }
 
 int
-xg_set_icon_from_xpm_data (FRAME_PTR f, char **data)
+xg_set_icon_from_xpm_data (FRAME_PTR f, const char **data)
 {
   int result = 0;
-  GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) data);
+  GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (data);
 
   if (!pixbuf)
     return 0;
--- a/src/xterm.h	Fri Aug 06 19:38:01 2010 +0200
+++ b/src/xterm.h	Fri Aug 06 11:41:15 2010 -0700
@@ -1062,7 +1062,7 @@
 
 #ifdef USE_GTK
 extern int xg_set_icon (struct frame *, Lisp_Object);
-extern int xg_set_icon_from_xpm_data (struct frame *, char**);
+extern int xg_set_icon_from_xpm_data (struct frame *, const char**);
 #endif /* USE_GTK */
 
 extern void x_real_positions (struct frame *, int *, int *);