]> code.delx.au - gnu-emacs/blobdiff - src/xselect.c
Remove redundant include of unistd.h, stdlib.h. Use
[gnu-emacs] / src / xselect.c
index cbef1ad3aa0df8a6921e8b8370035f8962b0601f..5fd2c862cb72c887691f8d5ba944291549412322 100644 (file)
@@ -1,5 +1,5 @@
 /* X Selection processing for Emacs.
-   Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001
+   Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003
    Free Software Foundation.
 
 This file is part of GNU Emacs.
@@ -425,6 +425,9 @@ x_get_local_selection (selection_symbol, target_type, local_request)
 
       CHECK_SYMBOL (target_type);
       handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist));
+      /* gcpro is not needed here since nothing but HANDLER_FN
+        is live, and that ought to be a symbol.  */
+
       if (!NILP (handler_fn))
        value = call3 (handler_fn,
                       selection_symbol, (local_request ? Qnil : target_type),
@@ -729,6 +732,7 @@ x_reply_selection_request (event, format, data, size, type)
       TRACE0 ("Done sending incrementally");
     }
 
+  /* rms, 2003-01-03: I think I have fixed this bug.  */
   /* The window we're communicating with may have been deleted
      in the meantime (that's a real situation from a bug report).
      In this case, there may be events in the event queue still
@@ -836,8 +840,6 @@ x_handle_selection_request (event)
 
  DONE:
 
-  UNGCPRO;
-
   /* Let random lisp code notice that the selection has been asked for.  */
   {
     Lisp_Object rest;
@@ -846,6 +848,8 @@ x_handle_selection_request (event)
       for (; CONSP (rest); rest = Fcdr (rest))
        call3 (Fcar (rest), selection_symbol, target_symbol, successful_p);
   }
+
+  UNGCPRO;
 }
 \f
 /* Handle a SelectionClear event EVENT, which indicates that some
@@ -1694,8 +1698,8 @@ selection_data_to_lisp_data (display, data, size, type, format)
      If the number is > 16 bits, convert it to a cons of integers,
      16 bits in each half.
    */
-  else if (format == 32 && size == sizeof (long))
-    return long_to_cons (((unsigned long *) data) [0]);
+  else if (format == 32 && size == sizeof (int))
+    return long_to_cons (((unsigned int *) data) [0]);
   else if (format == 16 && size == sizeof (short))
     return make_number ((int) (((unsigned short *) data) [0]));
 
@@ -1720,7 +1724,7 @@ selection_data_to_lisp_data (display, data, size, type, format)
       Lisp_Object v = Fmake_vector (make_number (size / 4), make_number (0));
       for (i = 0; i < size / 4; i++)
        {
-         unsigned long j = ((unsigned long *) data) [i];
+         unsigned int j = ((unsigned int *) data) [i];
          Faset (v, make_number (i), long_to_cons (j));
        }
       return v;
@@ -2403,8 +2407,8 @@ The default value is `compound-text-with-extensions'.  */);
   DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system,
               doc: /* Coding system for the next communication with other X clients.
 Usually, `selection-coding-system' is used for communicating with
-other X clients.   But, if this variable is set, it is used for the
-next communication only.   After the communication, this variable is
+other X clients.  But, if this variable is set, it is used for the
+next communication only.  After the communication, this variable is
 set to nil.  */);
   Vnext_selection_coding_system = Qnil;