aboutsummaryrefslogtreecommitdiffstats
path: root/src/ftfont.c
diff options
context:
space:
mode:
authorDmitry Antipov2013-01-15 13:22:25 +0400
committerDmitry Antipov2013-01-15 13:22:25 +0400
commit2b30549c493d7b67fa92c2b4bcd2bd2e55210ae1 (patch)
treeac4cc77344b3285eb47d5145eb0b28dd6034f54d /src/ftfont.c
parent1b971ac155006504b6b1c2688199747f976723af (diff)
downloademacs-2b30549c493d7b67fa92c2b4bcd2bd2e55210ae1.tar.gz
emacs-2b30549c493d7b67fa92c2b4bcd2bd2e55210ae1.zip
* src/lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow extraction
from any Lisp_Save_Value slot. Add type checking. * src/alloc.c, src/dired.c, src/editfns.c, src/fileio.c, src/ftfont.c: * src/gtkutil.c, src/keymap.c, src/lread.c, src/nsterm.h, src/nsmenu.c: * src/xfns.c, src/xmenu.c, src/xselect.c: All users changed. * admin/coccinelle/xsave.cocci: Semantic patch to adjust users of XSAVE_POINTER and XSAVE_INTEGER macros.
Diffstat (limited to 'src/ftfont.c')
-rw-r--r--src/ftfont.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/ftfont.c b/src/ftfont.c
index 1d7678bfe09..5bf91832c7c 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -400,7 +400,7 @@ ftfont_lookup_cache (Lisp_Object key, enum ftfont_cache_for cache_for)
400 else 400 else
401 { 401 {
402 val = XCDR (cache); 402 val = XCDR (cache);
403 cache_data = XSAVE_POINTER (val); 403 cache_data = XSAVE_POINTER (val, 0);
404 } 404 }
405 405
406 if (cache_for == FTFONT_CACHE_FOR_ENTITY) 406 if (cache_for == FTFONT_CACHE_FOR_ENTITY)
@@ -466,7 +466,7 @@ ftfont_get_fc_charset (Lisp_Object entity)
466 466
467 cache = ftfont_lookup_cache (entity, FTFONT_CACHE_FOR_CHARSET); 467 cache = ftfont_lookup_cache (entity, FTFONT_CACHE_FOR_CHARSET);
468 val = XCDR (cache); 468 val = XCDR (cache);
469 cache_data = XSAVE_POINTER (val); 469 cache_data = XSAVE_POINTER (val, 0);
470 return cache_data->fc_charset; 470 return cache_data->fc_charset;
471} 471}
472 472
@@ -1198,9 +1198,9 @@ ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
1198 filename = XCAR (val); 1198 filename = XCAR (val);
1199 idx = XCDR (val); 1199 idx = XCDR (val);
1200 val = XCDR (cache); 1200 val = XCDR (cache);
1201 cache_data = XSAVE_POINTER (XCDR (cache)); 1201 cache_data = XSAVE_POINTER (XCDR (cache), 0);
1202 ft_face = cache_data->ft_face; 1202 ft_face = cache_data->ft_face;
1203 if (XSAVE_INTEGER (val) > 0) 1203 if (XSAVE_INTEGER (val, 1) > 0)
1204 { 1204 {
1205 /* FT_Face in this cache is already used by the different size. */ 1205 /* FT_Face in this cache is already used by the different size. */
1206 if (FT_New_Size (ft_face, &ft_size) != 0) 1206 if (FT_New_Size (ft_face, &ft_size) != 0)
@@ -1211,13 +1211,13 @@ ftfont_open (FRAME_PTR f, Lisp_Object entity, int pixel_size)
1211 return Qnil; 1211 return Qnil;
1212 } 1212 }
1213 } 1213 }
1214 XSAVE_INTEGER (val)++; 1214 XSAVE_INTEGER (val, 1)++;
1215 size = XINT (AREF (entity, FONT_SIZE_INDEX)); 1215 size = XINT (AREF (entity, FONT_SIZE_INDEX));
1216 if (size == 0) 1216 if (size == 0)
1217 size = pixel_size; 1217 size = pixel_size;
1218 if (FT_Set_Pixel_Sizes (ft_face, size, size) != 0) 1218 if (FT_Set_Pixel_Sizes (ft_face, size, size) != 0)
1219 { 1219 {
1220 if (XSAVE_INTEGER (val) == 0) 1220 if (XSAVE_INTEGER (val, 1) == 0)
1221 FT_Done_Face (ft_face); 1221 FT_Done_Face (ft_face);
1222 return Qnil; 1222 return Qnil;
1223 } 1223 }
@@ -1326,10 +1326,10 @@ ftfont_close (FRAME_PTR f, struct font *font)
1326 cache = ftfont_lookup_cache (val, FTFONT_CACHE_FOR_FACE); 1326 cache = ftfont_lookup_cache (val, FTFONT_CACHE_FOR_FACE);
1327 eassert (CONSP (cache)); 1327 eassert (CONSP (cache));
1328 val = XCDR (cache); 1328 val = XCDR (cache);
1329 (XSAVE_INTEGER (val))--; 1329 XSAVE_INTEGER (val, 1)--;
1330 if (XSAVE_INTEGER (val) == 0) 1330 if (XSAVE_INTEGER (val, 1) == 0)
1331 { 1331 {
1332 struct ftfont_cache_data *cache_data = XSAVE_POINTER (val); 1332 struct ftfont_cache_data *cache_data = XSAVE_POINTER (val, 0);
1333 1333
1334 FT_Done_Face (cache_data->ft_face); 1334 FT_Done_Face (cache_data->ft_face);
1335#ifdef HAVE_LIBOTF 1335#ifdef HAVE_LIBOTF