aboutsummaryrefslogtreecommitdiffstats
path: root/src/xfont.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-10-25 10:55:36 +0400
committerDmitry Antipov2013-10-25 10:55:36 +0400
commit78e0b35c45892995da596c65759fdece3e67129d (patch)
tree4e18a2b9f5703f8eb4c7151fc061f4c13892432e /src/xfont.c
parent963ce6361af7f8b7aefb63e7a50956e497020b12 (diff)
downloademacs-78e0b35c45892995da596c65759fdece3e67129d.tar.gz
emacs-78e0b35c45892995da596c65759fdece3e67129d.zip
Omit unused frame argument of font API's close function.
* font.h (struct font): Drop frame argument. Adjust comment. * font.c (font_clear_cache, font_close_object): Adjust users. * ftfont.c (ftfont_close): * ftxfont.c (ftxfont_close): * macfont.m (macfont_close): * nsfont.m (nsfont_close): * w32font.c (w32font_close): * xfont.c (xfont_close): * xftfont.c (xftfont_close): Adjust driver-specific close functions, tweak comments and make functions safe if called more than once for the same font object.
Diffstat (limited to 'src/xfont.c')
-rw-r--r--src/xfont.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/xfont.c b/src/xfont.c
index c5b8db3830c..1f87fb8783e 100644
--- a/src/xfont.c
+++ b/src/xfont.c
@@ -119,7 +119,7 @@ static Lisp_Object xfont_list (struct frame *, Lisp_Object);
119static Lisp_Object xfont_match (struct frame *, Lisp_Object); 119static Lisp_Object xfont_match (struct frame *, Lisp_Object);
120static Lisp_Object xfont_list_family (struct frame *); 120static Lisp_Object xfont_list_family (struct frame *);
121static Lisp_Object xfont_open (struct frame *, Lisp_Object, int); 121static Lisp_Object xfont_open (struct frame *, Lisp_Object, int);
122static void xfont_close (struct frame *, struct font *); 122static void xfont_close (struct font *);
123static int xfont_prepare_face (struct frame *, struct face *); 123static int xfont_prepare_face (struct frame *, struct face *);
124static int xfont_has_char (Lisp_Object, int); 124static int xfont_has_char (Lisp_Object, int);
125static unsigned xfont_encode_char (struct font *, int); 125static unsigned xfont_encode_char (struct font *, int);
@@ -890,11 +890,17 @@ xfont_open (struct frame *f, Lisp_Object entity, int pixel_size)
890} 890}
891 891
892static void 892static void
893xfont_close (struct frame *f, struct font *font) 893xfont_close (struct font *font)
894{ 894{
895 block_input (); 895 struct xfont_info *xfi = (struct xfont_info *) font;
896 XFreeFont (FRAME_X_DISPLAY (f), ((struct xfont_info *) font)->xfont); 896
897 unblock_input (); 897 if (xfi->xfont)
898 {
899 block_input ();
900 XFreeFont (xfi->display, xfi->xfont);
901 unblock_input ();
902 xfi->xfont = NULL;
903 }
898} 904}
899 905
900static int 906static int