aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2011-06-10 22:47:05 -0700
committerPaul Eggert2011-06-10 22:47:05 -0700
commit78cf1fe8a256ffc91533b43eb851bf4519e9fbcc (patch)
tree84b4d0a579e858040d49e6561be096132860446b
parentfc83f7d3d422039f041bbcc4f0cb75a1699421ad (diff)
parentb50691aaafa255709b1117000ce6fb98d9772695 (diff)
downloademacs-78cf1fe8a256ffc91533b43eb851bf4519e9fbcc.tar.gz
emacs-78cf1fe8a256ffc91533b43eb851bf4519e9fbcc.zip
Merge from trunk.
-rw-r--r--src/ChangeLog10
-rw-r--r--src/dispextern.h13
-rw-r--r--src/image.c61
3 files changed, 42 insertions, 42 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9c2662699be..82fd3526785 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -70,6 +70,16 @@
70 70
71 * alloc.c (Fmake_string): Check for out-of-range init. 71 * alloc.c (Fmake_string): Check for out-of-range init.
72 72
732011-06-11 Chong Yidong <cyd@stupidchicken.com>
74
75 * dispextern.h (struct image): Replace data member, whose int_val
76 and ptr_val fields were not used by anything, with a single
77 lisp_val object.
78
79 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
80 (gif_clear_image, gif_load, imagemagick_load_image)
81 (gs_clear_image, gs_load): Callers changed.
82
732011-06-10 Paul Eggert <eggert@cs.ucla.edu> 832011-06-10 Paul Eggert <eggert@cs.ucla.edu>
74 84
75 * buffer.h: Include <time.h>, for time_t. 85 * buffer.h: Include <time.h>, for time_t.
diff --git a/src/dispextern.h b/src/dispextern.h
index 15e44e0286e..211a1b06659 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2792,16 +2792,9 @@ struct image
2792 /* 1 means that loading the image failed. Don't try again. */ 2792 /* 1 means that loading the image failed. Don't try again. */
2793 unsigned load_failed_p; 2793 unsigned load_failed_p;
2794 2794
2795 /* A place for image types to store additional data. The member 2795 /* A place for image types to store additional data. It is marked
2796 data.lisp_val is marked during GC, so it's safe to store Lisp data 2796 during GC. */
2797 there. Image types should free this data when their `free' 2797 Lisp_Object lisp_data;
2798 function is called. */
2799 struct
2800 {
2801 int int_val;
2802 void *ptr_val;
2803 Lisp_Object lisp_val;
2804 } data;
2805 2798
2806 /* Hash value of image specification to speed up comparisons. */ 2799 /* Hash value of image specification to speed up comparisons. */
2807 EMACS_UINT hash; 2800 EMACS_UINT hash;
diff --git a/src/image.c b/src/image.c
index f36e097b58c..b755d741443 100644
--- a/src/image.c
+++ b/src/image.c
@@ -971,7 +971,7 @@ or omitted means use the selected frame. */)
971 struct frame *f = check_x_frame (frame); 971 struct frame *f = check_x_frame (frame);
972 int id = lookup_image (f, spec); 972 int id = lookup_image (f, spec);
973 struct image *img = IMAGE_FROM_ID (f, id); 973 struct image *img = IMAGE_FROM_ID (f, id);
974 ext = img->data.lisp_val; 974 ext = img->lisp_data;
975 } 975 }
976 976
977 return ext; 977 return ext;
@@ -1001,7 +1001,7 @@ make_image (Lisp_Object spec, EMACS_UINT hash)
1001 img->type = lookup_image_type (image_spec_value (spec, QCtype, NULL)); 1001 img->type = lookup_image_type (image_spec_value (spec, QCtype, NULL));
1002 xassert (img->type != NULL); 1002 xassert (img->type != NULL);
1003 img->spec = spec; 1003 img->spec = spec;
1004 img->data.lisp_val = Qnil; 1004 img->lisp_data = Qnil;
1005 img->ascent = DEFAULT_IMAGE_ASCENT; 1005 img->ascent = DEFAULT_IMAGE_ASCENT;
1006 img->hash = hash; 1006 img->hash = hash;
1007 img->corners[BOT_CORNER] = -1; /* Full image */ 1007 img->corners[BOT_CORNER] = -1; /* Full image */
@@ -1864,8 +1864,8 @@ mark_image (struct image *img)
1864 mark_object (img->spec); 1864 mark_object (img->spec);
1865 mark_object (img->dependencies); 1865 mark_object (img->dependencies);
1866 1866
1867 if (!NILP (img->data.lisp_val)) 1867 if (!NILP (img->lisp_data))
1868 mark_object (img->data.lisp_val); 1868 mark_object (img->lisp_data);
1869} 1869}
1870 1870
1871 1871
@@ -6818,9 +6818,9 @@ tiff_load (struct frame *f, struct image *img)
6818 continue; 6818 continue;
6819 6819
6820 if (count > 1) 6820 if (count > 1)
6821 img->data.lisp_val = Fcons (Qcount, 6821 img->lisp_data = Fcons (Qcount,
6822 Fcons (make_number (count), 6822 Fcons (make_number (count),
6823 img->data.lisp_val)); 6823 img->lisp_data));
6824 6824
6825 fn_TIFFClose (tiff); 6825 fn_TIFFClose (tiff);
6826 if (!rc) 6826 if (!rc)
@@ -6959,8 +6959,7 @@ static struct image_type gif_type =
6959static void 6959static void
6960gif_clear_image (struct frame *f, struct image *img) 6960gif_clear_image (struct frame *f, struct image *img)
6961{ 6961{
6962 /* IMG->data.ptr_val may contain metadata with extension data. */ 6962 img->lisp_data = Qnil;
6963 img->data.lisp_val = Qnil;
6964 x_clear_image (f, img); 6963 x_clear_image (f, img);
6965} 6964}
6966 6965
@@ -7313,23 +7312,23 @@ gif_load (struct frame *f, struct image *img)
7313 7312
7314 /* Save GIF image extension data for `image-metadata'. 7313 /* Save GIF image extension data for `image-metadata'.
7315 Format is (count IMAGES extension-data (FUNCTION "BYTES" ...)). */ 7314 Format is (count IMAGES extension-data (FUNCTION "BYTES" ...)). */
7316 img->data.lisp_val = Qnil; 7315 img->lisp_data = Qnil;
7317 if (gif->SavedImages[idx].ExtensionBlockCount > 0) 7316 if (gif->SavedImages[idx].ExtensionBlockCount > 0)
7318 { 7317 {
7319 ExtensionBlock *ext = gif->SavedImages[idx].ExtensionBlocks; 7318 ExtensionBlock *ext = gif->SavedImages[idx].ExtensionBlocks;
7320 for (i = 0; i < gif->SavedImages[idx].ExtensionBlockCount; i++, ext++) 7319 for (i = 0; i < gif->SavedImages[idx].ExtensionBlockCount; i++, ext++)
7321 /* Append (... FUNCTION "BYTES") */ 7320 /* Append (... FUNCTION "BYTES") */
7322 img->data.lisp_val = Fcons (make_unibyte_string (ext->Bytes, ext->ByteCount), 7321 img->lisp_data = Fcons (make_unibyte_string (ext->Bytes, ext->ByteCount),
7323 Fcons (make_number (ext->Function), 7322 Fcons (make_number (ext->Function),
7324 img->data.lisp_val)); 7323 img->lisp_data));
7325 img->data.lisp_val = Fcons (Qextension_data, 7324 img->lisp_data = Fcons (Qextension_data,
7326 Fcons (Fnreverse (img->data.lisp_val), 7325 Fcons (Fnreverse (img->lisp_data),
7327 Qnil)); 7326 Qnil));
7328 } 7327 }
7329 if (gif->ImageCount > 1) 7328 if (gif->ImageCount > 1)
7330 img->data.lisp_val = Fcons (Qcount, 7329 img->lisp_data = Fcons (Qcount,
7331 Fcons (make_number (gif->ImageCount), 7330 Fcons (make_number (gif->ImageCount),
7332 img->data.lisp_val)); 7331 img->lisp_data));
7333 7332
7334 fn_DGifCloseFile (gif); 7333 fn_DGifCloseFile (gif);
7335 7334
@@ -7537,10 +7536,10 @@ imagemagick_load_image (struct frame *f, struct image *img,
7537 } 7536 }
7538 7537
7539 if (MagickGetNumberImages(ping_wand) > 1) 7538 if (MagickGetNumberImages(ping_wand) > 1)
7540 img->data.lisp_val = 7539 img->lisp_data =
7541 Fcons (Qcount, 7540 Fcons (Qcount,
7542 Fcons (make_number (MagickGetNumberImages (ping_wand)), 7541 Fcons (make_number (MagickGetNumberImages (ping_wand)),
7543 img->data.lisp_val)); 7542 img->lisp_data));
7544 7543
7545 DestroyMagickWand (ping_wand); 7544 DestroyMagickWand (ping_wand);
7546 7545
@@ -8340,8 +8339,6 @@ static struct image_type gs_type =
8340static void 8339static void
8341gs_clear_image (struct frame *f, struct image *img) 8340gs_clear_image (struct frame *f, struct image *img)
8342{ 8341{
8343 /* IMG->data.ptr_val may contain a recorded colormap. */
8344 xfree (img->data.ptr_val);
8345 x_clear_image (f, img); 8342 x_clear_image (f, img);
8346} 8343}
8347 8344
@@ -8450,12 +8447,12 @@ gs_load (struct frame *f, struct image *img)
8450 if (NILP (loader)) 8447 if (NILP (loader))
8451 loader = intern ("gs-load-image"); 8448 loader = intern ("gs-load-image");
8452 8449
8453 img->data.lisp_val = call6 (loader, frame, img->spec, 8450 img->lisp_data = call6 (loader, frame, img->spec,
8454 make_number (img->width), 8451 make_number (img->width),
8455 make_number (img->height), 8452 make_number (img->height),
8456 window_and_pixmap_id, 8453 window_and_pixmap_id,
8457 pixel_colors); 8454 pixel_colors);
8458 return PROCESSP (img->data.lisp_val); 8455 return PROCESSP (img->lisp_data);
8459} 8456}
8460 8457
8461 8458
@@ -8483,9 +8480,9 @@ x_kill_gs_process (Pixmap pixmap, struct frame *f)
8483 /* Kill the GS process. We should have found PIXMAP in the image 8480 /* Kill the GS process. We should have found PIXMAP in the image
8484 cache and its image should contain a process object. */ 8481 cache and its image should contain a process object. */
8485 img = c->images[i]; 8482 img = c->images[i];
8486 xassert (PROCESSP (img->data.lisp_val)); 8483 xassert (PROCESSP (img->lisp_data));
8487 Fkill_process (img->data.lisp_val, Qnil); 8484 Fkill_process (img->lisp_data, Qnil);
8488 img->data.lisp_val = Qnil; 8485 img->lisp_data = Qnil;
8489 8486
8490#if defined (HAVE_X_WINDOWS) 8487#if defined (HAVE_X_WINDOWS)
8491 8488