diff options
| author | Paul Eggert | 2015-01-10 13:33:38 -0800 |
|---|---|---|
| committer | Paul Eggert | 2015-01-10 13:42:35 -0800 |
| commit | 6a37ecee0884ff30ac7666e6502e2a9d2608f291 (patch) | |
| tree | 875bd8310981ff850911f04da4c3c3b95f34537b /src/image.c | |
| parent | 649937920b5023be5c0685d1537f5ea2bfb9899a (diff) | |
| download | emacs-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/image.c')
| -rw-r--r-- | src/image.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/image.c b/src/image.c index addb932f834..5d08a890234 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -548,8 +548,8 @@ static struct image_type * | |||
| 548 | define_image_type (struct image_type *type) | 548 | define_image_type (struct image_type *type) |
| 549 | { | 549 | { |
| 550 | struct image_type *p = NULL; | 550 | struct image_type *p = NULL; |
| 551 | struct Lisp_Symbol *new_type = type->type; | 551 | int new_type = type->type; |
| 552 | bool type_valid = 1; | 552 | bool type_valid = true; |
| 553 | 553 | ||
| 554 | block_input (); | 554 | block_input (); |
| 555 | 555 | ||
| @@ -561,14 +561,15 @@ define_image_type (struct image_type *type) | |||
| 561 | { | 561 | { |
| 562 | #if defined HAVE_NTGUI && defined WINDOWSNT | 562 | #if defined HAVE_NTGUI && defined WINDOWSNT |
| 563 | /* If we failed to load the library before, don't try again. */ | 563 | /* If we failed to load the library before, don't try again. */ |
| 564 | Lisp_Object tested = Fassq (make_lisp_symbol (new_type), Vlibrary_cache); | 564 | Lisp_Object tested = Fassq (builtin_lisp_symbol (new_type), |
| 565 | Vlibrary_cache); | ||
| 565 | if (CONSP (tested) && NILP (XCDR (tested))) | 566 | if (CONSP (tested) && NILP (XCDR (tested))) |
| 566 | type_valid = 0; | 567 | type_valid = false; |
| 567 | else | 568 | else |
| 568 | #endif | 569 | #endif |
| 569 | { | 570 | { |
| 570 | type_valid = type->init (); | 571 | type_valid = type->init (); |
| 571 | CACHE_IMAGE_TYPE (make_lisp_symbol (new_type), | 572 | CACHE_IMAGE_TYPE (builtin_lisp_symbol (new_type), |
| 572 | type_valid ? Qt : Qnil); | 573 | type_valid ? Qt : Qnil); |
| 573 | } | 574 | } |
| 574 | } | 575 | } |
| @@ -1747,7 +1748,7 @@ lookup_image (struct frame *f, Lisp_Object spec) | |||
| 1747 | 1748 | ||
| 1748 | /* Do image transformations and compute masks, unless we | 1749 | /* Do image transformations and compute masks, unless we |
| 1749 | don't have the image yet. */ | 1750 | don't have the image yet. */ |
| 1750 | if (!EQ (make_lisp_symbol (img->type->type), Qpostscript)) | 1751 | if (!EQ (builtin_lisp_symbol (img->type->type), Qpostscript)) |
| 1751 | postprocess_image (f, img); | 1752 | postprocess_image (f, img); |
| 1752 | } | 1753 | } |
| 1753 | 1754 | ||
| @@ -2332,7 +2333,7 @@ static const struct image_keyword xbm_format[XBM_LAST] = | |||
| 2332 | 2333 | ||
| 2333 | static struct image_type xbm_type = | 2334 | static struct image_type xbm_type = |
| 2334 | { | 2335 | { |
| 2335 | XSYMBOL_INIT (Qxbm), | 2336 | SYMBOL_INDEX (Qxbm), |
| 2336 | xbm_image_p, | 2337 | xbm_image_p, |
| 2337 | xbm_load, | 2338 | xbm_load, |
| 2338 | x_clear_image, | 2339 | x_clear_image, |
| @@ -3138,7 +3139,7 @@ static bool init_xpm_functions (void); | |||
| 3138 | 3139 | ||
| 3139 | static struct image_type xpm_type = | 3140 | static struct image_type xpm_type = |
| 3140 | { | 3141 | { |
| 3141 | XSYMBOL_INIT (Qxpm), | 3142 | SYMBOL_INDEX (Qxpm), |
| 3142 | xpm_image_p, | 3143 | xpm_image_p, |
| 3143 | xpm_load, | 3144 | xpm_load, |
| 3144 | x_clear_image, | 3145 | x_clear_image, |
| @@ -5066,7 +5067,7 @@ static const struct image_keyword pbm_format[PBM_LAST] = | |||
| 5066 | 5067 | ||
| 5067 | static struct image_type pbm_type = | 5068 | static struct image_type pbm_type = |
| 5068 | { | 5069 | { |
| 5069 | XSYMBOL_INIT (Qpbm), | 5070 | SYMBOL_INDEX (Qpbm), |
| 5070 | pbm_image_p, | 5071 | pbm_image_p, |
| 5071 | pbm_load, | 5072 | pbm_load, |
| 5072 | x_clear_image, | 5073 | x_clear_image, |
| @@ -5453,7 +5454,7 @@ static bool init_png_functions (void); | |||
| 5453 | 5454 | ||
| 5454 | static struct image_type png_type = | 5455 | static struct image_type png_type = |
| 5455 | { | 5456 | { |
| 5456 | XSYMBOL_INIT (Qpng), | 5457 | SYMBOL_INDEX (Qpng), |
| 5457 | png_image_p, | 5458 | png_image_p, |
| 5458 | png_load, | 5459 | png_load, |
| 5459 | x_clear_image, | 5460 | x_clear_image, |
| @@ -6105,7 +6106,7 @@ static bool init_jpeg_functions (void); | |||
| 6105 | 6106 | ||
| 6106 | static struct image_type jpeg_type = | 6107 | static struct image_type jpeg_type = |
| 6107 | { | 6108 | { |
| 6108 | XSYMBOL_INIT (Qjpeg), | 6109 | SYMBOL_INDEX (Qjpeg), |
| 6109 | jpeg_image_p, | 6110 | jpeg_image_p, |
| 6110 | jpeg_load, | 6111 | jpeg_load, |
| 6111 | x_clear_image, | 6112 | x_clear_image, |
| @@ -6705,7 +6706,7 @@ static bool init_tiff_functions (void); | |||
| 6705 | 6706 | ||
| 6706 | static struct image_type tiff_type = | 6707 | static struct image_type tiff_type = |
| 6707 | { | 6708 | { |
| 6708 | XSYMBOL_INIT (Qtiff), | 6709 | SYMBOL_INDEX (Qtiff), |
| 6709 | tiff_image_p, | 6710 | tiff_image_p, |
| 6710 | tiff_load, | 6711 | tiff_load, |
| 6711 | x_clear_image, | 6712 | x_clear_image, |
| @@ -7164,7 +7165,7 @@ static bool init_gif_functions (void); | |||
| 7164 | 7165 | ||
| 7165 | static struct image_type gif_type = | 7166 | static struct image_type gif_type = |
| 7166 | { | 7167 | { |
| 7167 | XSYMBOL_INIT (Qgif), | 7168 | SYMBOL_INDEX (Qgif), |
| 7168 | gif_image_p, | 7169 | gif_image_p, |
| 7169 | gif_load, | 7170 | gif_load, |
| 7170 | gif_clear_image, | 7171 | gif_clear_image, |
| @@ -7851,7 +7852,7 @@ static bool init_imagemagick_functions (void); | |||
| 7851 | 7852 | ||
| 7852 | static struct image_type imagemagick_type = | 7853 | static struct image_type imagemagick_type = |
| 7853 | { | 7854 | { |
| 7854 | XSYMBOL_INIT (Qimagemagick), | 7855 | SYMBOL_INDEX (Qimagemagick), |
| 7855 | imagemagick_image_p, | 7856 | imagemagick_image_p, |
| 7856 | imagemagick_load, | 7857 | imagemagick_load, |
| 7857 | imagemagick_clear_image, | 7858 | imagemagick_clear_image, |
| @@ -8623,7 +8624,7 @@ static bool init_svg_functions (void); | |||
| 8623 | 8624 | ||
| 8624 | static struct image_type svg_type = | 8625 | static struct image_type svg_type = |
| 8625 | { | 8626 | { |
| 8626 | XSYMBOL_INIT (Qsvg), | 8627 | SYMBOL_INDEX (Qsvg), |
| 8627 | svg_image_p, | 8628 | svg_image_p, |
| 8628 | svg_load, | 8629 | svg_load, |
| 8629 | x_clear_image, | 8630 | x_clear_image, |
| @@ -9039,7 +9040,7 @@ static const struct image_keyword gs_format[GS_LAST] = | |||
| 9039 | 9040 | ||
| 9040 | static struct image_type gs_type = | 9041 | static struct image_type gs_type = |
| 9041 | { | 9042 | { |
| 9042 | XSYMBOL_INIT (Qpostscript), | 9043 | SYMBOL_INDEX (Qpostscript), |
| 9043 | gs_image_p, | 9044 | gs_image_p, |
| 9044 | gs_load, | 9045 | gs_load, |
| 9045 | gs_clear_image, | 9046 | gs_clear_image, |