emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r113631: Avoid redundant Lisp_Object <-> struct fram


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r113631: Avoid redundant Lisp_Object <-> struct frame conversions in font API.
Date: Thu, 01 Aug 2013 10:56:34 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113631
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Thu 2013-08-01 14:33:25 +0400
message:
  Avoid redundant Lisp_Object <-> struct frame conversions in font API.
  * font.h (struct font_driver): Change list, match, and list_family
  functions to accept struct frame * as first arg.
  * font.c (font_score, font_compare, font_sort_entities): Remove
  prototypes.
  (font_sort_entities, font_list_entities, font_select_entity):
  (font_find_for_lface, Flist_fonts, Ffont_family_list): Adjust to
  match font API change.
  * xfont.c (xfont_list, xfont_match, xfont_list_family):
  * ftfont.c (ftfont_list, ftfont_match, ftfont_list_family):
  * ftxfont.c (ftxfont_list, ftxfont_match):
  * xftfont.c (xftfont_list, xftfont_match):
  * nsfont.m (nsfont_list, nsfont_match, nsfont_list_family):
  * w32font.c (w32font_list, w32font_match, w32font_list):
  (w32font_list_internal, w32_font_match_internal): Likewise.
  * xfaces.c (Fx_family_fonts): Adjust user.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/font.c                     font.c-20091113204419-o5vbwnq5f7feedwu-8540
  src/font.h                     font.h-20091113204419-o5vbwnq5f7feedwu-8541
  src/ftfont.c                   ftfont.c-20091113204419-o5vbwnq5f7feedwu-8542
  src/ftxfont.c                  ftxfont.c-20091113204419-o5vbwnq5f7feedwu-8544
  src/nsfont.m                   nsfont.m-20091113204419-o5vbwnq5f7feedwu-8748
  src/w32font.c                  w32font.c-20091113204419-o5vbwnq5f7feedwu-8545
  src/xfaces.c                   xfaces.c-20091113204419-o5vbwnq5f7feedwu-560
  src/xfont.c                    xfont.c-20091113204419-o5vbwnq5f7feedwu-8547
  src/xftfont.c                  xftfont.c-20091113204419-o5vbwnq5f7feedwu-8548
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-08-01 07:33:58 +0000
+++ b/src/ChangeLog     2013-08-01 10:33:25 +0000
@@ -1,5 +1,24 @@
 2013-08-01  Dmitry Antipov  <address@hidden>
 
+       Avoid redundant Lisp_Object <-> struct frame conversions in font API.
+       * font.h (struct font_driver): Change list, match, and list_family
+       functions to accept struct frame * as first arg.
+       * font.c (font_score, font_compare, font_sort_entities): Remove
+       prototypes.
+       (font_sort_entities, font_list_entities, font_select_entity):
+       (font_find_for_lface, Flist_fonts, Ffont_family_list): Adjust to
+       match font API change.
+       * xfont.c (xfont_list, xfont_match, xfont_list_family):
+       * ftfont.c (ftfont_list, ftfont_match, ftfont_list_family):
+       * ftxfont.c (ftxfont_list, ftxfont_match):
+       * xftfont.c (xftfont_list, xftfont_match):
+       * nsfont.m (nsfont_list, nsfont_match, nsfont_list_family):
+       * w32font.c (w32font_list, w32font_match, w32font_list):
+       (w32font_list_internal, w32_font_match_internal): Likewise.
+       * xfaces.c (Fx_family_fonts): Adjust user.
+
+2013-08-01  Dmitry Antipov  <address@hidden>
+
        Do not use pure Xism x_wm_set_icon_position in non-X ports.
        * frame.c (x_set_frame_parameters): Call to x_wm_set_icon_position
        only if HAVE_X_WINDOWS is in use.

=== modified file 'src/font.c'
--- a/src/font.c        2013-07-19 01:24:35 +0000
+++ b/src/font.c        2013-08-01 10:33:25 +0000
@@ -2037,11 +2037,6 @@
 
 /* Font sorting.  */
 
-static unsigned font_score (Lisp_Object, Lisp_Object *);
-static int font_compare (const void *, const void *);
-static Lisp_Object font_sort_entities (Lisp_Object, Lisp_Object,
-                                       Lisp_Object, int);
-
 static double
 font_rescale_ratio (Lisp_Object font_entity)
 {
@@ -2186,14 +2181,14 @@
    such a case.  */
 
 static Lisp_Object
-font_sort_entities (Lisp_Object list, Lisp_Object prefer, Lisp_Object frame, 
int best_only)
+font_sort_entities (Lisp_Object list, Lisp_Object prefer,
+                   struct frame *f, int best_only)
 {
   Lisp_Object prefer_prop[FONT_SPEC_MAX];
   int len, maxlen, i;
   struct font_sort_data *data;
   unsigned best_score;
   Lisp_Object best_entity;
-  struct frame *f = XFRAME (frame);
   Lisp_Object tail, vec IF_LINT (= Qnil);
   USE_SAFE_ALLOCA;
 
@@ -2201,7 +2196,7 @@
     prefer_prop[i] = AREF (prefer, i);
   if (FLOATP (prefer_prop[FONT_SIZE_INDEX]))
     prefer_prop[FONT_SIZE_INDEX]
-      = make_number (font_pixel_size (XFRAME (frame), prefer));
+      = make_number (font_pixel_size (f, prefer));
 
   if (NILP (XCDR (list)))
     {
@@ -2692,9 +2687,8 @@
    same font-driver.  */
 
 Lisp_Object
-font_list_entities (Lisp_Object frame, Lisp_Object spec)
+font_list_entities (struct frame *f, Lisp_Object spec)
 {
-  FRAME_PTR f = XFRAME (frame);
   struct font_driver_list *driver_list = f->font_driver_list;
   Lisp_Object ftype, val;
   Lisp_Object list = Qnil;
@@ -2738,7 +2732,7 @@
          {
            Lisp_Object copy;
 
-           val = driver_list->driver->list (frame, scratch_font_spec);
+           val = driver_list->driver->list (f, scratch_font_spec);
            if (NILP (val))
              val = zero_vector;
            else
@@ -2770,10 +2764,8 @@
 {
   struct font_driver_list *driver_list = f->font_driver_list;
   Lisp_Object ftype, size, entity;
-  Lisp_Object frame;
   Lisp_Object work = copy_font_spec (spec);
 
-  XSETFRAME (frame, f);
   ftype = AREF (spec, FONT_TYPE_INDEX);
   size = AREF (spec, FONT_SIZE_INDEX);
 
@@ -2797,7 +2789,7 @@
          entity = XCDR (entity);
        else
          {
-           entity = driver_list->driver->match (frame, work);
+           entity = driver_list->driver->match (f, work);
            copy = copy_font_spec (work);
            ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
            XSETCDR (cache, Fcons (Fcons (copy, entity), XCDR (cache)));
@@ -3039,12 +3031,12 @@
    supports C and is the best match for ATTRS and PIXEL_SIZE.  */
 
 static Lisp_Object
-font_select_entity (Lisp_Object frame, Lisp_Object entities, Lisp_Object 
*attrs, int pixel_size, int c)
+font_select_entity (struct frame *f, Lisp_Object entities,
+                   Lisp_Object *attrs, int pixel_size, int c)
 {
   Lisp_Object font_entity;
   Lisp_Object prefer;
   int i;
-  FRAME_PTR f = XFRAME (frame);
 
   if (NILP (XCDR (entities))
       && ASIZE (XCAR (entities)) == 1)
@@ -3075,7 +3067,7 @@
     FONT_SET_STYLE (prefer, FONT_WIDTH_INDEX, attrs[LFACE_SWIDTH_INDEX]);
   ASET (prefer, FONT_SIZE_INDEX, make_number (pixel_size));
 
-  return font_sort_entities (entities, prefer, frame, c);
+  return font_sort_entities (entities, prefer, f, c);
 }
 
 /* Return a font-entity that satisfies SPEC and is the best match for
@@ -3086,7 +3078,7 @@
 font_find_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec, int c)
 {
   Lisp_Object work;
-  Lisp_Object frame, entities, val;
+  Lisp_Object entities, val;
   Lisp_Object foundry[3], *family, registry[3], adstyle[3];
   int pixel_size;
   int i, j, k, l;
@@ -3118,7 +3110,6 @@
 
   work = copy_font_spec (spec);
   ASET (work, FONT_TYPE_INDEX, AREF (spec, FONT_TYPE_INDEX));
-  XSETFRAME (frame, f);
   pixel_size = font_pixel_size (f, spec);
   if (pixel_size == 0 && INTEGERP (attrs[LFACE_HEIGHT_INDEX]))
     {
@@ -3212,10 +3203,10 @@
              for (l = 0; SYMBOLP (adstyle[l]); l++)
                {
                  ASET (work, FONT_ADSTYLE_INDEX, adstyle[l]);
-                 entities = font_list_entities (frame, work);
+                 entities = font_list_entities (f, work);
                  if (! NILP (entities))
                    {
-                     val = font_select_entity (frame, entities,
+                     val = font_select_entity (f, entities,
                                                attrs, pixel_size, c);
                      if (! NILP (val))
                         return val;
@@ -4110,12 +4101,10 @@
 how close they are to PREFER.  */)
   (Lisp_Object font_spec, Lisp_Object frame, Lisp_Object num, Lisp_Object 
prefer)
 {
+  struct frame *f = decode_live_frame (frame);
   Lisp_Object vec, list;
   EMACS_INT n = 0;
 
-  if (NILP (frame))
-    frame = selected_frame;
-  CHECK_LIVE_FRAME (frame);
   CHECK_FONT_SPEC (font_spec);
   if (! NILP (num))
     {
@@ -4127,7 +4116,7 @@
   if (! NILP (prefer))
     CHECK_FONT_SPEC (prefer);
 
-  list = font_list_entities (frame, font_spec);
+  list = font_list_entities (f, font_spec);
   if (NILP (list))
     return Qnil;
   if (NILP (XCDR (list))
@@ -4135,7 +4124,7 @@
     return list1 (AREF (XCAR (list), 0));
 
   if (! NILP (prefer))
-    vec = font_sort_entities (list, prefer, frame, 0);
+    vec = font_sort_entities (list, prefer, f, 0);
   else
     vec = font_vconcat_entity_vectors (list);
   if (n == 0 || n >= ASIZE (vec))
@@ -4163,13 +4152,11 @@
   struct font_driver_list *driver_list;
   Lisp_Object list = Qnil;
 
-  XSETFRAME (frame, f);
-
   for (driver_list = f->font_driver_list; driver_list;
        driver_list = driver_list->next)
     if (driver_list->driver->list_family)
       {
-       Lisp_Object val = driver_list->driver->list_family (frame);
+       Lisp_Object val = driver_list->driver->list_family (f);
        Lisp_Object tail = list;
 
        for (; CONSP (val); val = XCDR (val))

=== modified file 'src/font.h'
--- a/src/font.h        2013-02-13 07:14:38 +0000
+++ b/src/font.h        2013-08-01 10:33:25 +0000
@@ -527,7 +527,7 @@
 
      This and the following `match' are the only APIs that allocate
      font-entities.  */
-  Lisp_Object (*list) (Lisp_Object frame, Lisp_Object font_spec);
+  Lisp_Object (*list) (struct frame *frame, Lisp_Object font_spec);
 
   /* Return a font-entity most closely matching with FONT_SPEC on
      FRAME.  Which font property to consider, and how to calculate the
@@ -536,12 +536,12 @@
 
      The properties that the font-entity has is the same as `list'
      method.  */
-  Lisp_Object (*match) (Lisp_Object frame, Lisp_Object font_spec);
+  Lisp_Object (*match) (struct frame *f, Lisp_Object spec);
 
   /* Optional.
      List available families.  The value is a list of family names
      (symbols).  */
-  Lisp_Object (*list_family) (Lisp_Object frame);
+  Lisp_Object (*list_family) (struct frame *f);
 
   /* Optional (if FONT_EXTRA_INDEX is not Lisp_Save_Value).
      Free FONT_EXTRA_INDEX field of FONT_ENTITY.  */
@@ -742,8 +742,7 @@
                                         bool for_face);
 
 extern bool font_match_p (Lisp_Object spec, Lisp_Object font);
-extern Lisp_Object font_list_entities (Lisp_Object frame,
-                                       Lisp_Object spec);
+extern Lisp_Object font_list_entities (struct frame *, Lisp_Object);
 
 extern Lisp_Object font_get_name (Lisp_Object font_object);
 extern Lisp_Object font_spec_from_name (Lisp_Object font_name);

=== modified file 'src/ftfont.c'
--- a/src/ftfont.c      2013-07-19 01:24:35 +0000
+++ b/src/ftfont.c      2013-08-01 10:33:25 +0000
@@ -494,9 +494,9 @@
 #endif /* HAVE_LIBOTF */
 
 static Lisp_Object ftfont_get_cache (FRAME_PTR);
-static Lisp_Object ftfont_list (Lisp_Object, Lisp_Object);
-static Lisp_Object ftfont_match (Lisp_Object, Lisp_Object);
-static Lisp_Object ftfont_list_family (Lisp_Object);
+static Lisp_Object ftfont_list (struct frame *, Lisp_Object);
+static Lisp_Object ftfont_match (struct frame *, Lisp_Object);
+static Lisp_Object ftfont_list_family (struct frame *);
 static Lisp_Object ftfont_open (FRAME_PTR, Lisp_Object, int);
 static void ftfont_close (FRAME_PTR, struct font *);
 static int ftfont_has_char (Lisp_Object, int);
@@ -884,7 +884,7 @@
 }
 
 static Lisp_Object
-ftfont_list (Lisp_Object frame, Lisp_Object spec)
+ftfont_list (struct frame *f, Lisp_Object spec)
 {
   Lisp_Object val = Qnil, family, adstyle;
   int i;
@@ -1080,7 +1080,7 @@
 }
 
 static Lisp_Object
-ftfont_match (Lisp_Object frame, Lisp_Object spec)
+ftfont_match (struct frame *f, Lisp_Object spec)
 {
   Lisp_Object entity = Qnil;
   FcPattern *pattern, *match = NULL;
@@ -1130,7 +1130,7 @@
 }
 
 static Lisp_Object
-ftfont_list_family (Lisp_Object frame)
+ftfont_list_family (struct frame *f)
 {
   Lisp_Object list = Qnil;
   FcPattern *pattern = NULL;

=== modified file 'src/ftxfont.c'
--- a/src/ftxfont.c     2013-01-01 09:11:05 +0000
+++ b/src/ftxfont.c     2013-08-01 10:33:25 +0000
@@ -226,9 +226,9 @@
 }
 
 static Lisp_Object
-ftxfont_list (Lisp_Object frame, Lisp_Object spec)
+ftxfont_list (struct frame *f, Lisp_Object spec)
 {
-  Lisp_Object list = ftfont_driver.list (frame, spec), tail;
+  Lisp_Object list = ftfont_driver.list (f, spec), tail;
 
   for (tail = list; CONSP (tail); tail = XCDR (tail))
     ASET (XCAR (tail), FONT_TYPE_INDEX, Qftx);
@@ -236,9 +236,9 @@
 }
 
 static Lisp_Object
-ftxfont_match (Lisp_Object frame, Lisp_Object spec)
+ftxfont_match (struct frame *f, Lisp_Object spec)
 {
-  Lisp_Object entity = ftfont_driver.match (frame, spec);
+  Lisp_Object entity = ftfont_driver.match (f, spec);
 
   if (VECTORP (entity))
     ASET (entity, FONT_TYPE_INDEX, Qftx);

=== modified file 'src/nsfont.m'
--- a/src/nsfont.m      2013-07-16 06:39:49 +0000
+++ b/src/nsfont.m      2013-08-01 10:33:25 +0000
@@ -620,9 +620,9 @@
 
 
 static Lisp_Object nsfont_get_cache (FRAME_PTR frame);
-static Lisp_Object nsfont_list (Lisp_Object frame, Lisp_Object font_spec);
-static Lisp_Object nsfont_match (Lisp_Object frame, Lisp_Object font_spec);
-static Lisp_Object nsfont_list_family (Lisp_Object frame);
+static Lisp_Object nsfont_list (struct frame *, Lisp_Object);
+static Lisp_Object nsfont_match (struct frame *, Lisp_Object);
+static Lisp_Object nsfont_list_family (struct frame *);
 static Lisp_Object nsfont_open (FRAME_PTR f, Lisp_Object font_entity,
                                  int pixel_size);
 static void nsfont_close (FRAME_PTR f, struct font *font);
@@ -679,9 +679,9 @@
    weight, slant, width, size (0 if scalable),
    dpi, spacing, avgwidth (0 if scalable)  */
 static Lisp_Object
-nsfont_list (Lisp_Object frame, Lisp_Object font_spec)
+nsfont_list (struct frame *f, Lisp_Object font_spec)
 {
-    return ns_findfonts (font_spec, NO);
+  return ns_findfonts (font_spec, NO);
 }
 
 
@@ -690,16 +690,16 @@
    `face-font-selection-order' is ignored here.
    Properties to be considered are same as for list(). */
 static Lisp_Object
-nsfont_match (Lisp_Object frame, Lisp_Object font_spec)
+nsfont_match (struct frame *f, Lisp_Object font_spec)
 {
-    return ns_findfonts(font_spec, YES);
+  return ns_findfonts (font_spec, YES);
 }
 
 
 /* List available families.  The value is a list of family names
    (symbols). */
 static Lisp_Object
-nsfont_list_family (Lisp_Object frame)
+nsfont_list_family (struct frame *f)
 {
   Lisp_Object list = Qnil;
   NSEnumerator *families;

=== modified file 'src/w32font.c'
--- a/src/w32font.c     2013-04-07 04:41:19 +0000
+++ b/src/w32font.c     2013-08-01 10:33:25 +0000
@@ -309,9 +309,9 @@
    is a vector of font-entities.  This is the sole API that
    allocates font-entities.  */
 static Lisp_Object
-w32font_list (Lisp_Object frame, Lisp_Object font_spec)
+w32font_list (struct frame *f, Lisp_Object font_spec)
 {
-  Lisp_Object fonts = w32font_list_internal (frame, font_spec, 0);
+  Lisp_Object fonts = w32font_list_internal (f, font_spec, 0);
   FONT_ADD_LOG ("w32font-list", font_spec, fonts);
   return fonts;
 }
@@ -321,9 +321,9 @@
    FRAME.  The closeness is determined by the font backend, thus
    `face-font-selection-order' is ignored here.  */
 static Lisp_Object
-w32font_match (Lisp_Object frame, Lisp_Object font_spec)
+w32font_match (struct frame *f, Lisp_Object font_spec)
 {
-  Lisp_Object entity = w32font_match_internal (frame, font_spec, 0);
+  Lisp_Object entity = w32font_match_internal (f, font_spec, 0);
   FONT_ADD_LOG ("w32font-match", font_spec, entity);
   return entity;
 }
@@ -332,12 +332,11 @@
    List available families.  The value is a list of family names
    (symbols).  */
 static Lisp_Object
-w32font_list_family (Lisp_Object frame)
+w32font_list_family (struct frame *f)
 {
   Lisp_Object list = Qnil;
   LOGFONT font_match_pattern;
   HDC dc;
-  FRAME_PTR f = XFRAME (frame);
 
   memset (&font_match_pattern, 0, sizeof (font_match_pattern));
   font_match_pattern.lfCharSet = DEFAULT_CHARSET;
@@ -811,15 +810,14 @@
    Additional parameter opentype_only restricts the returned fonts to
    opentype fonts, which can be used with the Uniscribe backend.  */
 Lisp_Object
-w32font_list_internal (Lisp_Object frame, Lisp_Object font_spec, int 
opentype_only)
+w32font_list_internal (struct frame *f, Lisp_Object font_spec, int 
opentype_only)
 {
   struct font_callback_data match_data;
   HDC dc;
-  FRAME_PTR f = XFRAME (frame);
 
   match_data.orig_font_spec = font_spec;
   match_data.list = Qnil;
-  match_data.frame = frame;
+  XSETFRAME (match_data.frame, f);
 
   memset (&match_data.pattern, 0, sizeof (LOGFONT));
   fill_in_logfont (f, &match_data.pattern, font_spec);
@@ -864,14 +862,13 @@
    Additional parameter opentype_only restricts the returned fonts to
    opentype fonts, which can be used with the Uniscribe backend.  */
 Lisp_Object
-w32font_match_internal (Lisp_Object frame, Lisp_Object font_spec, int 
opentype_only)
+w32font_match_internal (struct frame *f, Lisp_Object font_spec, int 
opentype_only)
 {
   struct font_callback_data match_data;
   HDC dc;
-  FRAME_PTR f = XFRAME (frame);
 
   match_data.orig_font_spec = font_spec;
-  match_data.frame = frame;
+  XSETFRAME (match_data.frame, f);
   match_data.list = Qnil;
 
   memset (&match_data.pattern, 0, sizeof (LOGFONT));
@@ -2114,7 +2111,7 @@
 list_all_matching_fonts (struct font_callback_data *match_data)
 {
   HDC dc;
-  Lisp_Object families = w32font_list_family (match_data->frame);
+  Lisp_Object families = w32font_list_family (XFRAME (match_data->frame));
   struct frame *f = XFRAME (match_data->frame);
 
   dc = get_frame_dc (f);

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2013-07-30 13:40:46 +0000
+++ b/src/xfaces.c      2013-08-01 10:33:25 +0000
@@ -1530,15 +1530,12 @@
   (Lisp_Object family, Lisp_Object frame)
 {
   Lisp_Object font_spec, list, *drivers, vec;
+  struct frame *f = decode_live_frame (frame);
   ptrdiff_t i, nfonts;
   EMACS_INT ndrivers;
   Lisp_Object result;
   USE_SAFE_ALLOCA;
 
-  if (NILP (frame))
-    frame = selected_frame;
-  CHECK_LIVE_FRAME (frame);
-
   font_spec = Ffont_spec (0, NULL);
   if (!NILP (family))
     {
@@ -1546,7 +1543,7 @@
       font_parse_family_registry (family, Qnil, font_spec);
     }
 
-  list = font_list_entities (frame, font_spec);
+  list = font_list_entities (f, font_spec);
   if (NILP (list))
     return Qnil;
 
@@ -1589,7 +1586,7 @@
       ASET (v, 0, AREF (font, FONT_FAMILY_INDEX));
       ASET (v, 1, FONT_WIDTH_SYMBOLIC (font));
       point = PIXEL_TO_POINT (XINT (AREF (font, FONT_SIZE_INDEX)) * 10,
-                             FRAME_RES_Y (XFRAME (frame)));
+                             FRAME_RES_Y (f));
       ASET (v, 2, make_number (point));
       ASET (v, 3, FONT_WEIGHT_SYMBOLIC (font));
       ASET (v, 4, FONT_SLANT_SYMBOLIC (font));

=== modified file 'src/xfont.c'
--- a/src/xfont.c       2013-07-16 06:39:49 +0000
+++ b/src/xfont.c       2013-08-01 10:33:25 +0000
@@ -115,9 +115,9 @@
 }
 
 static Lisp_Object xfont_get_cache (FRAME_PTR);
-static Lisp_Object xfont_list (Lisp_Object, Lisp_Object);
-static Lisp_Object xfont_match (Lisp_Object, Lisp_Object);
-static Lisp_Object xfont_list_family (Lisp_Object);
+static Lisp_Object xfont_list (struct frame *, Lisp_Object);
+static Lisp_Object xfont_match (struct frame *, Lisp_Object);
+static Lisp_Object xfont_list_family (struct frame *);
 static Lisp_Object xfont_open (FRAME_PTR, Lisp_Object, int);
 static void xfont_close (FRAME_PTR, struct font *);
 static int xfont_prepare_face (FRAME_PTR, struct face *);
@@ -486,9 +486,8 @@
 }
 
 static Lisp_Object
-xfont_list (Lisp_Object frame, Lisp_Object spec)
+xfont_list (struct frame *f, Lisp_Object spec)
 {
-  FRAME_PTR f = XFRAME (frame);
   Display *display = FRAME_X_DISPLAY_INFO (f)->display;
   Lisp_Object registry, list, val, extra, script;
   int len;
@@ -565,9 +564,8 @@
 }
 
 static Lisp_Object
-xfont_match (Lisp_Object frame, Lisp_Object spec)
+xfont_match (struct frame *f, Lisp_Object spec)
 {
-  FRAME_PTR f = XFRAME (frame);
   Display *display = FRAME_X_DISPLAY_INFO (f)->display;
   Lisp_Object extra, val, entity;
   char name[512];
@@ -622,9 +620,8 @@
 }
 
 static Lisp_Object
-xfont_list_family (Lisp_Object frame)
+xfont_list_family (struct frame *f)
 {
-  FRAME_PTR f = XFRAME (frame);
   Display_Info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
   char **names;
   int num_fonts, i;

=== modified file 'src/xftfont.c'
--- a/src/xftfont.c     2013-01-02 16:13:04 +0000
+++ b/src/xftfont.c     2013-08-01 10:33:25 +0000
@@ -139,9 +139,9 @@
 struct font_driver xftfont_driver;
 
 static Lisp_Object
-xftfont_list (Lisp_Object frame, Lisp_Object spec)
+xftfont_list (struct frame *f, Lisp_Object spec)
 {
-  Lisp_Object list = ftfont_driver.list (frame, spec), tail;
+  Lisp_Object list = ftfont_driver.list (f, spec), tail;
 
   for (tail = list; CONSP (tail); tail = XCDR (tail))
     ASET (XCAR (tail), FONT_TYPE_INDEX, Qxft);
@@ -149,9 +149,9 @@
 }
 
 static Lisp_Object
-xftfont_match (Lisp_Object frame, Lisp_Object spec)
+xftfont_match (struct frame *f, Lisp_Object spec)
 {
-  Lisp_Object entity = ftfont_driver.match (frame, spec);
+  Lisp_Object entity = ftfont_driver.match (f, spec);
 
   if (! NILP (entity))
     ASET (entity, FONT_TYPE_INDEX, Qxft);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]