summaryrefslogtreecommitdiff
path: root/src/font.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-01-10 13:33:38 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2015-01-10 13:42:35 -0800
commit6a37ecee0884ff30ac7666e6502e2a9d2608f291 (patch)
tree875bd8310981ff850911f04da4c3c3b95f34537b /src/font.c
parent649937920b5023be5c0685d1537f5ea2bfb9899a (diff)
downloademacs-6a37ecee0884ff30ac7666e6502e2a9d2608f291.tar.gz
Port to 32-bit --with-wide-int
Prefer symbol indexes to struct Lisp_Symbol * casted and then widened, as the latter had trouble with GCC on Fedora 21 when configured --with-wide-int and when used in static initializers. * lib-src/make-docfile.c (write_globals): Define and use symbols like iQnil (a small integer, like 0) rather than aQnil (an address constant). * src/alloc.c (garbage_collect_1, which_symbols): * src/lread.c (init_obarray): Prefer builtin_lisp_symbol when it can be used. * src/dispextern.h (struct image_type.type): * src/font.c (font_property_table.key): * src/frame.c (struct frame_parm_table.sym): * src/keyboard.c (scroll_bar_parts, struct event_head): * src/xdisp.c (struct props.name): Use the index of a builtin symbol rather than its address. All uses changed. * src/lisp.h (TAG_SYMPTR, XSYMBOL_INIT): Remove, replacing with ... (TAG_SYMOFFSET, SYMBOL_INDEX): ... new macros that deal with symbol indexes rather than pointers, and which work better on MSB hosts because they shift right before tagging. All uses changed. (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END): No longer noops on wide-int hosts, since they work now. (builtin_lisp_symbol): New function.
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/font.c b/src/font.c
index 60134b1de5b..a68c3c707c8 100644
--- a/src/font.c
+++ b/src/font.c
@@ -639,30 +639,30 @@ font_prop_validate_otf (Lisp_Object prop, Lisp_Object val)
values. */
static const struct
{
- /* Pointer to the key symbol. */
- struct Lisp_Symbol *key;
+ /* Index of the key symbol. */
+ int key;
/* Function to validate PROP's value VAL, or NULL if any value is
ok. The value is VAL or its regularized value if VAL is valid,
and Qerror if not. */
Lisp_Object (*validator) (Lisp_Object prop, Lisp_Object val);
} font_property_table[] =
- { { XSYMBOL_INIT (QCtype), font_prop_validate_symbol },
- { XSYMBOL_INIT (QCfoundry), font_prop_validate_symbol },
- { XSYMBOL_INIT (QCfamily), font_prop_validate_symbol },
- { XSYMBOL_INIT (QCadstyle), font_prop_validate_symbol },
- { XSYMBOL_INIT (QCregistry), font_prop_validate_symbol },
- { XSYMBOL_INIT (QCweight), font_prop_validate_style },
- { XSYMBOL_INIT (QCslant), font_prop_validate_style },
- { XSYMBOL_INIT (QCwidth), font_prop_validate_style },
- { XSYMBOL_INIT (QCsize), font_prop_validate_non_neg },
- { XSYMBOL_INIT (QCdpi), font_prop_validate_non_neg },
- { XSYMBOL_INIT (QCspacing), font_prop_validate_spacing },
- { XSYMBOL_INIT (QCavgwidth), font_prop_validate_non_neg },
+ { { SYMBOL_INDEX (QCtype), font_prop_validate_symbol },
+ { SYMBOL_INDEX (QCfoundry), font_prop_validate_symbol },
+ { SYMBOL_INDEX (QCfamily), font_prop_validate_symbol },
+ { SYMBOL_INDEX (QCadstyle), font_prop_validate_symbol },
+ { SYMBOL_INDEX (QCregistry), font_prop_validate_symbol },
+ { SYMBOL_INDEX (QCweight), font_prop_validate_style },
+ { SYMBOL_INDEX (QCslant), font_prop_validate_style },
+ { SYMBOL_INDEX (QCwidth), font_prop_validate_style },
+ { SYMBOL_INDEX (QCsize), font_prop_validate_non_neg },
+ { SYMBOL_INDEX (QCdpi), font_prop_validate_non_neg },
+ { SYMBOL_INDEX (QCspacing), font_prop_validate_spacing },
+ { SYMBOL_INDEX (QCavgwidth), font_prop_validate_non_neg },
/* The order of the above entries must match with enum
font_property_index. */
- { XSYMBOL_INIT (QClang), font_prop_validate_symbol },
- { XSYMBOL_INIT (QCscript), font_prop_validate_symbol },
- { XSYMBOL_INIT (QCotf), font_prop_validate_otf }
+ { SYMBOL_INDEX (QClang), font_prop_validate_symbol },
+ { SYMBOL_INDEX (QCscript), font_prop_validate_symbol },
+ { SYMBOL_INDEX (QCotf), font_prop_validate_otf }
};
/* Return an index number of font property KEY or -1 if KEY is not an
@@ -674,7 +674,7 @@ get_font_prop_index (Lisp_Object key)
int i;
for (i = 0; i < ARRAYELTS (font_property_table); i++)
- if (EQ (key, make_lisp_symbol (font_property_table[i].key)))
+ if (EQ (key, builtin_lisp_symbol (font_property_table[i].key)))
return i;
return -1;
}
@@ -691,7 +691,7 @@ font_prop_validate (int idx, Lisp_Object prop, Lisp_Object val)
if (NILP (val))
return val;
if (NILP (prop))
- prop = make_lisp_symbol (font_property_table[idx].key);
+ prop = builtin_lisp_symbol (font_property_table[idx].key);
else
{
idx = get_font_prop_index (prop);