]> git.eshelyaron.com Git - emacs.git/commitdiff
* font.h (struct font_driver): Remove get_outline and free_outline;
authorDmitry Antipov <dmantipov@yandex.ru>
Fri, 4 Jul 2014 02:28:54 +0000 (06:28 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Fri, 4 Jul 2014 02:28:54 +0000 (06:28 +0400)
not used by any font driver.
* ftfont.c (ftfont_driver):
* macfont.m (macfont_driver):
* nsfont.m (nsfont_driver):
* w32font.c (w32font_driver):
* w32uniscribe.c (uniscribe_font_driver):
* xfont.c (xfont_driver): Related users changed.
* xselect.c (x_get_window_property): Use convenient xmalloc.
Call to xfree only if some data was really allocated.

src/ChangeLog
src/font.h
src/ftfont.c
src/macfont.m
src/nsfont.m
src/w32font.c
src/w32uniscribe.c
src/xfont.c
src/xselect.c

index cbb89300cad32afa153bc632694221fa6804b818..dac36212d79a414f34d7cd9a7edf3df2f9235d6a 100644 (file)
@@ -1,3 +1,16 @@
+2014-07-04  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * font.h (struct font_driver): Remove get_outline and free_outline;
+       not used by any font driver.
+       * ftfont.c (ftfont_driver):
+       * macfont.m (macfont_driver):
+       * nsfont.m (nsfont_driver):
+       * w32font.c (w32font_driver):
+       * w32uniscribe.c (uniscribe_font_driver):
+       * xfont.c (xfont_driver): Related users changed.
+       * xselect.c (x_get_window_property): Use convenient xmalloc.
+       Call to xfree only if some data was really allocated.
+
 2014-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
 
        On MS-Windows, display busy cursor on all GUI frames.
index a41762db975538904e9627b859e8ed612ce7d563..c23b826bd46fd40aeef697cdf802561d90ac2d9c 100644 (file)
@@ -613,15 +613,6 @@ struct font_driver
 
 #endif /* HAVE_WINDOW_SYSTEM */
 
-  /* Optional.
-     Return an outline data for glyph-code CODE of FONT.  The format
-     of the outline data depends on the font-driver.  */
-  void *(*get_outline) (struct font *font, unsigned code);
-
-  /* Optional.
-     Free OUTLINE (that is obtained by the above method).  */
-  void (*free_outline) (struct font *font, void *outline);
-
   /* Optional.
      Get coordinates of the INDEXth anchor point of the glyph whose
      code is CODE.  Store the coordinates in *X and *Y.  Return 0 if
index 0f23b086cf5d1d45a60a918935fc82d7b501a075..7c5d01208d2425003ec21a33d1a2b779867f3368 100644 (file)
@@ -538,8 +538,6 @@ struct font_driver ftfont_driver =
     NULL,                      /* draw */
     ftfont_get_bitmap,
     NULL,                      /* free_bitmap */
-    NULL,                      /* get_outline */
-    NULL,                      /* free_outline */
     ftfont_anchor_point,
 #ifdef HAVE_LIBOTF
     ftfont_otf_capability,
index 9b3cb2c29f653eb8fe1b1c4b94105979cb24b5c3..82ee54cdc638d09b8bfc56401bdbc10baeb99010 100644 (file)
@@ -1580,8 +1580,6 @@ static struct font_driver macfont_driver =
     macfont_draw,
     NULL,                      /* get_bitmap */
     NULL,                      /* free_bitmap */
-    NULL,                      /* get_outline */
-    NULL,                      /* free_outline */
     NULL,                      /* anchor_point */
     NULL,                      /* otf_capability */
     NULL,                      /* otf_drive */
index 2c5e25b993c2ac4c4998709dd8f3d8f7feabe4b9..cadc68f99339e9796d97cc87e77780445203e3e4 100644 (file)
@@ -649,7 +649,7 @@ struct font_driver nsfont_driver =
     nsfont_encode_char,
     nsfont_text_extents,
     nsfont_draw,
-    /* excluded: get_bitmap, free_bitmap, get_outline, free_outline,
+    /* excluded: get_bitmap, free_bitmap,
                  anchor_point, otf_capability, otf_driver,
                 start_for_frame, end_for_frame, shape */
   };
index 5262f38663fbf097cadc77c676b3b3bebff3df79..43b592ee450e806d547d9b90090b698694f13d6a 100644 (file)
@@ -757,19 +757,6 @@ w32font_get_bitmap (struct font *font, unsigned code,
 static void
 w32font_free_bitmap (struct font *font, struct font_bitmap *bitmap);
   */
-/* w32 implementation of get_outline for font backend.
-   Optional.
-   Return an outline data for glyph-code CODE of FONT.  The format
-   of the outline data depends on the font-driver.
-static void *
-w32font_get_outline (struct font *font, unsigned code);
-  */
-/* w32 implementation of free_outline for font backend.
-   Optional.
-   Free OUTLINE (that is obtained by the above method).
-static void
-w32font_free_outline (struct font *font, void *outline);
-  */
 /* w32 implementation of anchor_point for font backend.
    Optional.
    Get coordinates of the INDEXth anchor point of the glyph whose
@@ -2557,8 +2544,6 @@ struct font_driver w32font_driver =
     w32font_draw,
     NULL, /* get_bitmap */
     NULL, /* free_bitmap */
-    NULL, /* get_outline */
-    NULL, /* free_outline */
     NULL, /* anchor_point */
     NULL, /* otf_capability */
     NULL, /* otf_drive */
index 5bb444f519af74303c921999a7c8437214082d2c..24fc753e708c3dba2292443077a0d6718c5e5849 100644 (file)
@@ -604,8 +604,6 @@ uniscribe_encode_char (struct font *font, int c)
    int uniscribe_get_bitmap (struct font *font, unsigned code,
                              struct font_bitmap *bitmap, int bits_per_pixel);
    void uniscribe_free_bitmap (struct font *font, struct font_bitmap *bitmap);
-   void * uniscribe_get_outline (struct font *font, unsigned code);
-   void uniscribe_free_outline (struct font *font, void *outline);
    int uniscribe_anchor_point (struct font *font, unsigned code,
                                int index, int *x, int *y);
    int uniscribe_start_for_frame (struct frame *f);
@@ -981,8 +979,6 @@ struct font_driver uniscribe_font_driver =
     w32font_draw,
     NULL, /* get_bitmap */
     NULL, /* free_bitmap */
-    NULL, /* get_outline */
-    NULL, /* free_outline */
     NULL, /* anchor_point */
     uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works.  */
     NULL, /* otf_drive - use shape instead.  */
index f90904a018e705f4cc8fa1d7dc71da7a39775baa..baed9abbc7ef32ca796c6d7a425784c594d45a3a 100644 (file)
@@ -146,7 +146,7 @@ struct font_driver xfont_driver =
     xfont_encode_char,
     xfont_text_extents,
     xfont_draw,
-    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+    NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
     xfont_check,
     NULL, /* get_variation_glyphs */
     NULL, /* filter_properties */
index 89ec1da30b2eb6cde9730d3227e399758c6776dc..f23256346cb534b4a34f0542732b0e4a6356dbe8 100644 (file)
@@ -1299,9 +1299,7 @@ x_get_window_property (Display *display, Window window, Atom property,
   if (total_size_max < bytes_remaining)
     goto size_overflow;
   total_size = bytes_remaining;
-  data = malloc (total_size + 1);
-  if (! data)
-    goto memory_exhausted;
+  data = xmalloc (total_size + 1);
 
   /* Now read, until we've gotten it all.  */
   while (bytes_remaining)
@@ -1352,9 +1350,7 @@ x_get_window_property (Display *display, Window window, Atom property,
          if (remaining_lim < 0 || remaining_lim < bytes_remaining)
            goto size_overflow;
          total_size = offset + bytes_gotten + bytes_remaining;
-         data1 = realloc (data, total_size + 1);
-         if (! data1)
-           goto memory_exhausted;
+         data1 = xrealloc (data, total_size + 1);
          data = data1;
        }
 
@@ -1386,14 +1382,10 @@ x_get_window_property (Display *display, Window window, Atom property,
   return;
 
  size_overflow:
-  free (data);
+  if (data)
+    xfree (data);
   unblock_input ();
   memory_full (SIZE_MAX);
-
- memory_exhausted:
-  free (data);
-  unblock_input ();
-  memory_full (total_size + 1);
 }
 \f
 /* Use xfree, not XFree, to free the data obtained with this function.  */