From: Dmitry Antipov Date: Thu, 1 Aug 2013 07:33:58 +0000 (+0400) Subject: * xterm.c (any_help_event_p, x_draw_glyph_string_background): X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1688^2~50 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2f935d86fd7aa551e2c61d71c14a1c1a8b3ba707;p=emacs.git * 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index 4fb6a657939..8dc5fbbd01d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -17,6 +17,11 @@ This is better because this code always unconditionally skips non-X frames in Vframe_list and issues the only XFlush if we have more than one X frame on the same X display. + (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. 2013-07-31 Dmitry Antipov 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 */ /* Non-zero means that a HELP_EVENT has been generated since Emacs start. */ -static int any_help_event_p; +static bool any_help_event_p; /* Last window where we saw the mouse. Used by mouse-autoselect-window. */ static Lisp_Object last_window; @@ -877,8 +877,6 @@ XTreset_terminal_modes (struct terminal *terminal) static void x_set_glyph_string_clipping (struct glyph_string *); static void x_set_glyph_string_gc (struct glyph_string *); -static void x_draw_glyph_string_background (struct glyph_string *, - int); static void x_draw_glyph_string_foreground (struct glyph_string *); static void x_draw_composite_glyph_string_foreground (struct glyph_string *); static 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) contains the first component of a composition. */ static void -x_draw_glyph_string_background (struct glyph_string *s, int force_p) +x_draw_glyph_string_background (struct glyph_string *s, bool force_p) { /* Nothing to do if background has already been drawn or if it shouldn't be drawn in the first place. */ @@ -1413,11 +1411,6 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s) #ifdef USE_X_TOOLKIT -static Boolean cvt_string_to_pixel (Display *, XrmValue *, Cardinal *, - XrmValue *, XrmValue *, XtPointer *); -static void cvt_pixel_dtor (XtAppContext, XrmValue *, XtPointer, - XrmValue *, Cardinal *); - #ifdef USE_LUCID /* 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) /* Return 1 if display DISPLAY is available for use, 0 otherwise. But don't permanently open it, just test its availability. */ -int +bool x_display_ok (const char *display) { - int dpy_ok = 1; - Display *dpy; - - dpy = XOpenDisplay (display); - if (dpy) - XCloseDisplay (dpy); - else - dpy_ok = 0; - return dpy_ok; + Display *dpy = XOpenDisplay (display); + return dpy ? (XCloseDisplay (dpy), 1) : 0; } #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; extern struct x_display_info *x_display_info_for_display (Display *); extern struct x_display_info *x_term_init (Lisp_Object, char *, char *); -extern int x_display_ok (const char *); +extern bool x_display_ok (const char *); extern void select_visual (struct x_display_info *);