]> git.eshelyaron.com Git - emacs.git/commitdiff
Use const for some arrays and functions.
authorDan Nicolaescu <dann@ics.uci.edu>
Fri, 6 Aug 2010 18:41:15 +0000 (11:41 -0700)
committerDan Nicolaescu <dann@ics.uci.edu>
Fri, 6 Aug 2010 18:41:15 +0000 (11:41 -0700)
* 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.

src/ChangeLog
src/callint.c
src/emacs-icon.h
src/keyboard.c
src/term.c
src/xfns.c
src/xterm.h

index 30b73ffdf4f27a358972fd62fe8794ec6722e3b9..af16fc651c7129c149d86ed3fae5da73a6df1598 100644 (file)
@@ -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).
index 11473c3473ae541a098a3508714513e4b6c2c179..ae11c7cb24da267da9455c1343a168667f0a5655 100644 (file)
@@ -149,7 +149,7 @@ quotify_args (Lisp_Object exp)
   return exp;
 }
 
-char *callint_argfuns[]
+static const char *callint_argfuns[]
     = {"", "point", "mark", "region-beginning", "region-end"};
 
 static void
index 42c7d80bbe01145a5fd831abe03e51cc55baa432..82f0a6e701c4543be6a3bfed27c625b28e8ab2e5 100644 (file)
@@ -23,7 +23,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* 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 */
index 9114e2dbbca2f8f09b05265da9f2a193d38db31f..872f787c50668c63f70dd99b6cc61e5dde3270f1 100644 (file)
@@ -613,7 +613,7 @@ static Lisp_Object make_lispy_movement (struct frame *, Lisp_Object,
                                         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 @@ static const int lispy_accent_codes[] =
 /* 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 @@ static char *lispy_accent_keys[] =
 #ifdef HAVE_NTGUI
 #define FUNCTION_KEY_OFFSET 0x0
 
-char *lispy_function_keys[] =
+char const *lispy_function_keys[] =
   {
     0,                /* 0                      */
 
@@ -4945,7 +4945,7 @@ char *lispy_function_keys[] =
 
 /* 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 @@ static char *lispy_multimedia_keys[] =
    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 @@ static char *lispy_kana_keys[] =
 
 /* 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 @@ static char *lispy_function_keys[] =
 /* 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 @@ static char *iso_lispy_function_keys[] =
 
 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 Qup, Qdown, Qbottom, Qend_scroll;
 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 @@ reorder_modifiers (Lisp_Object symbol)
 
 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;
index 6fb26c77851601a77c9cf793f3e9e239a13a667f..96f9ce02f9b2bea84731798d915c67383ad55fab 100644 (file)
@@ -1266,7 +1266,7 @@ struct fkey_table {
      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 @@ term_mouse_highlight (struct frame *f, int x, int y)
        /* Look for a `help-echo' property.  */
        {
          Lisp_Object help;
-         extern Lisp_Object Qhelp_echo;
 
          /* Check overlays first.  */
          help = Qnil;
index 7695f829804f7bc7737b5d7e47e4ca9124a7ef6d..ecf7e150b0c9c5a2647bf448931f974de65dd94b 100644 (file)
@@ -762,10 +762,10 @@ xg_set_icon (FRAME_PTR f, Lisp_Object file)
 }
 
 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;
index 69c8ec22a73283febf88ad5a4213953e7d2efac4..972bfb50dc35405c9a6ed73e2bbc1e7cd377de7a 100644 (file)
@@ -1062,7 +1062,7 @@ extern Lisp_Object x_get_focus_frame (struct frame *);
 
 #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 *);