diff options
| author | Dmitry Antipov | 2014-07-04 06:28:54 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-07-04 06:28:54 +0400 |
| commit | 9d7b0167fdd06638e019103ef1b77e5956d7fb7b (patch) | |
| tree | a086d81baec06b2656eb96437935632d1862d497 | |
| parent | 2b13ca4d11960fe1d8b858a64864d7b74bf60867 (diff) | |
| download | emacs-9d7b0167fdd06638e019103ef1b77e5956d7fb7b.tar.gz emacs-9d7b0167fdd06638e019103ef1b77e5956d7fb7b.zip | |
* 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.
| -rw-r--r-- | src/ChangeLog | 13 | ||||
| -rw-r--r-- | src/font.h | 9 | ||||
| -rw-r--r-- | src/ftfont.c | 2 | ||||
| -rw-r--r-- | src/macfont.m | 2 | ||||
| -rw-r--r-- | src/nsfont.m | 2 | ||||
| -rw-r--r-- | src/w32font.c | 15 | ||||
| -rw-r--r-- | src/w32uniscribe.c | 4 | ||||
| -rw-r--r-- | src/xfont.c | 2 | ||||
| -rw-r--r-- | src/xselect.c | 16 |
9 files changed, 19 insertions, 46 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index cbb89300cad..dac36212d79 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2014-07-04 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * font.h (struct font_driver): Remove get_outline and free_outline; | ||
| 4 | not used by any font driver. | ||
| 5 | * ftfont.c (ftfont_driver): | ||
| 6 | * macfont.m (macfont_driver): | ||
| 7 | * nsfont.m (nsfont_driver): | ||
| 8 | * w32font.c (w32font_driver): | ||
| 9 | * w32uniscribe.c (uniscribe_font_driver): | ||
| 10 | * xfont.c (xfont_driver): Related users changed. | ||
| 11 | * xselect.c (x_get_window_property): Use convenient xmalloc. | ||
| 12 | Call to xfree only if some data was really allocated. | ||
| 13 | |||
| 1 | 2014-07-03 Dmitry Antipov <dmantipov@yandex.ru> | 14 | 2014-07-03 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 15 | ||
| 3 | On MS-Windows, display busy cursor on all GUI frames. | 16 | On MS-Windows, display busy cursor on all GUI frames. |
diff --git a/src/font.h b/src/font.h index a41762db975..c23b826bd46 100644 --- a/src/font.h +++ b/src/font.h | |||
| @@ -614,15 +614,6 @@ struct font_driver | |||
| 614 | #endif /* HAVE_WINDOW_SYSTEM */ | 614 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 615 | 615 | ||
| 616 | /* Optional. | 616 | /* Optional. |
| 617 | Return an outline data for glyph-code CODE of FONT. The format | ||
| 618 | of the outline data depends on the font-driver. */ | ||
| 619 | void *(*get_outline) (struct font *font, unsigned code); | ||
| 620 | |||
| 621 | /* Optional. | ||
| 622 | Free OUTLINE (that is obtained by the above method). */ | ||
| 623 | void (*free_outline) (struct font *font, void *outline); | ||
| 624 | |||
| 625 | /* Optional. | ||
| 626 | Get coordinates of the INDEXth anchor point of the glyph whose | 617 | Get coordinates of the INDEXth anchor point of the glyph whose |
| 627 | code is CODE. Store the coordinates in *X and *Y. Return 0 if | 618 | code is CODE. Store the coordinates in *X and *Y. Return 0 if |
| 628 | the operations was successful. Otherwise return -1. */ | 619 | the operations was successful. Otherwise return -1. */ |
diff --git a/src/ftfont.c b/src/ftfont.c index 0f23b086cf5..7c5d01208d2 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -538,8 +538,6 @@ struct font_driver ftfont_driver = | |||
| 538 | NULL, /* draw */ | 538 | NULL, /* draw */ |
| 539 | ftfont_get_bitmap, | 539 | ftfont_get_bitmap, |
| 540 | NULL, /* free_bitmap */ | 540 | NULL, /* free_bitmap */ |
| 541 | NULL, /* get_outline */ | ||
| 542 | NULL, /* free_outline */ | ||
| 543 | ftfont_anchor_point, | 541 | ftfont_anchor_point, |
| 544 | #ifdef HAVE_LIBOTF | 542 | #ifdef HAVE_LIBOTF |
| 545 | ftfont_otf_capability, | 543 | ftfont_otf_capability, |
diff --git a/src/macfont.m b/src/macfont.m index 9b3cb2c29f6..82ee54cdc63 100644 --- a/src/macfont.m +++ b/src/macfont.m | |||
| @@ -1580,8 +1580,6 @@ static struct font_driver macfont_driver = | |||
| 1580 | macfont_draw, | 1580 | macfont_draw, |
| 1581 | NULL, /* get_bitmap */ | 1581 | NULL, /* get_bitmap */ |
| 1582 | NULL, /* free_bitmap */ | 1582 | NULL, /* free_bitmap */ |
| 1583 | NULL, /* get_outline */ | ||
| 1584 | NULL, /* free_outline */ | ||
| 1585 | NULL, /* anchor_point */ | 1583 | NULL, /* anchor_point */ |
| 1586 | NULL, /* otf_capability */ | 1584 | NULL, /* otf_capability */ |
| 1587 | NULL, /* otf_drive */ | 1585 | NULL, /* otf_drive */ |
diff --git a/src/nsfont.m b/src/nsfont.m index 2c5e25b993c..cadc68f9933 100644 --- a/src/nsfont.m +++ b/src/nsfont.m | |||
| @@ -649,7 +649,7 @@ struct font_driver nsfont_driver = | |||
| 649 | nsfont_encode_char, | 649 | nsfont_encode_char, |
| 650 | nsfont_text_extents, | 650 | nsfont_text_extents, |
| 651 | nsfont_draw, | 651 | nsfont_draw, |
| 652 | /* excluded: get_bitmap, free_bitmap, get_outline, free_outline, | 652 | /* excluded: get_bitmap, free_bitmap, |
| 653 | anchor_point, otf_capability, otf_driver, | 653 | anchor_point, otf_capability, otf_driver, |
| 654 | start_for_frame, end_for_frame, shape */ | 654 | start_for_frame, end_for_frame, shape */ |
| 655 | }; | 655 | }; |
diff --git a/src/w32font.c b/src/w32font.c index 5262f38663f..43b592ee450 100644 --- a/src/w32font.c +++ b/src/w32font.c | |||
| @@ -757,19 +757,6 @@ w32font_get_bitmap (struct font *font, unsigned code, | |||
| 757 | static void | 757 | static void |
| 758 | w32font_free_bitmap (struct font *font, struct font_bitmap *bitmap); | 758 | w32font_free_bitmap (struct font *font, struct font_bitmap *bitmap); |
| 759 | */ | 759 | */ |
| 760 | /* w32 implementation of get_outline for font backend. | ||
| 761 | Optional. | ||
| 762 | Return an outline data for glyph-code CODE of FONT. The format | ||
| 763 | of the outline data depends on the font-driver. | ||
| 764 | static void * | ||
| 765 | w32font_get_outline (struct font *font, unsigned code); | ||
| 766 | */ | ||
| 767 | /* w32 implementation of free_outline for font backend. | ||
| 768 | Optional. | ||
| 769 | Free OUTLINE (that is obtained by the above method). | ||
| 770 | static void | ||
| 771 | w32font_free_outline (struct font *font, void *outline); | ||
| 772 | */ | ||
| 773 | /* w32 implementation of anchor_point for font backend. | 760 | /* w32 implementation of anchor_point for font backend. |
| 774 | Optional. | 761 | Optional. |
| 775 | Get coordinates of the INDEXth anchor point of the glyph whose | 762 | Get coordinates of the INDEXth anchor point of the glyph whose |
| @@ -2557,8 +2544,6 @@ struct font_driver w32font_driver = | |||
| 2557 | w32font_draw, | 2544 | w32font_draw, |
| 2558 | NULL, /* get_bitmap */ | 2545 | NULL, /* get_bitmap */ |
| 2559 | NULL, /* free_bitmap */ | 2546 | NULL, /* free_bitmap */ |
| 2560 | NULL, /* get_outline */ | ||
| 2561 | NULL, /* free_outline */ | ||
| 2562 | NULL, /* anchor_point */ | 2547 | NULL, /* anchor_point */ |
| 2563 | NULL, /* otf_capability */ | 2548 | NULL, /* otf_capability */ |
| 2564 | NULL, /* otf_drive */ | 2549 | NULL, /* otf_drive */ |
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c index 5bb444f519a..24fc753e708 100644 --- a/src/w32uniscribe.c +++ b/src/w32uniscribe.c | |||
| @@ -604,8 +604,6 @@ uniscribe_encode_char (struct font *font, int c) | |||
| 604 | int uniscribe_get_bitmap (struct font *font, unsigned code, | 604 | int uniscribe_get_bitmap (struct font *font, unsigned code, |
| 605 | struct font_bitmap *bitmap, int bits_per_pixel); | 605 | struct font_bitmap *bitmap, int bits_per_pixel); |
| 606 | void uniscribe_free_bitmap (struct font *font, struct font_bitmap *bitmap); | 606 | void uniscribe_free_bitmap (struct font *font, struct font_bitmap *bitmap); |
| 607 | void * uniscribe_get_outline (struct font *font, unsigned code); | ||
| 608 | void uniscribe_free_outline (struct font *font, void *outline); | ||
| 609 | int uniscribe_anchor_point (struct font *font, unsigned code, | 607 | int uniscribe_anchor_point (struct font *font, unsigned code, |
| 610 | int index, int *x, int *y); | 608 | int index, int *x, int *y); |
| 611 | int uniscribe_start_for_frame (struct frame *f); | 609 | int uniscribe_start_for_frame (struct frame *f); |
| @@ -981,8 +979,6 @@ struct font_driver uniscribe_font_driver = | |||
| 981 | w32font_draw, | 979 | w32font_draw, |
| 982 | NULL, /* get_bitmap */ | 980 | NULL, /* get_bitmap */ |
| 983 | NULL, /* free_bitmap */ | 981 | NULL, /* free_bitmap */ |
| 984 | NULL, /* get_outline */ | ||
| 985 | NULL, /* free_outline */ | ||
| 986 | NULL, /* anchor_point */ | 982 | NULL, /* anchor_point */ |
| 987 | uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */ | 983 | uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */ |
| 988 | NULL, /* otf_drive - use shape instead. */ | 984 | NULL, /* otf_drive - use shape instead. */ |
diff --git a/src/xfont.c b/src/xfont.c index f90904a018e..baed9abbc7e 100644 --- a/src/xfont.c +++ b/src/xfont.c | |||
| @@ -146,7 +146,7 @@ struct font_driver xfont_driver = | |||
| 146 | xfont_encode_char, | 146 | xfont_encode_char, |
| 147 | xfont_text_extents, | 147 | xfont_text_extents, |
| 148 | xfont_draw, | 148 | xfont_draw, |
| 149 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 149 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 150 | xfont_check, | 150 | xfont_check, |
| 151 | NULL, /* get_variation_glyphs */ | 151 | NULL, /* get_variation_glyphs */ |
| 152 | NULL, /* filter_properties */ | 152 | NULL, /* filter_properties */ |
diff --git a/src/xselect.c b/src/xselect.c index 89ec1da30b2..f23256346cb 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -1299,9 +1299,7 @@ x_get_window_property (Display *display, Window window, Atom property, | |||
| 1299 | if (total_size_max < bytes_remaining) | 1299 | if (total_size_max < bytes_remaining) |
| 1300 | goto size_overflow; | 1300 | goto size_overflow; |
| 1301 | total_size = bytes_remaining; | 1301 | total_size = bytes_remaining; |
| 1302 | data = malloc (total_size + 1); | 1302 | data = xmalloc (total_size + 1); |
| 1303 | if (! data) | ||
| 1304 | goto memory_exhausted; | ||
| 1305 | 1303 | ||
| 1306 | /* Now read, until we've gotten it all. */ | 1304 | /* Now read, until we've gotten it all. */ |
| 1307 | while (bytes_remaining) | 1305 | while (bytes_remaining) |
| @@ -1352,9 +1350,7 @@ x_get_window_property (Display *display, Window window, Atom property, | |||
| 1352 | if (remaining_lim < 0 || remaining_lim < bytes_remaining) | 1350 | if (remaining_lim < 0 || remaining_lim < bytes_remaining) |
| 1353 | goto size_overflow; | 1351 | goto size_overflow; |
| 1354 | total_size = offset + bytes_gotten + bytes_remaining; | 1352 | total_size = offset + bytes_gotten + bytes_remaining; |
| 1355 | data1 = realloc (data, total_size + 1); | 1353 | data1 = xrealloc (data, total_size + 1); |
| 1356 | if (! data1) | ||
| 1357 | goto memory_exhausted; | ||
| 1358 | data = data1; | 1354 | data = data1; |
| 1359 | } | 1355 | } |
| 1360 | 1356 | ||
| @@ -1386,14 +1382,10 @@ x_get_window_property (Display *display, Window window, Atom property, | |||
| 1386 | return; | 1382 | return; |
| 1387 | 1383 | ||
| 1388 | size_overflow: | 1384 | size_overflow: |
| 1389 | free (data); | 1385 | if (data) |
| 1386 | xfree (data); | ||
| 1390 | unblock_input (); | 1387 | unblock_input (); |
| 1391 | memory_full (SIZE_MAX); | 1388 | memory_full (SIZE_MAX); |
| 1392 | |||
| 1393 | memory_exhausted: | ||
| 1394 | free (data); | ||
| 1395 | unblock_input (); | ||
| 1396 | memory_full (total_size + 1); | ||
| 1397 | } | 1389 | } |
| 1398 | 1390 | ||
| 1399 | /* Use xfree, not XFree, to free the data obtained with this function. */ | 1391 | /* Use xfree, not XFree, to free the data obtained with this function. */ |