diff options
| author | Dan Nicolaescu | 2010-08-06 11:41:15 -0700 |
|---|---|---|
| committer | Dan Nicolaescu | 2010-08-06 11:41:15 -0700 |
| commit | 648801d1f58ba038a4ec3217de38032d40b2a98e (patch) | |
| tree | 80e5973e94555f711dcc017e396c733105d95c1a /src | |
| parent | 8646d999c5360d8f627542c619bd7ccfe52b6066 (diff) | |
| download | emacs-648801d1f58ba038a4ec3217de38032d40b2a98e.tar.gz emacs-648801d1f58ba038a4ec3217de38032d40b2a98e.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 13 | ||||
| -rw-r--r-- | src/callint.c | 2 | ||||
| -rw-r--r-- | src/emacs-icon.h | 2 | ||||
| -rw-r--r-- | src/keyboard.c | 22 | ||||
| -rw-r--r-- | src/term.c | 3 | ||||
| -rw-r--r-- | src/xfns.c | 4 | ||||
| -rw-r--r-- | src/xterm.h | 2 |
7 files changed, 30 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 30b73ffdf4f..af16fc651c7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2010-08-06 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | Use const for some arrays and functions. | ||
| 4 | * xterm.h (xg_set_icon_from_xpm_data): | ||
| 5 | * xfns.c (xg_set_icon_from_xpm_data): | ||
| 6 | * term.c (fkeys): | ||
| 7 | * keyboard.c (lispy_accent_keys, lispy_function_keys) | ||
| 8 | (lispy_multimedia_keys, lispy_kana_keys, iso_lispy_function_keys) | ||
| 9 | (lispy_drag_n_drop_names, scroll_bar_parts, modify_event_symbol) | ||
| 10 | (frame.c frame_parms): | ||
| 11 | * emacs-icon.h (gnu_xpm_bits): | ||
| 12 | * callint.c (callint_argfuns): Use const. | ||
| 13 | |||
| 1 | 2010-08-06 Jan Djärv <jan.h.d@swipnet.se> | 14 | 2010-08-06 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 15 | ||
| 3 | * sysdep.c: Move include term.h last of includes (Bug#6812). | 16 | * sysdep.c: Move include term.h last of includes (Bug#6812). |
diff --git a/src/callint.c b/src/callint.c index 11473c3473a..ae11c7cb24d 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -149,7 +149,7 @@ quotify_args (Lisp_Object exp) | |||
| 149 | return exp; | 149 | return exp; |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | char *callint_argfuns[] | 152 | static const char *callint_argfuns[] |
| 153 | = {"", "point", "mark", "region-beginning", "region-end"}; | 153 | = {"", "point", "mark", "region-beginning", "region-end"}; |
| 154 | 154 | ||
| 155 | static void | 155 | static void |
diff --git a/src/emacs-icon.h b/src/emacs-icon.h index 42c7d80bbe0..82f0a6e701c 100644 --- a/src/emacs-icon.h +++ b/src/emacs-icon.h | |||
| @@ -23,7 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 23 | /* Note that the GTK port uses gdk to display the icon, so Emacs need | 23 | /* Note that the GTK port uses gdk to display the icon, so Emacs need |
| 24 | not have XPM support compiled in. */ | 24 | not have XPM support compiled in. */ |
| 25 | #if (defined (HAVE_XPM) && defined (HAVE_X_WINDOWS)) || defined (USE_GTK) | 25 | #if (defined (HAVE_XPM) && defined (HAVE_X_WINDOWS)) || defined (USE_GTK) |
| 26 | static char * gnu_xpm_bits[] = { | 26 | static const char * gnu_xpm_bits[] = { |
| 27 | /* width height ncolors chars_per_pixel */ | 27 | /* width height ncolors chars_per_pixel */ |
| 28 | "32 32 255 2", | 28 | "32 32 255 2", |
| 29 | /* colors */ | 29 | /* colors */ |
diff --git a/src/keyboard.c b/src/keyboard.c index 9114e2dbbca..872f787c506 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -613,7 +613,7 @@ static Lisp_Object make_lispy_movement (struct frame *, Lisp_Object, | |||
| 613 | unsigned long); | 613 | unsigned long); |
| 614 | #endif | 614 | #endif |
| 615 | static Lisp_Object modify_event_symbol (int, unsigned, Lisp_Object, | 615 | static Lisp_Object modify_event_symbol (int, unsigned, Lisp_Object, |
| 616 | Lisp_Object, char **, | 616 | Lisp_Object, const char **, |
| 617 | Lisp_Object *, unsigned); | 617 | Lisp_Object *, unsigned); |
| 618 | static Lisp_Object make_lispy_switch_frame (Lisp_Object); | 618 | static Lisp_Object make_lispy_switch_frame (Lisp_Object); |
| 619 | static void save_getcjmp (jmp_buf); | 619 | static void save_getcjmp (jmp_buf); |
| @@ -4724,7 +4724,7 @@ static const int lispy_accent_codes[] = | |||
| 4724 | /* This is a list of Lisp names for special "accent" characters. | 4724 | /* This is a list of Lisp names for special "accent" characters. |
| 4725 | It parallels lispy_accent_codes. */ | 4725 | It parallels lispy_accent_codes. */ |
| 4726 | 4726 | ||
| 4727 | static char *lispy_accent_keys[] = | 4727 | static const char *lispy_accent_keys[] = |
| 4728 | { | 4728 | { |
| 4729 | "dead-circumflex", | 4729 | "dead-circumflex", |
| 4730 | "dead-grave", | 4730 | "dead-grave", |
| @@ -4751,7 +4751,7 @@ static char *lispy_accent_keys[] = | |||
| 4751 | #ifdef HAVE_NTGUI | 4751 | #ifdef HAVE_NTGUI |
| 4752 | #define FUNCTION_KEY_OFFSET 0x0 | 4752 | #define FUNCTION_KEY_OFFSET 0x0 |
| 4753 | 4753 | ||
| 4754 | char *lispy_function_keys[] = | 4754 | char const *lispy_function_keys[] = |
| 4755 | { | 4755 | { |
| 4756 | 0, /* 0 */ | 4756 | 0, /* 0 */ |
| 4757 | 4757 | ||
| @@ -4945,7 +4945,7 @@ char *lispy_function_keys[] = | |||
| 4945 | 4945 | ||
| 4946 | /* Some of these duplicate the "Media keys" on newer keyboards, | 4946 | /* Some of these duplicate the "Media keys" on newer keyboards, |
| 4947 | but they are delivered to the application in a different way. */ | 4947 | but they are delivered to the application in a different way. */ |
| 4948 | static char *lispy_multimedia_keys[] = | 4948 | static const char *lispy_multimedia_keys[] = |
| 4949 | { | 4949 | { |
| 4950 | 0, | 4950 | 0, |
| 4951 | "browser-back", | 4951 | "browser-back", |
| @@ -5009,7 +5009,7 @@ static char *lispy_multimedia_keys[] = | |||
| 5009 | the XK_kana_A case below. */ | 5009 | the XK_kana_A case below. */ |
| 5010 | #if 0 | 5010 | #if 0 |
| 5011 | #ifdef XK_kana_A | 5011 | #ifdef XK_kana_A |
| 5012 | static char *lispy_kana_keys[] = | 5012 | static const char *lispy_kana_keys[] = |
| 5013 | { | 5013 | { |
| 5014 | /* X Keysym value */ | 5014 | /* X Keysym value */ |
| 5015 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x400 .. 0x40f */ | 5015 | 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[] = | |||
| 5048 | 5048 | ||
| 5049 | /* You'll notice that this table is arranged to be conveniently | 5049 | /* You'll notice that this table is arranged to be conveniently |
| 5050 | indexed by X Windows keysym values. */ | 5050 | indexed by X Windows keysym values. */ |
| 5051 | static char *lispy_function_keys[] = | 5051 | static const char *lispy_function_keys[] = |
| 5052 | { | 5052 | { |
| 5053 | /* X Keysym value */ | 5053 | /* X Keysym value */ |
| 5054 | 5054 | ||
| @@ -5134,7 +5134,7 @@ static char *lispy_function_keys[] = | |||
| 5134 | /* ISO 9995 Function and Modifier Keys; the first byte is 0xFE. */ | 5134 | /* ISO 9995 Function and Modifier Keys; the first byte is 0xFE. */ |
| 5135 | #define ISO_FUNCTION_KEY_OFFSET 0xfe00 | 5135 | #define ISO_FUNCTION_KEY_OFFSET 0xfe00 |
| 5136 | 5136 | ||
| 5137 | static char *iso_lispy_function_keys[] = | 5137 | static const char *iso_lispy_function_keys[] = |
| 5138 | { | 5138 | { |
| 5139 | 0, 0, 0, 0, 0, 0, 0, 0, /* 0xfe00 */ | 5139 | 0, 0, 0, 0, 0, 0, 0, 0, /* 0xfe00 */ |
| 5140 | 0, 0, 0, 0, 0, 0, 0, 0, /* 0xfe08 */ | 5140 | 0, 0, 0, 0, 0, 0, 0, 0, /* 0xfe08 */ |
| @@ -5157,14 +5157,14 @@ static char *iso_lispy_function_keys[] = | |||
| 5157 | 5157 | ||
| 5158 | Lisp_Object Vlispy_mouse_stem; | 5158 | Lisp_Object Vlispy_mouse_stem; |
| 5159 | 5159 | ||
| 5160 | static char *lispy_wheel_names[] = | 5160 | static const char *lispy_wheel_names[] = |
| 5161 | { | 5161 | { |
| 5162 | "wheel-up", "wheel-down", "wheel-left", "wheel-right" | 5162 | "wheel-up", "wheel-down", "wheel-left", "wheel-right" |
| 5163 | }; | 5163 | }; |
| 5164 | 5164 | ||
| 5165 | /* drag-n-drop events are generated when a set of selected files are | 5165 | /* drag-n-drop events are generated when a set of selected files are |
| 5166 | dragged from another application and dropped onto an Emacs window. */ | 5166 | dragged from another application and dropped onto an Emacs window. */ |
| 5167 | static char *lispy_drag_n_drop_names[] = | 5167 | static const char *lispy_drag_n_drop_names[] = |
| 5168 | { | 5168 | { |
| 5169 | "drag-n-drop" | 5169 | "drag-n-drop" |
| 5170 | }; | 5170 | }; |
| @@ -5175,7 +5175,7 @@ Lisp_Object Qup, Qdown, Qbottom, Qend_scroll; | |||
| 5175 | Lisp_Object Qtop, Qratio; | 5175 | Lisp_Object Qtop, Qratio; |
| 5176 | 5176 | ||
| 5177 | /* An array of scroll bar parts, indexed by an enum scroll_bar_part value. */ | 5177 | /* An array of scroll bar parts, indexed by an enum scroll_bar_part value. */ |
| 5178 | Lisp_Object *scroll_bar_parts[] = { | 5178 | const Lisp_Object *scroll_bar_parts[] = { |
| 5179 | &Qabove_handle, &Qhandle, &Qbelow_handle, | 5179 | &Qabove_handle, &Qhandle, &Qbelow_handle, |
| 5180 | &Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio | 5180 | &Qup, &Qdown, &Qtop, &Qbottom, &Qend_scroll, &Qratio |
| 5181 | }; | 5181 | }; |
| @@ -6542,7 +6542,7 @@ reorder_modifiers (Lisp_Object symbol) | |||
| 6542 | 6542 | ||
| 6543 | static Lisp_Object | 6543 | static Lisp_Object |
| 6544 | modify_event_symbol (int symbol_num, unsigned int modifiers, Lisp_Object symbol_kind, | 6544 | modify_event_symbol (int symbol_num, unsigned int modifiers, Lisp_Object symbol_kind, |
| 6545 | Lisp_Object name_alist_or_stem, char **name_table, | 6545 | Lisp_Object name_alist_or_stem, const char **name_table, |
| 6546 | Lisp_Object *symbol_table, unsigned int table_size) | 6546 | Lisp_Object *symbol_table, unsigned int table_size) |
| 6547 | { | 6547 | { |
| 6548 | Lisp_Object value; | 6548 | Lisp_Object value; |
diff --git a/src/term.c b/src/term.c index 6fb26c77851..96f9ce02f9b 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -1266,7 +1266,7 @@ struct fkey_table { | |||
| 1266 | other keys (as on the IBM PC keyboard) they get overridden. | 1266 | other keys (as on the IBM PC keyboard) they get overridden. |
| 1267 | */ | 1267 | */ |
| 1268 | 1268 | ||
| 1269 | static struct fkey_table keys[] = | 1269 | static const struct fkey_table keys[] = |
| 1270 | { | 1270 | { |
| 1271 | {"kh", "home"}, /* termcap */ | 1271 | {"kh", "home"}, /* termcap */ |
| 1272 | {"kl", "left"}, /* termcap */ | 1272 | {"kl", "left"}, /* termcap */ |
| @@ -2906,7 +2906,6 @@ term_mouse_highlight (struct frame *f, int x, int y) | |||
| 2906 | /* Look for a `help-echo' property. */ | 2906 | /* Look for a `help-echo' property. */ |
| 2907 | { | 2907 | { |
| 2908 | Lisp_Object help; | 2908 | Lisp_Object help; |
| 2909 | extern Lisp_Object Qhelp_echo; | ||
| 2910 | 2909 | ||
| 2911 | /* Check overlays first. */ | 2910 | /* Check overlays first. */ |
| 2912 | help = Qnil; | 2911 | help = Qnil; |
diff --git a/src/xfns.c b/src/xfns.c index 7695f829804..ecf7e150b0c 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -762,10 +762,10 @@ xg_set_icon (FRAME_PTR f, Lisp_Object file) | |||
| 762 | } | 762 | } |
| 763 | 763 | ||
| 764 | int | 764 | int |
| 765 | xg_set_icon_from_xpm_data (FRAME_PTR f, char **data) | 765 | xg_set_icon_from_xpm_data (FRAME_PTR f, const char **data) |
| 766 | { | 766 | { |
| 767 | int result = 0; | 767 | int result = 0; |
| 768 | GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) data); | 768 | GdkPixbuf *pixbuf = gdk_pixbuf_new_from_xpm_data (data); |
| 769 | 769 | ||
| 770 | if (!pixbuf) | 770 | if (!pixbuf) |
| 771 | return 0; | 771 | return 0; |
diff --git a/src/xterm.h b/src/xterm.h index 69c8ec22a73..972bfb50dc3 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -1062,7 +1062,7 @@ extern Lisp_Object x_get_focus_frame (struct frame *); | |||
| 1062 | 1062 | ||
| 1063 | #ifdef USE_GTK | 1063 | #ifdef USE_GTK |
| 1064 | extern int xg_set_icon (struct frame *, Lisp_Object); | 1064 | extern int xg_set_icon (struct frame *, Lisp_Object); |
| 1065 | extern int xg_set_icon_from_xpm_data (struct frame *, char**); | 1065 | extern int xg_set_icon_from_xpm_data (struct frame *, const char**); |
| 1066 | #endif /* USE_GTK */ | 1066 | #endif /* USE_GTK */ |
| 1067 | 1067 | ||
| 1068 | extern void x_real_positions (struct frame *, int *, int *); | 1068 | extern void x_real_positions (struct frame *, int *, int *); |