aboutsummaryrefslogtreecommitdiffstats
path: root/src/xselect.c
diff options
context:
space:
mode:
authorKarl Heuer1994-03-25 00:42:33 +0000
committerKarl Heuer1994-03-25 00:42:33 +0000
commit9d2d1dd88ccc5efb63754d47bee26df61067bab5 (patch)
tree0b8525ff73303b8ef12dd65e4e658e97fbd3b555 /src/xselect.c
parent9838119052cfea1f831bb700c2f7ca90ce7f9817 (diff)
downloademacs-9d2d1dd88ccc5efb63754d47bee26df61067bab5.tar.gz
emacs-9d2d1dd88ccc5efb63754d47bee26df61067bab5.zip
(x_get_local_selection, x_handle_selection_request): Use assignment, not
initialization.
Diffstat (limited to 'src/xselect.c')
-rw-r--r--src/xselect.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/xselect.c b/src/xselect.c
index c2da7b0655b..c56402e182f 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -323,9 +323,11 @@ x_get_local_selection (selection_symbol, target_type)
323 else if (CONSP (target_type) 323 else if (CONSP (target_type)
324 && XCONS (target_type)->car == QMULTIPLE) 324 && XCONS (target_type)->car == QMULTIPLE)
325 { 325 {
326 Lisp_Object pairs = XCONS (target_type)->cdr; 326 Lisp_Object pairs;
327 int size = XVECTOR (pairs)->size; 327 int size;
328 int i; 328 int i;
329 pairs = XCONS (target_type)->cdr;
330 size = XVECTOR (pairs)->size;
329 /* If the target is MULTIPLE, then target_type looks like 331 /* If the target is MULTIPLE, then target_type looks like
330 (MULTIPLE . [[SELECTION1 TARGET1] [SELECTION2 TARGET2] ... ]) 332 (MULTIPLE . [[SELECTION1 TARGET1] [SELECTION2 TARGET2] ... ])
331 We modify the second element of each pair in the vector and 333 We modify the second element of each pair in the vector and
@@ -333,7 +335,8 @@ x_get_local_selection (selection_symbol, target_type)
333 */ 335 */
334 for (i = 0; i < size; i++) 336 for (i = 0; i < size; i++)
335 { 337 {
336 Lisp_Object pair = XVECTOR (pairs)->contents [i]; 338 Lisp_Object pair;
339 pair = XVECTOR (pairs)->contents [i];
337 XVECTOR (pair)->contents [1] 340 XVECTOR (pair)->contents [1]
338 = x_get_local_selection (XVECTOR (pair)->contents [0], 341 = x_get_local_selection (XVECTOR (pair)->contents [0],
339 XVECTOR (pair)->contents [1]); 342 XVECTOR (pair)->contents [1]);
@@ -594,14 +597,19 @@ x_handle_selection_request (event)
594 struct input_event *event; 597 struct input_event *event;
595{ 598{
596 struct gcpro gcpro1, gcpro2, gcpro3; 599 struct gcpro gcpro1, gcpro2, gcpro3;
597 Lisp_Object local_selection_data = Qnil; 600 Lisp_Object local_selection_data;
598 Lisp_Object selection_symbol; 601 Lisp_Object selection_symbol;
599 Lisp_Object target_symbol = Qnil; 602 Lisp_Object target_symbol;
600 Lisp_Object converted_selection = Qnil; 603 Lisp_Object converted_selection;
601 Time local_selection_time; 604 Time local_selection_time;
602 Lisp_Object successful_p = Qnil; 605 Lisp_Object successful_p;
603 int count; 606 int count;
604 607
608 local_selection_data = Qnil;
609 target_symbol = Qnil;
610 converted_selection = Qnil;
611 successful_p = Qnil;
612
605 GCPRO3 (local_selection_data, converted_selection, target_symbol); 613 GCPRO3 (local_selection_data, converted_selection, target_symbol);
606 614
607 selection_symbol = x_atom_to_symbol (SELECTION_EVENT_DISPLAY (event), 615 selection_symbol = x_atom_to_symbol (SELECTION_EVENT_DISPLAY (event),
@@ -676,7 +684,8 @@ x_handle_selection_request (event)
676 684
677 /* Let random lisp code notice that the selection has been asked for. */ 685 /* Let random lisp code notice that the selection has been asked for. */
678 { 686 {
679 Lisp_Object rest = Vx_sent_selection_hooks; 687 Lisp_Object rest;
688 rest = Vx_sent_selection_hooks;
680 if (!EQ (rest, Qunbound)) 689 if (!EQ (rest, Qunbound))
681 for (; CONSP (rest); rest = Fcdr (rest)) 690 for (; CONSP (rest); rest = Fcdr (rest))
682 call3 (Fcar (rest), selection_symbol, target_symbol, successful_p); 691 call3 (Fcar (rest), selection_symbol, target_symbol, successful_p);