aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-09-14 08:47:21 -0700
committerPaul Eggert2011-09-14 08:47:21 -0700
commitd2eea5b594ddfb4f5d99c1dcf710d279ae923a2c (patch)
tree797a478ec77e71088487891d2c3f1b0eaee519a5 /src
parent17bb0a2d8363621ce5b5c3fe16dc35b85ac9d455 (diff)
downloademacs-d2eea5b594ddfb4f5d99c1dcf710d279ae923a2c.tar.gz
emacs-d2eea5b594ddfb4f5d99c1dcf710d279ae923a2c.zip
* xselect.c: Use signed conversions more consistently (Bug#9498).
(selection_data_to_lisp_data): Assume incoming selection data are signed integers, not unsigned. This is to be consistent with outgoing selection data, which was modified to use signed integers in as part of the fix to Bug#9196 in response to Jan Djärv's comment in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11 expects long, not unsigned long.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/xselect.c8
2 files changed, 14 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9f8361153a1..fd3de54c3e9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12011-09-14 Paul Eggert <eggert@cs.ucla.edu>
2
3 * xselect.c: Use signed conversions more consistently (Bug#9498).
4 (selection_data_to_lisp_data): Assume incoming selection data are
5 signed integers, not unsigned. This is to be consistent with
6 outgoing selection data, which was modified to use signed integers
7 in as part of the fix to Bug#9196 in response to Jan D.'s comment
8 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
9 expects long, not unsigned long.
10
12011-09-14 Eli Zaretskii <eliz@gnu.org> 112011-09-14 Eli Zaretskii <eliz@gnu.org>
2 12
3 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect 13 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
diff --git a/src/xselect.c b/src/xselect.c
index 241622e81b3..29e8552bb9c 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1685,9 +1685,9 @@ selection_data_to_lisp_data (Display *display, const unsigned char *data,
1685 convert it to a cons of integers, 16 bits in each half. 1685 convert it to a cons of integers, 16 bits in each half.
1686 */ 1686 */
1687 else if (format == 32 && size == sizeof (int)) 1687 else if (format == 32 && size == sizeof (int))
1688 return INTEGER_TO_CONS (((unsigned int *) data) [0]); 1688 return INTEGER_TO_CONS (((int *) data) [0]);
1689 else if (format == 16 && size == sizeof (short)) 1689 else if (format == 16 && size == sizeof (short))
1690 return make_number (((unsigned short *) data) [0]); 1690 return make_number (((short *) data) [0]);
1691 1691
1692 /* Convert any other kind of data to a vector of numbers, represented 1692 /* Convert any other kind of data to a vector of numbers, represented
1693 as above (as an integer, or a cons of two 16 bit integers.) 1693 as above (as an integer, or a cons of two 16 bit integers.)
@@ -1699,7 +1699,7 @@ selection_data_to_lisp_data (Display *display, const unsigned char *data,
1699 v = Fmake_vector (make_number (size / 2), make_number (0)); 1699 v = Fmake_vector (make_number (size / 2), make_number (0));
1700 for (i = 0; i < size / 2; i++) 1700 for (i = 0; i < size / 2; i++)
1701 { 1701 {
1702 EMACS_INT j = ((unsigned short *) data) [i]; 1702 EMACS_INT j = ((short *) data) [i];
1703 Faset (v, make_number (i), make_number (j)); 1703 Faset (v, make_number (i), make_number (j));
1704 } 1704 }
1705 return v; 1705 return v;
@@ -1711,7 +1711,7 @@ selection_data_to_lisp_data (Display *display, const unsigned char *data,
1711 make_number (0)); 1711 make_number (0));
1712 for (i = 0; i < size / X_LONG_SIZE; i++) 1712 for (i = 0; i < size / X_LONG_SIZE; i++)
1713 { 1713 {
1714 unsigned int j = ((unsigned int *) data) [i]; 1714 int j = ((int *) data) [i];
1715 Faset (v, make_number (i), INTEGER_TO_CONS (j)); 1715 Faset (v, make_number (i), INTEGER_TO_CONS (j));
1716 } 1716 }
1717 return v; 1717 return v;