aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2013-09-17 00:06:42 -0700
committerPaul Eggert2013-09-17 00:06:42 -0700
commitb7ad2f7401a22e6189d1b0a0523a3f98d1f70be5 (patch)
tree70c6aeab8f2284f02e7cfb2b26bf61471d936c3c /src
parent1893694e3e96560a1b750e257f774e23d3b06836 (diff)
downloademacs-b7ad2f7401a22e6189d1b0a0523a3f98d1f70be5.tar.gz
emacs-b7ad2f7401a22e6189d1b0a0523a3f98d1f70be5.zip
Don't overuse 'const' in types of locals.
* bidi.c (bidi_count_bytes): * gtkutil.c, gtkutil.h (xg_event_is_for_menubar) (xg_event_is_for_scrollbar): * xselect.c (x_handle_property_notify) (x_handle_selection_notify, x_handle_dnd_message): * xsettings.c, xsettings.h (xft_settings_event): * xterm.c (x_handle_net_wm_state, handle_one_event) (x_menubar_window_to_frame, x_detect_focus_change) (construct_mouse_click, note_mouse_movement) (x_scroll_bar_to_input_event, x_scroll_bar_expose) (x_scroll_bar_handle_click, x_scroll_bar_note_movement) (handle_one_xevent, x_handle_net_wm_state): * xterm.h (x_handle_property_notify, x_handle_selection_notify) (x_handle_dnd_message): Avoid unnecessary 'const', typically the second 'const' in 'const foo * const arg', a 'const' that does not affect the API and doesn't significantly help the human reader.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog21
-rw-r--r--src/bidi.c4
-rw-r--r--src/gtkutil.c4
-rw-r--r--src/gtkutil.h4
-rw-r--r--src/xselect.c6
-rw-r--r--src/xsettings.c2
-rw-r--r--src/xsettings.h2
-rw-r--r--src/xterm.c28
-rw-r--r--src/xterm.h6
9 files changed, 49 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f1ba30f023b..d477e3d2ae3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,24 @@
12013-09-17 Paul Eggert <eggert@cs.ucla.edu>
2
3 Don't overuse 'const' in types of locals.
4 * bidi.c (bidi_count_bytes):
5 * gtkutil.c, gtkutil.h (xg_event_is_for_menubar)
6 (xg_event_is_for_scrollbar):
7 * xselect.c (x_handle_property_notify)
8 (x_handle_selection_notify, x_handle_dnd_message):
9 * xsettings.c, xsettings.h (xft_settings_event):
10 * xterm.c (x_handle_net_wm_state, handle_one_event)
11 (x_menubar_window_to_frame, x_detect_focus_change)
12 (construct_mouse_click, note_mouse_movement)
13 (x_scroll_bar_to_input_event, x_scroll_bar_expose)
14 (x_scroll_bar_handle_click, x_scroll_bar_note_movement)
15 (handle_one_xevent, x_handle_net_wm_state):
16 * xterm.h (x_handle_property_notify, x_handle_selection_notify)
17 (x_handle_dnd_message):
18 Avoid unnecessary 'const', typically the second 'const' in
19 'const foo * const arg', a 'const' that does not affect the API
20 and doesn't significantly help the human reader.
21
12013-09-17 Dmitry Antipov <dmantipov@yandex.ru> 222013-09-17 Dmitry Antipov <dmantipov@yandex.ru>
2 23
3 * image.c (fn_g_type_init) [WINDOWSNT]: Define and load 24 * image.c (fn_g_type_init) [WINDOWSNT]: Define and load
diff --git a/src/bidi.c b/src/bidi.c
index 7d082a94997..dc905cd9e5f 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -870,8 +870,8 @@ bidi_line_init (struct bidi_it *bidi_it)
870 are zero-based character positions in S, BEGBYTE is byte position 870 are zero-based character positions in S, BEGBYTE is byte position
871 corresponding to BEG. UNIBYTE means S is a unibyte string. */ 871 corresponding to BEG. UNIBYTE means S is a unibyte string. */
872static ptrdiff_t 872static ptrdiff_t
873bidi_count_bytes (const unsigned char *s, const ptrdiff_t beg, 873bidi_count_bytes (const unsigned char *s, ptrdiff_t beg,
874 const ptrdiff_t begbyte, const ptrdiff_t end, bool unibyte) 874 ptrdiff_t begbyte, ptrdiff_t end, bool unibyte)
875{ 875{
876 ptrdiff_t pos = beg; 876 ptrdiff_t pos = beg;
877 const unsigned char *p = s + begbyte, *start = p; 877 const unsigned char *p = s + begbyte, *start = p;
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 57b7b58d9d6..e20d01521f0 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3409,7 +3409,7 @@ free_frame_menubar (struct frame *f)
3409} 3409}
3410 3410
3411bool 3411bool
3412xg_event_is_for_menubar (struct frame *f, const XEvent * const event) 3412xg_event_is_for_menubar (struct frame *f, const XEvent *event)
3413{ 3413{
3414 struct x_output *x = f->output_data.x; 3414 struct x_output *x = f->output_data.x;
3415 GList *iter; 3415 GList *iter;
@@ -3861,7 +3861,7 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
3861 frame. This function does additional checks. */ 3861 frame. This function does additional checks. */
3862 3862
3863bool 3863bool
3864xg_event_is_for_scrollbar (struct frame *f, const XEvent * const event) 3864xg_event_is_for_scrollbar (struct frame *f, const XEvent *event)
3865{ 3865{
3866 bool retval = 0; 3866 bool retval = 0;
3867 3867
diff --git a/src/gtkutil.h b/src/gtkutil.h
index 57971cf4a38..1c26d2aa44b 100644
--- a/src/gtkutil.h
+++ b/src/gtkutil.h
@@ -105,7 +105,7 @@ extern void xg_modify_menubar_widgets (GtkWidget *menubar,
105 105
106extern void xg_update_frame_menubar (struct frame *f); 106extern void xg_update_frame_menubar (struct frame *f);
107 107
108extern bool xg_event_is_for_menubar (struct frame *, const XEvent * const); 108extern bool xg_event_is_for_menubar (struct frame *, const XEvent *);
109 109
110extern bool xg_have_tear_offs (void); 110extern bool xg_have_tear_offs (void);
111 111
@@ -129,7 +129,7 @@ extern void xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar,
129 int portion, 129 int portion,
130 int position, 130 int position,
131 int whole); 131 int whole);
132extern bool xg_event_is_for_scrollbar (struct frame *, const XEvent * const); 132extern bool xg_event_is_for_scrollbar (struct frame *, const XEvent *);
133extern int xg_get_default_scrollbar_width (void); 133extern int xg_get_default_scrollbar_width (void);
134 134
135extern void update_frame_tool_bar (struct frame *f); 135extern void update_frame_tool_bar (struct frame *f);
diff --git a/src/xselect.c b/src/xselect.c
index cec91e41e75..5eb263d8d0c 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1141,7 +1141,7 @@ wait_for_property_change (struct prop_location *location)
1141/* Called from XTread_socket in response to a PropertyNotify event. */ 1141/* Called from XTread_socket in response to a PropertyNotify event. */
1142 1142
1143void 1143void
1144x_handle_property_notify (const XPropertyEvent * const event) 1144x_handle_property_notify (const XPropertyEvent *event)
1145{ 1145{
1146 struct prop_location *rest; 1146 struct prop_location *rest;
1147 1147
@@ -1888,7 +1888,7 @@ clean_local_selection_data (Lisp_Object obj)
1888 We store t there if the reply is successful, lambda if not. */ 1888 We store t there if the reply is successful, lambda if not. */
1889 1889
1890void 1890void
1891x_handle_selection_notify (const XSelectionEvent * const event) 1891x_handle_selection_notify (const XSelectionEvent *event)
1892{ 1892{
1893 if (event->requestor != reading_selection_window) 1893 if (event->requestor != reading_selection_window)
1894 return; 1894 return;
@@ -2488,7 +2488,7 @@ FRAME is on. If FRAME is nil, the selected frame is used. */)
2488/* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. */ 2488/* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. */
2489 2489
2490int 2490int
2491x_handle_dnd_message (struct frame *f, const XClientMessageEvent * const event, 2491x_handle_dnd_message (struct frame *f, const XClientMessageEvent *event,
2492 struct x_display_info *dpyinfo, struct input_event *bufp) 2492 struct x_display_info *dpyinfo, struct input_event *bufp)
2493{ 2493{
2494 Lisp_Object vec; 2494 Lisp_Object vec;
diff --git a/src/xsettings.c b/src/xsettings.c
index 770cd8e4a56..bdf9f2876be 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -754,7 +754,7 @@ read_and_apply_settings (struct x_display_info *dpyinfo, int send_event_p)
754/* Check if EVENT for the display in DPYINFO is XSettings related. */ 754/* Check if EVENT for the display in DPYINFO is XSettings related. */
755 755
756void 756void
757xft_settings_event (struct x_display_info *dpyinfo, const XEvent * const event) 757xft_settings_event (struct x_display_info *dpyinfo, const XEvent *event)
758{ 758{
759 bool check_window_p = 0, apply_settings_p = 0; 759 bool check_window_p = 0, apply_settings_p = 0;
760 760
diff --git a/src/xsettings.h b/src/xsettings.h
index 4407ca7df92..a017c5d92d8 100644
--- a/src/xsettings.h
+++ b/src/xsettings.h
@@ -21,7 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
21#define XSETTINGS_H 21#define XSETTINGS_H
22 22
23extern void xsettings_initialize (struct x_display_info *); 23extern void xsettings_initialize (struct x_display_info *);
24extern void xft_settings_event (struct x_display_info *, const XEvent * const); 24extern void xft_settings_event (struct x_display_info *, const XEvent *);
25extern const char *xsettings_get_system_font (void); 25extern const char *xsettings_get_system_font (void);
26#ifdef USE_LUCID 26#ifdef USE_LUCID
27extern const char *xsettings_get_system_normal_font (void); 27extern const char *xsettings_get_system_normal_font (void);
diff --git a/src/xterm.c b/src/xterm.c
index 90e58c81f44..ba588157fc0 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -303,12 +303,12 @@ static void x_scroll_bar_report_motion (struct frame **, Lisp_Object *,
303 enum scroll_bar_part *, 303 enum scroll_bar_part *,
304 Lisp_Object *, Lisp_Object *, 304 Lisp_Object *, Lisp_Object *,
305 Time *); 305 Time *);
306static int x_handle_net_wm_state (struct frame *, const XPropertyEvent * const); 306static int x_handle_net_wm_state (struct frame *, const XPropertyEvent *);
307static void x_check_fullscreen (struct frame *); 307static void x_check_fullscreen (struct frame *);
308static void x_check_expected_move (struct frame *, int, int); 308static void x_check_expected_move (struct frame *, int, int);
309static void x_sync_with_move (struct frame *, int, int, int); 309static void x_sync_with_move (struct frame *, int, int, int);
310static int handle_one_xevent (struct x_display_info *, 310static int handle_one_xevent (struct x_display_info *,
311 const XEvent * const, int *, 311 const XEvent *, int *,
312 struct input_event *); 312 struct input_event *);
313#ifdef USE_GTK 313#ifdef USE_GTK
314static int x_dispatch_event (XEvent *, Display *); 314static int x_dispatch_event (XEvent *, Display *);
@@ -3462,7 +3462,7 @@ x_any_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
3462 3462
3463static struct frame * 3463static struct frame *
3464x_menubar_window_to_frame (struct x_display_info *dpyinfo, 3464x_menubar_window_to_frame (struct x_display_info *dpyinfo,
3465 const XEvent * const event) 3465 const XEvent *event)
3466{ 3466{
3467 Window wdesc = event->xany.window; 3467 Window wdesc = event->xany.window;
3468 Lisp_Object tail, frame; 3468 Lisp_Object tail, frame;
@@ -3544,7 +3544,7 @@ x_top_window_to_frame (struct x_display_info *dpyinfo, int wdesc)
3544 3544
3545static void 3545static void
3546x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame, 3546x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame,
3547 const XEvent * const event, struct input_event *bufp) 3547 const XEvent *event, struct input_event *bufp)
3548{ 3548{
3549 if (!frame) 3549 if (!frame)
3550 return; 3550 return;
@@ -3835,7 +3835,7 @@ x_get_keysym_name (int keysym)
3835 3835
3836static Lisp_Object 3836static Lisp_Object
3837construct_mouse_click (struct input_event *result, 3837construct_mouse_click (struct input_event *result,
3838 const XButtonEvent * const event, 3838 const XButtonEvent *event,
3839 struct frame *f) 3839 struct frame *f)
3840{ 3840{
3841 /* Make the event type NO_EVENT; we'll change that when we decide 3841 /* Make the event type NO_EVENT; we'll change that when we decide
@@ -3868,7 +3868,7 @@ static XMotionEvent last_mouse_motion_event;
3868static Lisp_Object last_mouse_motion_frame; 3868static Lisp_Object last_mouse_motion_frame;
3869 3869
3870static int 3870static int
3871note_mouse_movement (struct frame *frame, const XMotionEvent * const event) 3871note_mouse_movement (struct frame *frame, const XMotionEvent *event)
3872{ 3872{
3873 last_mouse_movement_time = event->time; 3873 last_mouse_movement_time = event->time;
3874 last_mouse_motion_event = *event; 3874 last_mouse_motion_event = *event;
@@ -4359,7 +4359,7 @@ x_send_scroll_bar_event (Lisp_Object window, int part, int portion, int whole)
4359 in *IEVENT. */ 4359 in *IEVENT. */
4360 4360
4361static void 4361static void
4362x_scroll_bar_to_input_event (const XEvent * const event, 4362x_scroll_bar_to_input_event (const XEvent *event,
4363 struct input_event *ievent) 4363 struct input_event *ievent)
4364{ 4364{
4365 XClientMessageEvent *ev = (XClientMessageEvent *) event; 4365 XClientMessageEvent *ev = (XClientMessageEvent *) event;
@@ -5504,7 +5504,7 @@ XTjudge_scroll_bars (struct frame *f)
5504 mark bits. */ 5504 mark bits. */
5505 5505
5506static void 5506static void
5507x_scroll_bar_expose (struct scroll_bar *bar, const XEvent * const event) 5507x_scroll_bar_expose (struct scroll_bar *bar, const XEvent *event)
5508{ 5508{
5509 Window w = bar->x_window; 5509 Window w = bar->x_window;
5510 struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window))); 5510 struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
@@ -5543,7 +5543,7 @@ x_scroll_bar_expose (struct scroll_bar *bar, const XEvent * const event)
5543 5543
5544static void 5544static void
5545x_scroll_bar_handle_click (struct scroll_bar *bar, 5545x_scroll_bar_handle_click (struct scroll_bar *bar,
5546 const XEvent * const event, 5546 const XEvent *event,
5547 struct input_event *emacs_event) 5547 struct input_event *emacs_event)
5548{ 5548{
5549 if (! WINDOWP (bar->window)) 5549 if (! WINDOWP (bar->window))
@@ -5602,7 +5602,7 @@ x_scroll_bar_handle_click (struct scroll_bar *bar,
5602 5602
5603static void 5603static void
5604x_scroll_bar_note_movement (struct scroll_bar *bar, 5604x_scroll_bar_note_movement (struct scroll_bar *bar,
5605 const XMotionEvent * const event) 5605 const XMotionEvent *event)
5606{ 5606{
5607 struct frame *f = XFRAME (XWINDOW (bar->window)->frame); 5607 struct frame *f = XFRAME (XWINDOW (bar->window)->frame);
5608 5608
@@ -5853,7 +5853,7 @@ static void xembed_send_message (struct frame *f, Time,
5853 5853
5854static int 5854static int
5855handle_one_xevent (struct x_display_info *dpyinfo, 5855handle_one_xevent (struct x_display_info *dpyinfo,
5856 const XEvent * const event, 5856 const XEvent *event,
5857 int *finish, struct input_event *hold_quit) 5857 int *finish, struct input_event *hold_quit)
5858{ 5858{
5859 union { 5859 union {
@@ -6078,7 +6078,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
6078 goto OTHER; 6078 goto OTHER;
6079#endif /* USE_X_TOOLKIT */ 6079#endif /* USE_X_TOOLKIT */
6080 { 6080 {
6081 const XSelectionClearEvent * const eventp = &event->xselectionclear; 6081 const XSelectionClearEvent *eventp = &event->xselectionclear;
6082 6082
6083 inev.ie.kind = SELECTION_CLEAR_EVENT; 6083 inev.ie.kind = SELECTION_CLEAR_EVENT;
6084 SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display; 6084 SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
@@ -6094,7 +6094,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
6094 goto OTHER; 6094 goto OTHER;
6095#endif /* USE_X_TOOLKIT */ 6095#endif /* USE_X_TOOLKIT */
6096 { 6096 {
6097 const XSelectionRequestEvent * const eventp = &event->xselectionrequest; 6097 const XSelectionRequestEvent *eventp = &event->xselectionrequest;
6098 6098
6099 inev.ie.kind = SELECTION_REQUEST_EVENT; 6099 inev.ie.kind = SELECTION_REQUEST_EVENT;
6100 SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display; 6100 SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
@@ -8533,7 +8533,7 @@ XTfullscreen_hook (struct frame *f)
8533 8533
8534 8534
8535static int 8535static int
8536x_handle_net_wm_state (struct frame *f, const XPropertyEvent * const event) 8536x_handle_net_wm_state (struct frame *f, const XPropertyEvent *event)
8537{ 8537{
8538 int value = FULLSCREEN_NONE; 8538 int value = FULLSCREEN_NONE;
8539 Lisp_Object lval; 8539 Lisp_Object lval;
diff --git a/src/xterm.h b/src/xterm.h
index 8dc86784b09..28b72969972 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -941,8 +941,8 @@ extern void x_wait_for_event (struct frame *, int);
941 941
942/* Defined in xselect.c */ 942/* Defined in xselect.c */
943 943
944extern void x_handle_property_notify (const XPropertyEvent * const); 944extern void x_handle_property_notify (const XPropertyEvent *);
945extern void x_handle_selection_notify (const XSelectionEvent * const); 945extern void x_handle_selection_notify (const XSelectionEvent *);
946extern void x_handle_selection_event (struct input_event *); 946extern void x_handle_selection_event (struct input_event *);
947extern void x_clear_frame_selections (struct frame *); 947extern void x_clear_frame_selections (struct frame *);
948 948
@@ -954,7 +954,7 @@ extern void x_send_client_event (Lisp_Object display,
954 Lisp_Object values); 954 Lisp_Object values);
955 955
956extern int x_handle_dnd_message (struct frame *, 956extern int x_handle_dnd_message (struct frame *,
957 const XClientMessageEvent * const, 957 const XClientMessageEvent *,
958 struct x_display_info *, 958 struct x_display_info *,
959 struct input_event *); 959 struct input_event *);
960extern int x_check_property_data (Lisp_Object); 960extern int x_check_property_data (Lisp_Object);