aboutsummaryrefslogtreecommitdiffstats
path: root/src/font.c
diff options
context:
space:
mode:
authorPaul Eggert2015-01-10 13:33:38 -0800
committerPaul Eggert2015-01-10 13:42:35 -0800
commit6a37ecee0884ff30ac7666e6502e2a9d2608f291 (patch)
tree875bd8310981ff850911f04da4c3c3b95f34537b /src/font.c
parent649937920b5023be5c0685d1537f5ea2bfb9899a (diff)
downloademacs-6a37ecee0884ff30ac7666e6502e2a9d2608f291.tar.gz
emacs-6a37ecee0884ff30ac7666e6502e2a9d2608f291.zip
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)
639 values. */ 639 values. */
640static const struct 640static const struct
641{ 641{
642 /* Pointer to the key symbol. */ 642 /* Index of the key symbol. */
643 struct Lisp_Symbol *key; 643 int key;
644 /* Function to validate PROP's value VAL, or NULL if any value is 644 /* Function to validate PROP's value VAL, or NULL if any value is
645 ok. The value is VAL or its regularized value if VAL is valid, 645 ok. The value is VAL or its regularized value if VAL is valid,
646 and Qerror if not. */ 646 and Qerror if not. */
647 Lisp_Object (*validator) (Lisp_Object prop, Lisp_Object val); 647 Lisp_Object (*validator) (Lisp_Object prop, Lisp_Object val);
648} font_property_table[] = 648} font_property_table[] =
649 { { XSYMBOL_INIT (QCtype), font_prop_validate_symbol }, 649 { { SYMBOL_INDEX (QCtype), font_prop_validate_symbol },
650 { XSYMBOL_INIT (QCfoundry), font_prop_validate_symbol }, 650 { SYMBOL_INDEX (QCfoundry), font_prop_validate_symbol },
651 { XSYMBOL_INIT (QCfamily), font_prop_validate_symbol }, 651 { SYMBOL_INDEX (QCfamily), font_prop_validate_symbol },
652 { XSYMBOL_INIT (QCadstyle), font_prop_validate_symbol }, 652 { SYMBOL_INDEX (QCadstyle), font_prop_validate_symbol },
653 { XSYMBOL_INIT (QCregistry), font_prop_validate_symbol }, 653 { SYMBOL_INDEX (QCregistry), font_prop_validate_symbol },
654 { XSYMBOL_INIT (QCweight), font_prop_validate_style }, 654 { SYMBOL_INDEX (QCweight), font_prop_validate_style },
655 { XSYMBOL_INIT (QCslant), font_prop_validate_style }, 655 { SYMBOL_INDEX (QCslant), font_prop_validate_style },
656 { XSYMBOL_INIT (QCwidth), font_prop_validate_style }, 656 { SYMBOL_INDEX (QCwidth), font_prop_validate_style },
657 { XSYMBOL_INIT (QCsize), font_prop_validate_non_neg }, 657 { SYMBOL_INDEX (QCsize), font_prop_validate_non_neg },
658 { XSYMBOL_INIT (QCdpi), font_prop_validate_non_neg }, 658 { SYMBOL_INDEX (QCdpi), font_prop_validate_non_neg },
659 { XSYMBOL_INIT (QCspacing), font_prop_validate_spacing }, 659 { SYMBOL_INDEX (QCspacing), font_prop_validate_spacing },
660 { XSYMBOL_INIT (QCavgwidth), font_prop_validate_non_neg }, 660 { SYMBOL_INDEX (QCavgwidth), font_prop_validate_non_neg },
661 /* The order of the above entries must match with enum 661 /* The order of the above entries must match with enum
662 font_property_index. */ 662 font_property_index. */
663 { XSYMBOL_INIT (QClang), font_prop_validate_symbol }, 663 { SYMBOL_INDEX (QClang), font_prop_validate_symbol },
664 { XSYMBOL_INIT (QCscript), font_prop_validate_symbol }, 664 { SYMBOL_INDEX (QCscript), font_prop_validate_symbol },
665 { XSYMBOL_INIT (QCotf), font_prop_validate_otf } 665 { SYMBOL_INDEX (QCotf), font_prop_validate_otf }
666 }; 666 };
667 667
668/* Return an index number of font property KEY or -1 if KEY is not an 668/* 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)
674 int i; 674 int i;
675 675
676 for (i = 0; i < ARRAYELTS (font_property_table); i++) 676 for (i = 0; i < ARRAYELTS (font_property_table); i++)
677 if (EQ (key, make_lisp_symbol (font_property_table[i].key))) 677 if (EQ (key, builtin_lisp_symbol (font_property_table[i].key)))
678 return i; 678 return i;
679 return -1; 679 return -1;
680} 680}
@@ -691,7 +691,7 @@ font_prop_validate (int idx, Lisp_Object prop, Lisp_Object val)
691 if (NILP (val)) 691 if (NILP (val))
692 return val; 692 return val;
693 if (NILP (prop)) 693 if (NILP (prop))
694 prop = make_lisp_symbol (font_property_table[idx].key); 694 prop = builtin_lisp_symbol (font_property_table[idx].key);
695 else 695 else
696 { 696 {
697 idx = get_font_prop_index (prop); 697 idx = get_font_prop_index (prop);