+2013-09-17 Paul Eggert <eggert@cs.ucla.edu>
+
+ 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.
+
2013-09-17 Dmitry Antipov <dmantipov@yandex.ru>
* image.c (fn_g_type_init) [WINDOWSNT]: Define and load
are zero-based character positions in S, BEGBYTE is byte position
corresponding to BEG. UNIBYTE means S is a unibyte string. */
static ptrdiff_t
-bidi_count_bytes (const unsigned char *s, const ptrdiff_t beg,
- const ptrdiff_t begbyte, const ptrdiff_t end, bool unibyte)
+bidi_count_bytes (const unsigned char *s, ptrdiff_t beg,
+ ptrdiff_t begbyte, ptrdiff_t end, bool unibyte)
{
ptrdiff_t pos = beg;
const unsigned char *p = s + begbyte, *start = p;
}
bool
-xg_event_is_for_menubar (struct frame *f, const XEvent * const event)
+xg_event_is_for_menubar (struct frame *f, const XEvent *event)
{
struct x_output *x = f->output_data.x;
GList *iter;
frame. This function does additional checks. */
bool
-xg_event_is_for_scrollbar (struct frame *f, const XEvent * const event)
+xg_event_is_for_scrollbar (struct frame *f, const XEvent *event)
{
bool retval = 0;
extern void xg_update_frame_menubar (struct frame *f);
-extern bool xg_event_is_for_menubar (struct frame *, const XEvent * const);
+extern bool xg_event_is_for_menubar (struct frame *, const XEvent *);
extern bool xg_have_tear_offs (void);
int portion,
int position,
int whole);
-extern bool xg_event_is_for_scrollbar (struct frame *, const XEvent * const);
+extern bool xg_event_is_for_scrollbar (struct frame *, const XEvent *);
extern int xg_get_default_scrollbar_width (void);
extern void update_frame_tool_bar (struct frame *f);
/* Called from XTread_socket in response to a PropertyNotify event. */
void
-x_handle_property_notify (const XPropertyEvent * const event)
+x_handle_property_notify (const XPropertyEvent *event)
{
struct prop_location *rest;
We store t there if the reply is successful, lambda if not. */
void
-x_handle_selection_notify (const XSelectionEvent * const event)
+x_handle_selection_notify (const XSelectionEvent *event)
{
if (event->requestor != reading_selection_window)
return;
/* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. */
int
-x_handle_dnd_message (struct frame *f, const XClientMessageEvent * const event,
+x_handle_dnd_message (struct frame *f, const XClientMessageEvent *event,
struct x_display_info *dpyinfo, struct input_event *bufp)
{
Lisp_Object vec;
/* Check if EVENT for the display in DPYINFO is XSettings related. */
void
-xft_settings_event (struct x_display_info *dpyinfo, const XEvent * const event)
+xft_settings_event (struct x_display_info *dpyinfo, const XEvent *event)
{
bool check_window_p = 0, apply_settings_p = 0;
#define XSETTINGS_H
extern void xsettings_initialize (struct x_display_info *);
-extern void xft_settings_event (struct x_display_info *, const XEvent * const);
+extern void xft_settings_event (struct x_display_info *, const XEvent *);
extern const char *xsettings_get_system_font (void);
#ifdef USE_LUCID
extern const char *xsettings_get_system_normal_font (void);
enum scroll_bar_part *,
Lisp_Object *, Lisp_Object *,
Time *);
-static int x_handle_net_wm_state (struct frame *, const XPropertyEvent * const);
+static int x_handle_net_wm_state (struct frame *, const XPropertyEvent *);
static void x_check_fullscreen (struct frame *);
static void x_check_expected_move (struct frame *, int, int);
static void x_sync_with_move (struct frame *, int, int, int);
static int handle_one_xevent (struct x_display_info *,
- const XEvent * const, int *,
+ const XEvent *, int *,
struct input_event *);
#ifdef USE_GTK
static int x_dispatch_event (XEvent *, Display *);
static struct frame *
x_menubar_window_to_frame (struct x_display_info *dpyinfo,
- const XEvent * const event)
+ const XEvent *event)
{
Window wdesc = event->xany.window;
Lisp_Object tail, frame;
static void
x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame,
- const XEvent * const event, struct input_event *bufp)
+ const XEvent *event, struct input_event *bufp)
{
if (!frame)
return;
static Lisp_Object
construct_mouse_click (struct input_event *result,
- const XButtonEvent * const event,
+ const XButtonEvent *event,
struct frame *f)
{
/* Make the event type NO_EVENT; we'll change that when we decide
static Lisp_Object last_mouse_motion_frame;
static int
-note_mouse_movement (struct frame *frame, const XMotionEvent * const event)
+note_mouse_movement (struct frame *frame, const XMotionEvent *event)
{
last_mouse_movement_time = event->time;
last_mouse_motion_event = *event;
in *IEVENT. */
static void
-x_scroll_bar_to_input_event (const XEvent * const event,
+x_scroll_bar_to_input_event (const XEvent *event,
struct input_event *ievent)
{
XClientMessageEvent *ev = (XClientMessageEvent *) event;
mark bits. */
static void
-x_scroll_bar_expose (struct scroll_bar *bar, const XEvent * const event)
+x_scroll_bar_expose (struct scroll_bar *bar, const XEvent *event)
{
Window w = bar->x_window;
struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
static void
x_scroll_bar_handle_click (struct scroll_bar *bar,
- const XEvent * const event,
+ const XEvent *event,
struct input_event *emacs_event)
{
if (! WINDOWP (bar->window))
static void
x_scroll_bar_note_movement (struct scroll_bar *bar,
- const XMotionEvent * const event)
+ const XMotionEvent *event)
{
struct frame *f = XFRAME (XWINDOW (bar->window)->frame);
static int
handle_one_xevent (struct x_display_info *dpyinfo,
- const XEvent * const event,
+ const XEvent *event,
int *finish, struct input_event *hold_quit)
{
union {
goto OTHER;
#endif /* USE_X_TOOLKIT */
{
- const XSelectionClearEvent * const eventp = &event->xselectionclear;
+ const XSelectionClearEvent *eventp = &event->xselectionclear;
inev.ie.kind = SELECTION_CLEAR_EVENT;
SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
goto OTHER;
#endif /* USE_X_TOOLKIT */
{
- const XSelectionRequestEvent * const eventp = &event->xselectionrequest;
+ const XSelectionRequestEvent *eventp = &event->xselectionrequest;
inev.ie.kind = SELECTION_REQUEST_EVENT;
SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display;
static int
-x_handle_net_wm_state (struct frame *f, const XPropertyEvent * const event)
+x_handle_net_wm_state (struct frame *f, const XPropertyEvent *event)
{
int value = FULLSCREEN_NONE;
Lisp_Object lval;
/* Defined in xselect.c */
-extern void x_handle_property_notify (const XPropertyEvent * const);
-extern void x_handle_selection_notify (const XSelectionEvent * const);
+extern void x_handle_property_notify (const XPropertyEvent *);
+extern void x_handle_selection_notify (const XSelectionEvent *);
extern void x_handle_selection_event (struct input_event *);
extern void x_clear_frame_selections (struct frame *);
Lisp_Object values);
extern int x_handle_dnd_message (struct frame *,
- const XClientMessageEvent * const,
+ const XClientMessageEvent *,
struct x_display_info *,
struct input_event *);
extern int x_check_property_data (Lisp_Object);