emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r101002: Use const for some arrays an


From: Dan Nicolaescu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r101002: Use const for some arrays and functions.
Date: Fri, 06 Aug 2010 11:41:15 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 101002
committer: Dan Nicolaescu <address@hidden>
branch nick: trunk
timestamp: Fri 2010-08-06 11:41:15 -0700
message:
  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.
modified:
  src/ChangeLog
  src/callint.c
  src/emacs-icon.h
  src/keyboard.c
  src/term.c
  src/xfns.c
  src/xterm.h
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-08-06 17:38:01 +0000
+++ b/src/ChangeLog     2010-08-06 18:41:15 +0000
@@ -1,3 +1,16 @@
+2010-08-06  Dan Nicolaescu  <address@hidden>
+
+       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  <address@hidden>
 
        * sysdep.c: Move include term.h last of includes (Bug#6812).

=== modified file 'src/callint.c'
--- a/src/callint.c     2010-07-29 05:48:06 +0000
+++ b/src/callint.c     2010-08-06 18:41:15 +0000
@@ -149,7 +149,7 @@
   return exp;
 }
 
-char *callint_argfuns[]
+static const char *callint_argfuns[]
     = {"", "point", "mark", "region-beginning", "region-end"};
 
 static void

=== modified file 'src/emacs-icon.h'
--- a/src/emacs-icon.h  2010-01-13 08:35:10 +0000
+++ b/src/emacs-icon.h  2010-08-06 18:41:15 +0000
@@ -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 */

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2010-08-05 23:34:12 +0000
+++ b/src/keyboard.c    2010-08-06 18:41:15 +0000
@@ -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;

=== modified file 'src/term.c'
--- a/src/term.c        2010-08-06 10:12:41 +0000
+++ b/src/term.c        2010-08-06 18:41:15 +0000
@@ -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;

=== modified file 'src/xfns.c'
--- a/src/xfns.c        2010-08-05 23:34:12 +0000
+++ b/src/xfns.c        2010-08-06 18:41:15 +0000
@@ -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;

=== modified file 'src/xterm.h'
--- a/src/xterm.h       2010-08-06 11:28:59 +0000
+++ b/src/xterm.h       2010-08-06 18:41:15 +0000
@@ -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 *);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]