1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-22 18:35:09 +00:00

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.
This commit is contained in:
Paul Eggert 2015-01-21 23:40:50 -08:00
parent 7f4e7dd378
commit b631bb57cf
4 changed files with 26 additions and 17 deletions

View File

@ -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

View File

@ -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
{

View File

@ -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;

View File

@ -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;
}
}