aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2005-02-08 21:27:01 +0000
committerJan Djärv2005-02-08 21:27:01 +0000
commitb8d6f4af9785fe4f5a1343e9a3239af0be800e4d (patch)
tree71a1f4069d23734504faf107963d2dca3110f9f2 /src
parent3419757dfd171e5032b2f6bd69ce17a71800611b (diff)
downloademacs-b8d6f4af9785fe4f5a1343e9a3239af0be800e4d.tar.gz
emacs-b8d6f4af9785fe4f5a1343e9a3239af0be800e4d.zip
* xselect.c (selection_data_to_lisp_data): For the special case
type == XA_ATOM, data contains array of int, not array of Atom. (x_property_data_to_lisp, selection_data_to_lisp_data): Comment update: data must be array of int for format == 32.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/xselect.c26
2 files changed, 27 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4c628e025aa..aaf0ac1e3d0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12005-02-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * xselect.c (selection_data_to_lisp_data): For the special case
4 type == XA_ATOM, data contains array of int, not array of Atom.
5 (x_property_data_to_lisp, selection_data_to_lisp_data): Comment
6 update: data must be array of int for format == 32.
7
12005-02-08 Stefan Monnier <monnier@iro.umontreal.ca> 82005-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * undo.c (Fprimitive_undo): Check veracity of delta,start,end. 10 * undo.c (Fprimitive_undo): Check veracity of delta,start,end.
diff --git a/src/xselect.c b/src/xselect.c
index f54e685873a..bf37cde4d0b 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1769,7 +1769,11 @@ x_get_window_property_as_lisp_data (display, window, property, target_type,
1769 1769
1770 When converting an object to C, it may be of the form (SYMBOL . <data>) 1770 When converting an object to C, it may be of the form (SYMBOL . <data>)
1771 where SYMBOL is what we should claim that the type is. Format and 1771 where SYMBOL is what we should claim that the type is. Format and
1772 representation are as above. */ 1772 representation are as above.
1773
1774 Important: When format is 32, data should contain an array of int,
1775 not an array of long as the X library returns. This makes a difference
1776 when sizeof(long) != sizeof(int). */
1773 1777
1774 1778
1775 1779
@@ -1811,15 +1815,21 @@ selection_data_to_lisp_data (display, data, size, type, format)
1811 else if (type == XA_ATOM) 1815 else if (type == XA_ATOM)
1812 { 1816 {
1813 int i; 1817 int i;
1814 if (size == sizeof (Atom)) 1818 /* On a 64 bit machine sizeof(Atom) == sizeof(long) == 8.
1815 return x_atom_to_symbol (display, *((Atom *) data)); 1819 But the callers of these function has made sure the data for
1820 format == 32 is an array of int. Thus, use int instead
1821 of Atom. */
1822 int *idata = (int *) data;
1823
1824 if (size == sizeof (int))
1825 return x_atom_to_symbol (display, (Atom) idata[0]);
1816 else 1826 else
1817 { 1827 {
1818 Lisp_Object v = Fmake_vector (make_number (size / sizeof (Atom)), 1828 Lisp_Object v = Fmake_vector (make_number (size / sizeof (int)),
1819 make_number (0)); 1829 make_number (0));
1820 for (i = 0; i < size / sizeof (Atom); i++) 1830 for (i = 0; i < size / sizeof (int); i++)
1821 Faset (v, make_number (i), 1831 Faset (v, make_number (i),
1822 x_atom_to_symbol (display, ((Atom *) data) [i])); 1832 x_atom_to_symbol (display, (Atom) idata[i]));
1823 return v; 1833 return v;
1824 } 1834 }
1825 } 1835 }
@@ -2560,6 +2570,10 @@ x_fill_property_data (dpy, data, ret, format)
2560 be stored in RET. 2570 be stored in RET.
2561 SIZE is the number of elements in DATA. 2571 SIZE is the number of elements in DATA.
2562 2572
2573 Important: When format is 32, data should contain an array of int,
2574 not an array of long as the X library returns. This makes a difference
2575 when sizeof(long) != sizeof(int).
2576
2563 Also see comment for selection_data_to_lisp_data above. */ 2577 Also see comment for selection_data_to_lisp_data above. */
2564 2578
2565Lisp_Object 2579Lisp_Object