diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-01-21 23:40:50 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-01-21 23:41:24 -0800 |
commit | b631bb57cf84f880186035f7158c19237856e2ce (patch) | |
tree | 4529a22056f61a1ee4efdaf98d1003c31e98b149 | |
parent | 7f4e7dd378c456b498c270b47b46aaae365a72ab (diff) |
Use bool for boolean in xfont.c, xftfont.c, xgselect.c
* xfont.c (xfont_driver, xfont_chars_supported)
(xfont_text_extents):
* xftfont.c (xftfont_get_colors, xftfont_open)
(xftfont_prepare_face, xftfont_done_face)
(xftfont_cached_font_ok):
* xgselect.c (xg_select):
Use bool for boolean.
-rw-r--r-- | src/ChangeLog | 9 | ||||
-rw-r--r-- | src/xfont.c | 8 | ||||
-rw-r--r-- | src/xftfont.c | 22 | ||||
-rw-r--r-- | src/xgselect.c | 4 |
4 files changed, 26 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8f23dd3833..a98c77f390 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,14 @@ 2015-01-22 Paul Eggert <eggert@cs.ucla.edu> + Use bool for boolean in xfont.c, xftfont.c, xgselect.c + * xfont.c (xfont_driver, xfont_chars_supported) + (xfont_text_extents): + * xftfont.c (xftfont_get_colors, xftfont_open) + (xftfont_prepare_face, xftfont_done_face) + (xftfont_cached_font_ok): + * xgselect.c (xg_select): + Use bool for boolean. + Don't downcase system diagnostics' first letters * fileio.c (report_file_errno): Don't downcase, and simplify. Fixes: bug#19642 diff --git a/src/xfont.c b/src/xfont.c index 10cc321b60..55053b9a42 100644 --- a/src/xfont.c +++ b/src/xfont.c @@ -132,7 +132,7 @@ static int xfont_check (struct frame *, struct font *); struct font_driver xfont_driver = { LISP_INITIALLY_ZERO, /* Qx */ - 0, /* case insensitive */ + false, /* case insensitive */ xfont_get_cache, xfont_list, xfont_match, @@ -269,7 +269,7 @@ xfont_chars_supported (Lisp_Object chars, XFontStruct *xfont, } return (i >= 0); } - return 0; + return false; } /* A hash table recoding which font supports which scripts. Each key @@ -983,7 +983,7 @@ xfont_text_extents (struct font *font, unsigned int *code, int i, width = 0; bool first; - for (i = 0, first = 1; i < nglyphs; i++) + for (i = 0, first = true; i < nglyphs; i++) { XChar2b char2b; static XCharStruct *pcm; @@ -1000,7 +1000,7 @@ xfont_text_extents (struct font *font, unsigned int *code, metrics->rbearing = pcm->rbearing; metrics->ascent = pcm->ascent; metrics->descent = pcm->descent; - first = 0; + first = false; } else { diff --git a/src/xftfont.c b/src/xftfont.c index 054b38e120..0e8b876f1d 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -85,7 +85,7 @@ xftfont_get_colors (struct frame *f, struct face *face, GC gc, else { XGCValues xgcv; - bool fg_done = 0, bg_done = 0; + bool fg_done = false, bg_done = false; block_input (); XGetGCValues (FRAME_X_DISPLAY (f), gc, @@ -93,15 +93,15 @@ xftfont_get_colors (struct frame *f, struct face *face, GC gc, if (xftface_info) { if (xgcv.foreground == face->foreground) - *fg = xftface_info->xft_fg, fg_done = 1; + *fg = xftface_info->xft_fg, fg_done = true; else if (xgcv.foreground == face->background) - *fg = xftface_info->xft_bg, fg_done = 1; + *fg = xftface_info->xft_bg, fg_done = true; if (! bg) - bg_done = 1; + bg_done = true; else if (xgcv.background == face->background) - *bg = xftface_info->xft_bg, bg_done = 1; + *bg = xftface_info->xft_bg, bg_done = true; else if (xgcv.background == face->foreground) - *bg = xftface_info->xft_fg, bg_done = 1; + *bg = xftface_info->xft_fg, bg_done = true; } if (! (fg_done & bg_done)) @@ -434,7 +434,7 @@ xftfont_open (struct frame *f, Lisp_Object entity, int pixel_size) font->baseline_offset = 0; font->relative_compose = 0; font->default_ascent = 0; - font->vertical_centering = 0; + font->vertical_centering = false; #ifdef FT_BDF_H if (! (ft_face->face_flags & FT_FACE_FLAG_SFNT)) { @@ -487,7 +487,7 @@ xftfont_prepare_face (struct frame *f, struct face *face) { struct xftface_info *xftface_info; -#if 0 +#if false /* This doesn't work if face->ascii_face doesn't use an Xft font. */ if (face != face->ascii_face) { @@ -507,7 +507,7 @@ xftfont_done_face (struct frame *f, struct face *face) { struct xftface_info *xftface_info; -#if 0 +#if false /* This doesn't work if face->ascii_face doesn't use an Xft font. */ if (face != face->ascii_face || ! face->extra) @@ -682,7 +682,7 @@ xftfont_cached_font_ok (struct frame *f, Lisp_Object font_object, Display *display = FRAME_X_DISPLAY (f); FcPattern *pat = FcPatternCreate (); FcBool b1, b2; - bool ok = 0; + bool ok = false; int i1, i2, r1, r2; xftfont_add_rendering_parameters (pat, entity); @@ -712,7 +712,7 @@ xftfont_cached_font_ok (struct frame *f, Lisp_Object font_object, r2 = FcPatternGetInteger (oldpat, FC_RGBA, 0, &i2); if (r1 != r2 || i1 != i2) goto out; - ok = 1; + ok = true; out: FcPatternDestroy (pat); return ok; diff --git a/src/xgselect.c b/src/xgselect.c index bb2226e07c..0b62d3e825 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -50,7 +50,7 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timespec const *tmop = timeout; GMainContext *context; - int have_wfds = wfds != NULL; + bool have_wfds = wfds != NULL; GPollFD gfds_buf[128]; GPollFD *gfds = gfds_buf; int gfds_size = ARRAYELTS (gfds_buf); @@ -96,7 +96,7 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds, { FD_SET (gfds[i].fd, &all_wfds); if (gfds[i].fd > max_fds) max_fds = gfds[i].fd; - have_wfds = 1; + have_wfds = true; } } |