summaryrefslogtreecommitdiff
path: root/src/font.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-09-06 01:04:49 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-09-06 01:04:49 -0700
commita864ef14570715dc3233fbbf2e9da7aa8f29729e (patch)
treed350c376998ae3bf0ef69f3d708f766e515a3465 /src/font.c
parent0699fc18a5ea00b9a6d64b0e0ebf33b4723beb10 (diff)
downloademacs-a864ef14570715dc3233fbbf2e9da7aa8f29729e.tar.gz
Use bool for booleans in font-related modules.
* font.c (font_intern_prop, font_style_to_value) (font_style_symbolic, font_parse_xlfd, font_parse_fcname) (generate_otf_features, font_check_otf_features, font_check_otf) (font_match_p, font_list_entities, font_at): * fontset.c (fontset_id_valid_p, reorder_font_vector (fontset_find_font, Fset_fontset_font) (face_suitable_for_char_p) [0]: * ftfont.c (fc_initialized, ftfont_get_open_type_spec) (ftfont_open, ftfont_text_extents, ftfont_check_otf): (m17n_flt_initialized, ftfont_shape_by_flt): * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw): * nsfont.m (nsfont_draw): * w32font.c (w32font_draw): * w32term.c (x_draw_glyphless_glyph_string_foreground): Use bool for booleans. * font.h: Adjust to above API changes. (struct font, struct font_driver, struct font_driver_list): Use bool for booleans. (struct font): Remove useless member encoding_type. All users removed. * fontset.c, xftfont.c: Omit unnecessary static decls.
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/src/font.c b/src/font.c
index cf9964f08f3..49a09bced28 100644
--- a/src/font.c
+++ b/src/font.c
@@ -216,13 +216,12 @@ static int num_font_drivers;
/* Return a Lispy value of a font property value at STR and LEN bytes.
- If STR is "*", return nil.
- If FORCE_SYMBOL is zero and all characters in STR are digits,
- return an integer. Otherwise, return a symbol interned from
- STR. */
+ If STR is "*", return nil. If FORCE_SYMBOL, or if STR does not
+ consist entirely of one or more digits, return a symbol interned
+ from STR. Otherwise, return an integer. */
Lisp_Object
-font_intern_prop (const char *str, ptrdiff_t len, int force_symbol)
+font_intern_prop (const char *str, ptrdiff_t len, bool force_symbol)
{
ptrdiff_t i;
Lisp_Object tem;
@@ -306,7 +305,8 @@ font_pixel_size (FRAME_PTR f, Lisp_Object spec)
VAL is an integer. */
int
-font_style_to_value (enum font_property_index prop, Lisp_Object val, int noerror)
+font_style_to_value (enum font_property_index prop, Lisp_Object val,
+ bool noerror)
{
Lisp_Object table = AREF (font_style_table, prop - FONT_WEIGHT_INDEX);
int len;
@@ -385,7 +385,8 @@ font_style_to_value (enum font_property_index prop, Lisp_Object val, int noerror
}
Lisp_Object
-font_style_symbolic (Lisp_Object font, enum font_property_index prop, int for_face)
+font_style_symbolic (Lisp_Object font, enum font_property_index prop,
+ bool for_face)
{
Lisp_Object val = AREF (font, prop);
Lisp_Object table, elt;
@@ -1101,7 +1102,7 @@ font_parse_xlfd (char *name, ptrdiff_t len, Lisp_Object font)
}
else
{
- int wild_card_found = 0;
+ bool wild_card_found = 0;
Lisp_Object prop[XLFD_LAST_INDEX];
if (FONT_ENTITY_P (font))
@@ -1337,7 +1338,7 @@ font_parse_fcname (char *name, ptrdiff_t len, Lisp_Object font)
}
else if (*p == '-')
{
- int decimal = 0, size_found = 1;
+ bool decimal = 0, size_found = 1;
for (q = p + 1; *q && *q != ':'; q++)
if (! c_isdigit (*q))
{
@@ -1938,7 +1939,7 @@ generate_otf_features (Lisp_Object spec, char *features)
{
Lisp_Object val;
char *p;
- int asterisk;
+ bool asterisk;
p = features;
*p = '\0';
@@ -2302,11 +2303,12 @@ font_update_sort_order (int *order)
}
}
-static int
-font_check_otf_features (Lisp_Object script, Lisp_Object langsys, Lisp_Object features, Lisp_Object table)
+static bool
+font_check_otf_features (Lisp_Object script, Lisp_Object langsys,
+ Lisp_Object features, Lisp_Object table)
{
Lisp_Object val;
- int negative;
+ bool negative;
table = assq_no_quit (script, table);
if (NILP (table))
@@ -2342,7 +2344,7 @@ font_check_otf_features (Lisp_Object script, Lisp_Object langsys, Lisp_Object fe
/* Check if OTF_CAPABILITY satisfies SPEC (otf-spec). */
-static int
+static bool
font_check_otf (Lisp_Object spec, Lisp_Object otf_capability)
{
Lisp_Object script, langsys = Qnil, gsub = Qnil, gpos = Qnil;
@@ -2376,7 +2378,7 @@ font_check_otf (Lisp_Object spec, Lisp_Object otf_capability)
/* Check if FONT (font-entity or font-object) matches with the font
specification SPEC. */
-int
+bool
font_match_p (Lisp_Object spec, Lisp_Object font)
{
Lisp_Object prop[FONT_SPEC_MAX], *props;
@@ -2694,7 +2696,7 @@ font_list_entities (Lisp_Object frame, Lisp_Object spec)
Lisp_Object ftype, val;
Lisp_Object list = Qnil;
int size;
- int need_filtering = 0;
+ bool need_filtering = 0;
int i;
eassert (FONT_SPEC_P (spec));
@@ -3036,15 +3038,14 @@ font_select_entity (Lisp_Object frame, Lisp_Object entities, Lisp_Object *attrs,
{
Lisp_Object font_entity;
Lisp_Object prefer;
- int result, i;
+ int i;
FRAME_PTR f = XFRAME (frame);
if (NILP (XCDR (entities))
&& ASIZE (XCAR (entities)) == 1)
{
font_entity = AREF (XCAR (entities), 0);
- if (c < 0
- || (result = font_has_char (f, font_entity, c)) > 0)
+ if (c < 0 || font_has_char (f, font_entity, c) > 0)
return font_entity;
return Qnil;
}
@@ -3618,7 +3619,7 @@ font_at (int c, ptrdiff_t pos, struct face *face, struct window *w,
Lisp_Object string)
{
FRAME_PTR f;
- int multibyte;
+ bool multibyte;
Lisp_Object font_object;
multibyte = (NILP (string)