aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDmitry Antipov2013-08-01 11:33:58 +0400
committerDmitry Antipov2013-08-01 11:33:58 +0400
commit2f935d86fd7aa551e2c61d71c14a1c1a8b3ba707 (patch)
treee04789553000bbac7cc2e64c42262f8cd9d5bef9 /src
parent52b8a085f779789a9774b2890390df3758c8c302 (diff)
downloademacs-2f935d86fd7aa551e2c61d71c14a1c1a8b3ba707.tar.gz
emacs-2f935d86fd7aa551e2c61d71c14a1c1a8b3ba707.zip
* xterm.c (any_help_event_p, x_draw_glyph_string_background):
(x_display_ok): Use bool for booleans. (x_draw_glyph_string_background, cvt_string_to_pixel): (cvt_pixel_dtor): Drop unnecessary prototypes. * xterm.h (x_display_ok): Adjust prototype.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/xterm.c24
-rw-r--r--src/xterm.h2
3 files changed, 11 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4fb6a657939..8dc5fbbd01d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -17,6 +17,11 @@
17 This is better because this code always unconditionally skips 17 This is better because this code always unconditionally skips
18 non-X frames in Vframe_list and issues the only XFlush if we 18 non-X frames in Vframe_list and issues the only XFlush if we
19 have more than one X frame on the same X display. 19 have more than one X frame on the same X display.
20 (any_help_event_p, x_draw_glyph_string_background, x_display_ok):
21 Use bool for booleans.
22 (x_draw_glyph_string_background, cvt_string_to_pixel):
23 (cvt_pixel_dtor): Drop unnecessary prototypes.
24 * xterm.h (x_display_ok): Adjust prototype.
20 25
212013-07-31 Dmitry Antipov <dmantipov@yandex.ru> 262013-07-31 Dmitry Antipov <dmantipov@yandex.ru>
22 27
diff --git a/src/xterm.c b/src/xterm.c
index 99cfb029e64..83c6dd470d0 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -145,7 +145,7 @@ int use_xim = 0; /* configure --without-xim */
145/* Non-zero means that a HELP_EVENT has been generated since Emacs 145/* Non-zero means that a HELP_EVENT has been generated since Emacs
146 start. */ 146 start. */
147 147
148static int any_help_event_p; 148static bool any_help_event_p;
149 149
150/* Last window where we saw the mouse. Used by mouse-autoselect-window. */ 150/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
151static Lisp_Object last_window; 151static Lisp_Object last_window;
@@ -877,8 +877,6 @@ XTreset_terminal_modes (struct terminal *terminal)
877 877
878static void x_set_glyph_string_clipping (struct glyph_string *); 878static void x_set_glyph_string_clipping (struct glyph_string *);
879static void x_set_glyph_string_gc (struct glyph_string *); 879static void x_set_glyph_string_gc (struct glyph_string *);
880static void x_draw_glyph_string_background (struct glyph_string *,
881 int);
882static void x_draw_glyph_string_foreground (struct glyph_string *); 880static void x_draw_glyph_string_foreground (struct glyph_string *);
883static void x_draw_composite_glyph_string_foreground (struct glyph_string *); 881static void x_draw_composite_glyph_string_foreground (struct glyph_string *);
884static void x_draw_glyph_string_box (struct glyph_string *); 882static void x_draw_glyph_string_box (struct glyph_string *);
@@ -1163,7 +1161,7 @@ x_clear_glyph_string_rect (struct glyph_string *s, int x, int y, int w, int h)
1163 contains the first component of a composition. */ 1161 contains the first component of a composition. */
1164 1162
1165static void 1163static void
1166x_draw_glyph_string_background (struct glyph_string *s, int force_p) 1164x_draw_glyph_string_background (struct glyph_string *s, bool force_p)
1167{ 1165{
1168 /* Nothing to do if background has already been drawn or if it 1166 /* Nothing to do if background has already been drawn or if it
1169 shouldn't be drawn in the first place. */ 1167 shouldn't be drawn in the first place. */
@@ -1413,11 +1411,6 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
1413 1411
1414#ifdef USE_X_TOOLKIT 1412#ifdef USE_X_TOOLKIT
1415 1413
1416static Boolean cvt_string_to_pixel (Display *, XrmValue *, Cardinal *,
1417 XrmValue *, XrmValue *, XtPointer *);
1418static void cvt_pixel_dtor (XtAppContext, XrmValue *, XtPointer,
1419 XrmValue *, Cardinal *);
1420
1421#ifdef USE_LUCID 1414#ifdef USE_LUCID
1422 1415
1423/* Return the frame on which widget WIDGET is used.. Abort if frame 1416/* Return the frame on which widget WIDGET is used.. Abort if frame
@@ -9811,18 +9804,11 @@ get_bits_and_offset (long unsigned int mask, int *bits, int *offset)
9811/* Return 1 if display DISPLAY is available for use, 0 otherwise. 9804/* Return 1 if display DISPLAY is available for use, 0 otherwise.
9812 But don't permanently open it, just test its availability. */ 9805 But don't permanently open it, just test its availability. */
9813 9806
9814int 9807bool
9815x_display_ok (const char *display) 9808x_display_ok (const char *display)
9816{ 9809{
9817 int dpy_ok = 1; 9810 Display *dpy = XOpenDisplay (display);
9818 Display *dpy; 9811 return dpy ? (XCloseDisplay (dpy), 1) : 0;
9819
9820 dpy = XOpenDisplay (display);
9821 if (dpy)
9822 XCloseDisplay (dpy);
9823 else
9824 dpy_ok = 0;
9825 return dpy_ok;
9826} 9812}
9827 9813
9828#ifdef USE_GTK 9814#ifdef USE_GTK
diff --git a/src/xterm.h b/src/xterm.h
index 311b32c7930..bf1d40a2787 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -403,7 +403,7 @@ extern Lisp_Object x_display_name_list;
403extern struct x_display_info *x_display_info_for_display (Display *); 403extern struct x_display_info *x_display_info_for_display (Display *);
404 404
405extern struct x_display_info *x_term_init (Lisp_Object, char *, char *); 405extern struct x_display_info *x_term_init (Lisp_Object, char *, char *);
406extern int x_display_ok (const char *); 406extern bool x_display_ok (const char *);
407 407
408extern void select_visual (struct x_display_info *); 408extern void select_visual (struct x_display_info *);
409 409