Commit 41bf8653 authored by Paul Eggert's avatar Paul Eggert

Clean up and simplify image-type setup

This also fixes an unlikely hang involving a circular image
description.
* src/dispextern.h (struct image.type): Now pointer-to-const.
* src/image.c (struct image_type.init) [!WINDOWSNT]: Omit.
(IMAGE_TYPE_INIT): New macro.
(image_types): Now a small array-of-const, not a pointer.
(CACHE_IMAGE_TYPE): Remove; the code’s simpler without it.
(ADD_IMAGE_TYPE): Remove this macro, replacing with ...
(add_image_type): ... this equivalent function.  All uses changed.
(define_image_type): Remove.  All uses removed.
(valid_image_p): Use FOR_EACH_TAIL_SAFE to avoid Emacs hanging
if the user creates a circular description of an image.
(xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
(gif_type, imagemagick_type, svg_type, gs_type):
Remove; now done by image_types.
(init_imagemagick_functions): Remove decl of nonexistent function.
(gs_clear_image): Remove; all uses replaced by image_clear_image.
(initialize_image_type): New function, which captures a lot
of the previously-scattered WINDOWSNT ifdefs.
(lookup_image_type): Use it.
(reset_image_types): Remove.  All uses removed.
(syms_of_image): Don’t worry about ignoring image_types for
pdumper, since it’s a constant now.
parent 4fbcecfa
Pipeline #1709 failed with stage
in 50 minutes and 26 seconds
......@@ -3036,7 +3036,7 @@ struct image
int hmargin, vmargin;
/* Reference to the type of the image. */
struct image_type *type;
struct image_type const *type;
/* True means that loading the image failed. Don't try again. */
bool load_failed_p;
......
......@@ -2494,9 +2494,6 @@ You must run Emacs in batch mode in order to dump it. */)
# ifdef WINDOWSNT
Vlibrary_cache = Qnil;
# endif
# ifdef HAVE_WINDOW_SYSTEM
reset_image_types ();
# endif
Vpurify_flag = tem;
......
This diff is collapsed.
......@@ -3643,7 +3643,6 @@ extern void init_fringe_once (void);
/* Defined in image.c. */
extern int x_bitmap_mask (struct frame *, ptrdiff_t);
extern void reset_image_types (void);
extern void syms_of_image (void);
#ifdef HAVE_JSON
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment