]> code.delx.au - gnu-emacs/blobdiff - src/xfont.c
upstream
[gnu-emacs] / src / xfont.c
index 072bce7bb0a94710917eae3f99e5433c44d923f9..7755b780815e45afead448f8f9bd7dac6db9f7ef 100644 (file)
@@ -46,7 +46,6 @@ struct xfont_info
 };
 
 /* Prototypes of support functions.  */
-extern void x_clear_errors (Display *);
 
 static XCharStruct *xfont_get_pcm (XFontStruct *, XChar2b *);
 
@@ -127,7 +126,7 @@ static int xfont_has_char (Lisp_Object, int);
 static unsigned xfont_encode_char (struct font *, int);
 static int xfont_text_extents (struct font *, unsigned *, int,
                                struct font_metrics *);
-static int xfont_draw (struct glyph_string *, int, int, int, int, int);
+static int xfont_draw (struct glyph_string *, int, int, int, int, bool);
 static int xfont_check (FRAME_PTR, struct font *);
 
 struct font_driver xfont_driver =
@@ -218,9 +217,9 @@ xfont_encode_coding_xlfd (char *xlfd)
 /* Check if CHARS (cons or vector) is supported by XFONT whose
    encoding charset is ENCODING (XFONT is NULL) or by a font whose
    registry corresponds to ENCODING and REPERTORY.
-   Return 1 if supported, return 0 otherwise.  */
+   Return true if supported.  */
 
-static int
+static bool
 xfont_chars_supported (Lisp_Object chars, XFontStruct *xfont,
                       struct charset *encoding, struct charset *repertory)
 {
@@ -390,7 +389,7 @@ xfont_list_pattern (Display *display, const char *pattern,
       Lisp_Object scripts = Qnil;
 
       for (i = 0; i < ASIZE (xfont_scratch_props); i++)
-       props[i] = Qnil;
+       ASET (xfont_scratch_props, i, Qnil);
       for (i = 0; i < num_fonts; i++)
        indices[i] = names[i];
       qsort (indices, num_fonts, sizeof (char *), compare_font_names);
@@ -467,9 +466,9 @@ xfont_list_pattern (Display *display, const char *pattern,
                      word_size * 7)
              || ! EQ (AREF (entity, FONT_SPACING_INDEX), props[7]))
            {
-             memcpy (props, aref_addr (entity, FONT_FOUNDRY_INDEX),
-                     word_size * 7);
-             props[7] = AREF (entity, FONT_SPACING_INDEX);
+             vcopy (xfont_scratch_props, 0,
+                    aref_addr (entity, FONT_FOUNDRY_INDEX), 7);
+             ASET (xfont_scratch_props, 7, AREF (entity, FONT_SPACING_INDEX));
              scripts = xfont_supported_scripts (display, indices[i],
                                                 xfont_scratch_props, encoding);
            }
@@ -1020,7 +1019,8 @@ xfont_text_extents (struct font *font, unsigned int *code, int nglyphs, struct f
 }
 
 static int
-xfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_background)
+xfont_draw (struct glyph_string *s, int from, int to, int x, int y,
+            bool with_background)
 {
   XFontStruct *xfont = ((struct xfont_info *) s->font)->xfont;
   int len = to - from;
@@ -1041,7 +1041,7 @@ xfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_bac
       for (i = 0; i < len ; i++)
        str[i] = XCHAR2B_BYTE2 (s->char2b + from + i);
       BLOCK_INPUT;
-      if (with_background > 0)
+      if (with_background)
        {
          if (s->padding_p)
            for (i = 0; i < len; i++)
@@ -1067,7 +1067,7 @@ xfont_draw (struct glyph_string *s, int from, int to, int x, int y, int with_bac
     }
 
   BLOCK_INPUT;
-  if (with_background > 0)
+  if (with_background)
     {
       if (s->padding_p)
        for (i = 0; i < len; i++)