diff options
Diffstat (limited to 'src/xselect.c')
| -rw-r--r-- | src/xselect.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/xselect.c b/src/xselect.c index 64c64fa0c76..cca1a47212b 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* X Selection processing for Emacs. | 1 | /* X Selection processing for Emacs. |
| 2 | Copyright (C) 1993-1997, 2000-2012 Free Software Foundation, Inc. | 2 | Copyright (C) 1993-1997, 2000-2013 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| @@ -1120,7 +1120,7 @@ unexpect_property_change (struct prop_location *location) | |||
| 1120 | static Lisp_Object | 1120 | static Lisp_Object |
| 1121 | wait_for_property_change_unwind (Lisp_Object loc) | 1121 | wait_for_property_change_unwind (Lisp_Object loc) |
| 1122 | { | 1122 | { |
| 1123 | struct prop_location *location = XSAVE_VALUE (loc)->pointer; | 1123 | struct prop_location *location = XSAVE_POINTER (loc, 0); |
| 1124 | 1124 | ||
| 1125 | unexpect_property_change (location); | 1125 | unexpect_property_change (location); |
| 1126 | if (location == property_change_reply_object) | 1126 | if (location == property_change_reply_object) |
| @@ -1141,7 +1141,7 @@ wait_for_property_change (struct prop_location *location) | |||
| 1141 | 1141 | ||
| 1142 | /* Make sure to do unexpect_property_change if we quit or err. */ | 1142 | /* Make sure to do unexpect_property_change if we quit or err. */ |
| 1143 | record_unwind_protect (wait_for_property_change_unwind, | 1143 | record_unwind_protect (wait_for_property_change_unwind, |
| 1144 | make_save_value (location, 0)); | 1144 | make_save_pointer (location)); |
| 1145 | 1145 | ||
| 1146 | XSETCAR (property_change_reply, Qnil); | 1146 | XSETCAR (property_change_reply, Qnil); |
| 1147 | property_change_reply_object = location; | 1147 | property_change_reply_object = location; |
| @@ -1388,7 +1388,7 @@ x_get_window_property (Display *display, Window window, Atom property, | |||
| 1388 | data = data1; | 1388 | data = data1; |
| 1389 | } | 1389 | } |
| 1390 | 1390 | ||
| 1391 | if (32 < BITS_PER_LONG && *actual_format_ret == 32) | 1391 | if (BITS_PER_LONG > 32 && *actual_format_ret == 32) |
| 1392 | { | 1392 | { |
| 1393 | unsigned long i; | 1393 | unsigned long i; |
| 1394 | int *idata = (int *) (data + offset); | 1394 | int *idata = (int *) (data + offset); |
| @@ -1670,11 +1670,10 @@ selection_data_to_lisp_data (Display *display, const unsigned char *data, | |||
| 1670 | return x_atom_to_symbol (display, (Atom) idata[0]); | 1670 | return x_atom_to_symbol (display, (Atom) idata[0]); |
| 1671 | else | 1671 | else |
| 1672 | { | 1672 | { |
| 1673 | Lisp_Object v = Fmake_vector (make_number (size / sizeof (int)), | 1673 | Lisp_Object v = make_uninit_vector (size / sizeof (int)); |
| 1674 | make_number (0)); | 1674 | |
| 1675 | for (i = 0; i < size / sizeof (int); i++) | 1675 | for (i = 0; i < size / sizeof (int); i++) |
| 1676 | Faset (v, make_number (i), | 1676 | ASET (v, i, x_atom_to_symbol (display, (Atom) idata[i])); |
| 1677 | x_atom_to_symbol (display, (Atom) idata[i])); | ||
| 1678 | return v; | 1677 | return v; |
| 1679 | } | 1678 | } |
| 1680 | } | 1679 | } |
| @@ -1694,24 +1693,24 @@ selection_data_to_lisp_data (Display *display, const unsigned char *data, | |||
| 1694 | else if (format == 16) | 1693 | else if (format == 16) |
| 1695 | { | 1694 | { |
| 1696 | ptrdiff_t i; | 1695 | ptrdiff_t i; |
| 1697 | Lisp_Object v; | 1696 | Lisp_Object v = make_uninit_vector (size / 2); |
| 1698 | v = Fmake_vector (make_number (size / 2), make_number (0)); | 1697 | |
| 1699 | for (i = 0; i < size / 2; i++) | 1698 | for (i = 0; i < size / 2; i++) |
| 1700 | { | 1699 | { |
| 1701 | short j = ((short *) data) [i]; | 1700 | short j = ((short *) data) [i]; |
| 1702 | Faset (v, make_number (i), make_number (j)); | 1701 | ASET (v, i, make_number (j)); |
| 1703 | } | 1702 | } |
| 1704 | return v; | 1703 | return v; |
| 1705 | } | 1704 | } |
| 1706 | else | 1705 | else |
| 1707 | { | 1706 | { |
| 1708 | ptrdiff_t i; | 1707 | ptrdiff_t i; |
| 1709 | Lisp_Object v = Fmake_vector (make_number (size / X_LONG_SIZE), | 1708 | Lisp_Object v = make_uninit_vector (size / X_LONG_SIZE); |
| 1710 | make_number (0)); | 1709 | |
| 1711 | for (i = 0; i < size / X_LONG_SIZE; i++) | 1710 | for (i = 0; i < size / X_LONG_SIZE; i++) |
| 1712 | { | 1711 | { |
| 1713 | int j = ((int *) data) [i]; | 1712 | int j = ((int *) data) [i]; |
| 1714 | Faset (v, make_number (i), INTEGER_TO_CONS (j)); | 1713 | ASET (v, i, INTEGER_TO_CONS (j)); |
| 1715 | } | 1714 | } |
| 1716 | return v; | 1715 | return v; |
| 1717 | } | 1716 | } |
| @@ -1904,7 +1903,7 @@ clean_local_selection_data (Lisp_Object obj) | |||
| 1904 | Lisp_Object copy; | 1903 | Lisp_Object copy; |
| 1905 | if (size == 1) | 1904 | if (size == 1) |
| 1906 | return clean_local_selection_data (AREF (obj, 0)); | 1905 | return clean_local_selection_data (AREF (obj, 0)); |
| 1907 | copy = Fmake_vector (make_number (size), Qnil); | 1906 | copy = make_uninit_vector (size); |
| 1908 | for (i = 0; i < size; i++) | 1907 | for (i = 0; i < size; i++) |
| 1909 | ASET (copy, i, clean_local_selection_data (AREF (obj, i))); | 1908 | ASET (copy, i, clean_local_selection_data (AREF (obj, i))); |
| 1910 | return copy; | 1909 | return copy; |
| @@ -2542,7 +2541,7 @@ x_handle_dnd_message (struct frame *f, XClientMessageEvent *event, | |||
| 2542 | function expects them to be of size int (i.e. 32). So to be able to | 2541 | function expects them to be of size int (i.e. 32). So to be able to |
| 2543 | use that function, put the data in the form it expects if format is 32. */ | 2542 | use that function, put the data in the form it expects if format is 32. */ |
| 2544 | 2543 | ||
| 2545 | if (32 < BITS_PER_LONG && event->format == 32) | 2544 | if (BITS_PER_LONG > 32 && event->format == 32) |
| 2546 | { | 2545 | { |
| 2547 | for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */ | 2546 | for (i = 0; i < 5; ++i) /* There are only 5 longs in a ClientMessage. */ |
| 2548 | idata[i] = event->data.l[i]; | 2547 | idata[i] = event->data.l[i]; |
| @@ -2572,7 +2571,7 @@ x_handle_dnd_message (struct frame *f, XClientMessageEvent *event, | |||
| 2572 | return 1; | 2571 | return 1; |
| 2573 | } | 2572 | } |
| 2574 | 2573 | ||
| 2575 | DEFUN ("x-send-client-message", Fx_send_client_event, | 2574 | DEFUN ("x-send-client-message", Fx_send_client_message, |
| 2576 | Sx_send_client_message, 6, 6, 0, | 2575 | Sx_send_client_message, 6, 6, 0, |
| 2577 | doc: /* Send a client message of MESSAGE-TYPE to window DEST on DISPLAY. | 2576 | doc: /* Send a client message of MESSAGE-TYPE to window DEST on DISPLAY. |
| 2578 | 2577 | ||