aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2013-08-15 18:41:51 +0200
committerJoakim Verona2013-08-15 18:41:51 +0200
commitd7d5ffd611d0fbeb9d55180d328e9203f3a1e199 (patch)
treeccad369b6a77e325d728c2e4cdeaa0f321d7a0f3 /src
parent50bedb930dc5a15cb7cb5d689d9f1726a14fb158 (diff)
parent0fe73012cda7153f85cff32db8df442a0859fa5b (diff)
downloademacs-d7d5ffd611d0fbeb9d55180d328e9203f3a1e199.tar.gz
emacs-d7d5ffd611d0fbeb9d55180d328e9203f3a1e199.zip
merge from trunk
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog20
-rw-r--r--src/emacs.c3
-rw-r--r--src/frame.c3
-rw-r--r--src/gmalloc.c9
-rw-r--r--src/image.c97
-rw-r--r--src/xdisp.c3
6 files changed, 82 insertions, 53 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 888db1f8cf4..c12b32ebc71 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,20 @@
12013-08-15 Ken Brown <kbrown@cornell.edu>
2
3 * emacs.c (main): Update comment about G_SLICE_ALWAYS_MALLOC.
4 * gmalloc.c (memalign) [CYGWIN]: Revert last change; it's not
5 needed.
6
72013-08-15 Paul Eggert <eggert@cs.ucla.edu>
8
9 Fix minor problems found by static checking.
10 * frame.c (delete_frame):
11 * xdisp.c (next_element_from_display_vector):
12 Avoid uninitialized local.
13 * image.c (imagemagick_compute_animated_image): Port to C89.
14 Prefer usual GNU indentation style for loops.
15 Be more careful about bizarrely large sizes, by using ptrdiff_t
16 instead of int.
17
12013-08-15 Dmitry Antipov <dmantipov@yandex.ru> 182013-08-15 Dmitry Antipov <dmantipov@yandex.ru>
2 19
3 Fix infinite frame selection loop (Bug#15025). 20 Fix infinite frame selection loop (Bug#15025).
@@ -18,6 +35,9 @@
18 35
19 * image.c (imagemagick_compute_animated_image): Implement animated 36 * image.c (imagemagick_compute_animated_image): Implement animated
20 images (bug#14700). 37 images (bug#14700).
38 (imagemagick_compute_animated_image): Fix some compilation
39 warnings. Implement a very simple cache to make the animation
40 usable at all, but it should be replaced with a per-image cache.
21 41
222013-08-15 Dmitry Antipov <dmantipov@yandex.ru> 422013-08-15 Dmitry Antipov <dmantipov@yandex.ru>
23 43
diff --git a/src/emacs.c b/src/emacs.c
index 9b8283cd64c..96a5d33f363 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -699,7 +699,8 @@ main (int argc, char **argv)
699#endif 699#endif
700 700
701#ifdef G_SLICE_ALWAYS_MALLOC 701#ifdef G_SLICE_ALWAYS_MALLOC
702 /* This is used by the Cygwin build. */ 702 /* This is used by the Cygwin build. It's not needed starting with
703 cygwin-1.7.24, but it doesn't do any harm. */
703 xputenv ("G_SLICE=always-malloc"); 704 xputenv ("G_SLICE=always-malloc");
704#endif 705#endif
705 706
diff --git a/src/frame.c b/src/frame.c
index 957f08b06c5..5ee001f4d98 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1197,7 +1197,8 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1197 /* Don't let the frame remain selected. */ 1197 /* Don't let the frame remain selected. */
1198 if (f == sf) 1198 if (f == sf)
1199 { 1199 {
1200 Lisp_Object tail, frame1; 1200 Lisp_Object tail;
1201 Lisp_Object frame1 = Qnil;
1201 1202
1202 /* Look for another visible frame on the same terminal. 1203 /* Look for another visible frame on the same terminal.
1203 Do not call next_frame here because it may loop forever. 1204 Do not call next_frame here because it may loop forever.
diff --git a/src/gmalloc.c b/src/gmalloc.c
index 42ac0b03985..bc1d85ac5fb 100644
--- a/src/gmalloc.c
+++ b/src/gmalloc.c
@@ -1558,15 +1558,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. *
1558 1558
1559void *(*__memalign_hook) (size_t size, size_t alignment); 1559void *(*__memalign_hook) (size_t size, size_t alignment);
1560 1560
1561/* As of version 1.7.24, Cygwin allows applications to provide their
1562 own posix_memalign (but not memalign). But posix_memalign as
1563 defined in this file calls memalign, so we have to rename the
1564 latter in order to make sure that posix_memalign calls Emacs's
1565 memalign. */
1566#ifdef CYGWIN
1567#define memalign emacs_memalign
1568#endif
1569
1570void * 1561void *
1571memalign (size_t alignment, size_t size) 1562memalign (size_t alignment, size_t size)
1572{ 1563{
diff --git a/src/image.c b/src/image.c
index c534f181e5c..3cab72edf74 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7871,63 +7871,80 @@ imagemagick_filename_hint (Lisp_Object spec, char hint_buffer[MaxTextExtent])
7871 compute ann the preceding images to be able to display a particular 7871 compute ann the preceding images to be able to display a particular
7872 sub-image. */ 7872 sub-image. */
7873 7873
7874static MagickWand *animation_cache = NULL;
7875static int animation_index = 0;
7876
7874static MagickWand * 7877static MagickWand *
7875imagemagick_compute_animated_image (MagickWand *super_wand, int ino) 7878imagemagick_compute_animated_image (MagickWand *super_wand, int ino)
7876{ 7879{
7880 int i;
7877 MagickWand *composite_wand; 7881 MagickWand *composite_wand;
7878 7882
7879 MagickSetIteratorIndex (super_wand, 0); 7883 MagickSetIteratorIndex (super_wand, 0);
7880 composite_wand = MagickGetImage (super_wand);
7881 7884
7882 for (int i = 1; i <= ino; i++) { 7885 if (ino == 0 || animation_cache == NULL)
7883 MagickWand *sub_wand; 7886 composite_wand = MagickGetImage (super_wand);
7884 PixelIterator *source_iterator, *dest_iterator; 7887 else
7885 PixelWand **source, **dest; 7888 composite_wand = animation_cache;
7886 long source_width, dest_width;
7887 MagickPixelPacket pixel;
7888 7889
7889 MagickSetIteratorIndex (super_wand, i); 7890 for (i = max (1, animation_index); i <= ino; i++)
7890 sub_wand = MagickGetImage (super_wand); 7891 {
7892 MagickWand *sub_wand;
7893 PixelIterator *source_iterator, *dest_iterator;
7894 PixelWand **source, **dest;
7895 size_t source_width, dest_width;
7896 MagickPixelPacket pixel;
7891 7897
7892 source_iterator = NewPixelIterator (sub_wand); 7898 MagickSetIteratorIndex (super_wand, i);
7893 if (! source_iterator) 7899 sub_wand = MagickGetImage (super_wand);
7894 {
7895 DestroyMagickWand (composite_wand);
7896 DestroyMagickWand (sub_wand);
7897 image_error ("Imagemagick pixel iterator creation failed",
7898 Qnil, Qnil);
7899 return NULL;
7900 }
7901 7900
7902 dest_iterator = NewPixelIterator (composite_wand); 7901 source_iterator = NewPixelIterator (sub_wand);
7903 if (! dest_iterator) 7902 if (! source_iterator)
7904 { 7903 {
7905 DestroyMagickWand (composite_wand); 7904 DestroyMagickWand (composite_wand);
7906 DestroyMagickWand (sub_wand); 7905 DestroyMagickWand (sub_wand);
7907 DestroyPixelIterator (source_iterator); 7906 image_error ("Imagemagick pixel iterator creation failed",
7908 image_error ("Imagemagick pixel iterator creation failed", 7907 Qnil, Qnil);
7909 Qnil, Qnil); 7908 return NULL;
7910 return NULL; 7909 }
7911 } 7910
7911 dest_iterator = NewPixelIterator (composite_wand);
7912 if (! dest_iterator)
7913 {
7914 DestroyMagickWand (composite_wand);
7915 DestroyMagickWand (sub_wand);
7916 DestroyPixelIterator (source_iterator);
7917 image_error ("Imagemagick pixel iterator creation failed",
7918 Qnil, Qnil);
7919 return NULL;
7920 }
7912 7921
7913 while (source = PixelGetNextIteratorRow (source_iterator, &source_width)) { 7922 while ((source = PixelGetNextIteratorRow (source_iterator, &source_width))
7914 dest = PixelGetNextIteratorRow (dest_iterator, &dest_width); 7923 != NULL)
7915 for (int x = 0; x < source_width; x++)
7916 { 7924 {
7917 /* Copy over non-transparent pixels. */ 7925 ptrdiff_t x;
7918 if (PixelGetAlpha (source[x])) 7926 dest = PixelGetNextIteratorRow (dest_iterator, &dest_width);
7927 for (x = 0; x < source_width; x++)
7919 { 7928 {
7920 PixelGetMagickColor (source[x], &pixel); 7929 /* Copy over non-transparent pixels. */
7921 PixelSetMagickColor (dest[x], &pixel); 7930 if (PixelGetAlpha (source[x]))
7931 {
7932 PixelGetMagickColor (source[x], &pixel);
7933 PixelSetMagickColor (dest[x], &pixel);
7934 }
7922 } 7935 }
7936 PixelSyncIterator(dest_iterator);
7923 } 7937 }
7924 PixelSyncIterator(dest_iterator); 7938
7939 DestroyPixelIterator (source_iterator);
7940 DestroyPixelIterator (dest_iterator);
7941 DestroyMagickWand (sub_wand);
7925 } 7942 }
7926 7943
7927 DestroyPixelIterator (source_iterator); 7944 /* Cache a copy for the next iteration. The current wand will be
7928 DestroyPixelIterator (dest_iterator); 7945 destroyed by the caller. */
7929 DestroyMagickWand (sub_wand); 7946 animation_cache = CloneMagickWand (composite_wand);
7930 } 7947 animation_index = ino;
7931 7948
7932 return composite_wand; 7949 return composite_wand;
7933} 7950}
diff --git a/src/xdisp.c b/src/xdisp.c
index bfa012ef70c..5faa2abd72a 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -7550,6 +7550,7 @@ next_element_from_display_vector (struct it *it)
7550 /* For the last character of the box-face run, we need to look 7550 /* For the last character of the box-face run, we need to look
7551 either at the next glyph from the display vector, or at the 7551 either at the next glyph from the display vector, or at the
7552 face we saw before the display vector. */ 7552 face we saw before the display vector. */
7553 next_face_id = it->saved_face_id;
7553 if (it->current.dpvec_index < it->dpend - it->dpvec - 1) 7554 if (it->current.dpvec_index < it->dpend - it->dpvec - 1)
7554 { 7555 {
7555 if (it->dpvec_face_id >= 0) 7556 if (it->dpvec_face_id >= 0)
@@ -7564,8 +7565,6 @@ next_element_from_display_vector (struct it *it)
7564 it->saved_face_id); 7565 it->saved_face_id);
7565 } 7566 }
7566 } 7567 }
7567 else
7568 next_face_id = it->saved_face_id;
7569 next_face = FACE_FROM_ID (it->f, next_face_id); 7568 next_face = FACE_FROM_ID (it->f, next_face_id);
7570 it->end_of_box_run_p = (this_face && this_face->box != FACE_NO_BOX 7569 it->end_of_box_run_p = (this_face && this_face->box != FACE_NO_BOX
7571 && (!next_face 7570 && (!next_face