aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorPaul Eggert2016-12-01 21:47:12 -0800
committerPaul Eggert2016-12-01 21:48:30 -0800
commitebb96114d88af64cbb72f42052cb359ba8010aa2 (patch)
tree88795f2e9bc74b5c1a96c04c8cfe069b7d5f601f /src/alloc.c
parentdd4b913153a818dbd42cb395d2c36f216e09a8ec (diff)
downloademacs-ebb96114d88af64cbb72f42052cb359ba8010aa2.tar.gz
emacs-ebb96114d88af64cbb72f42052cb359ba8010aa2.zip
Make struct font_drivers read-only
This simplifies the code a bit, and makes the structs more shareable and less likely to become corrupt. * src/alloc.c (cleanup_vector): * src/font.c (valid_font_driver, font_prepare_cache) (font_finish_cache, font_get_cache, font_clear_cache) (register_font_driver, font_update_drivers): * src/font.h (struct font, struct font_driver_list) (valid_font_driver): struct font_drivers are now const. * src/font.c, src/ftcrfont.c, src/ftfont.c, src/nsfont.m, src/xfont.c: Omit no-longer-necessary decls. * src/ftcrfont.c (syms_of_ftcrfont): * src/ftxfont.c (syms_of_ftxfont): * src/xftfont.c (syms_of_xftfont): Omit no-longer-necessary initialization code. * src/ftcrfont.c (ftcrfont_driver): * src/ftfont.c (ftfont_driver): * src/ftxfont.c (ftxfont_driver): * src/macfont.m (macfont_driver): * src/nsfont.m (nsfont_driver): * src/xfont.c (xfont_driver): * src/xftfont.c (xftfont_driver): Use C99-style initializer for ease of maintenance, and make it const. * src/ftcrfont.c, src/ftxfont.c, src/xftfont.c: Refer to functions like ftfont_text_extents directly. * src/ftfont.c (ftfont_get_cache, ftfont_list, ftfont_list_family) (ftfont_has_char, ftfont_encode_char, ftfont_text_extents) (ftfont_get_bitmap, ftfont_anchor_point, ftfont_otf_capability) (ftfont_variation_glyphs, ftfont_filter_properties) (ftfont_combining_capability): * src/xfont.c (xfont_get_cache): Now extern, so that other modules’ struct font_drivers can use them directly. * src/macfont.m (macfont_descriptor_entity): * src/nsfont.m (nsfont_open): Use constant directly; this is clearer.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 175dcab2487..ae32400708a 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3201,7 +3201,7 @@ cleanup_vector (struct Lisp_Vector *vector)
3201 && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) 3201 && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK)
3202 == FONT_OBJECT_MAX)) 3202 == FONT_OBJECT_MAX))
3203 { 3203 {
3204 struct font_driver *drv = ((struct font *) vector)->driver; 3204 struct font_driver const *drv = ((struct font *) vector)->driver;
3205 3205
3206 /* The font driver might sometimes be NULL, e.g. if Emacs was 3206 /* The font driver might sometimes be NULL, e.g. if Emacs was
3207 interrupted before it had time to set it up. */ 3207 interrupted before it had time to set it up. */