]> code.delx.au - gnu-emacs/blobdiff - src/xselect.c
Declare calloc like malloc.
[gnu-emacs] / src / xselect.c
index 50c752bae0b08454ddc13bad0efbed66d5282726..ad0cc265861a49c69251f4f1b8c43cfd14ce086e 100644 (file)
@@ -1,5 +1,5 @@
 /* X Selection processing for Emacs.
-   Copyright (C) 1993, 1994 Free Software Foundation.
+   Copyright (C) 1993, 1994, 1995 Free Software Foundation.
 
 This file is part of GNU Emacs.
 
@@ -40,16 +40,15 @@ Lisp_Object QCUT_BUFFER0, QCUT_BUFFER1, QCUT_BUFFER2, QCUT_BUFFER3,
   QCUT_BUFFER4, QCUT_BUFFER5, QCUT_BUFFER6, QCUT_BUFFER7;
 #endif
 
-Lisp_Object Vx_lost_selection_hooks;
-Lisp_Object Vx_sent_selection_hooks;
+static Lisp_Object Vx_lost_selection_hooks;
+static Lisp_Object Vx_sent_selection_hooks;
 
 /* If this is a smaller number than the max-request-size of the display,
    emacs will use INCR selection transfer when the selection is larger
    than this.  The max-request-size is usually around 64k, so if you want
    emacs to use incremental selection transfers when the selection is 
    smaller than that, set this.  I added this mostly for debugging the
-   incremental transfer stuff, but it might improve server performance.
- */
+   incremental transfer stuff, but it might improve server performance.  */
 #define MAX_SELECTION_QUANTUM 0xFFFFFF
 
 #ifdef HAVE_X11R4
@@ -72,22 +71,19 @@ unsigned long last_event_timestamp;
    If there is an entry in this alist, then it can be assumed that Emacs owns
     that selection.
    The only (eq) parts of this list that are visible from Lisp are the
-    selection-values.
- */
-Lisp_Object Vselection_alist;
+    selection-values.  */
+static Lisp_Object Vselection_alist;
 
 /* This is an alist whose CARs are selection-types (whose names are the same
    as the names of X Atoms) and whose CDRs are the names of Lisp functions to
    call to convert the given Emacs selection value to a string representing 
    the given selection type.  This is for Lisp-level extension of the emacs
-   selection handling.
- */
-Lisp_Object Vselection_converter_alist;
+   selection handling.  */
+static Lisp_Object Vselection_converter_alist;
 
 /* If the selection owner takes too long to reply to a selection request,
-   we give up on it.  This is in milliseconds (0 = no timeout.)
- */
-int x_selection_timeout;
+   we give up on it.  This is in milliseconds (0 = no timeout.)  */
+static int x_selection_timeout;
 \f
 /* Utility functions */
 
@@ -467,6 +463,7 @@ queue_selection_requests_unwind (frame)
 
   if (! NILP (frame))
     x_stop_queuing_selection_requests (FRAME_X_DISPLAY (f));
+  return Qnil;
 }
 
 /* Return some frame whose display info is DPYINFO.
@@ -560,7 +557,7 @@ x_reply_selection_request (event, format, data, size, type)
                                 frame);
        }
 
-      if (x_window_to_frame (window)) /* #### debug */
+      if (x_window_to_frame (dpyinfo, window)) /* #### debug */
        error ("attempt to transfer an INCR to ourself!");
 #if 0
       fprintf (stderr, "\nINCR %d\n", bytes_remaining);
@@ -821,25 +818,6 @@ x_clear_frame_selections (f)
   /* Otherwise, we're really honest and truly being told to drop it.
      Don't use Fdelq as that may QUIT;.  */
 
-  while (!NILP (Vselection_alist)
-        && EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (Vselection_alist)))))))
-    {
-      /* Let random Lisp code notice that the selection has been stolen.  */
-      Lisp_Object hooks, selection_symbol;
-
-      hooks = Vx_lost_selection_hooks;
-      selection_symbol = Fcar (Vselection_alist);
-
-      if (!EQ (hooks, Qunbound))
-       {
-         for (; CONSP (hooks); hooks = Fcdr (hooks))
-           call1 (Fcar (hooks), selection_symbol);
-         redisplay_preserve_echo_area ();
-       }
-
-      Vselection_alist = Fcdr (Vselection_alist);
-    }
-
   for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest))
     if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCONS (rest)->cdr)))))))
       {
@@ -935,6 +913,7 @@ wait_for_property_change_unwind (identifierval)
   unexpect_property_change ((struct prop_location *)
                            (XFASTINT (XCONS (identifierval)->car) << 16
                             | XFASTINT (XCONS (identifierval)->cdr)));
+  return Qnil;
 }
 
 /* Actually wait for a property change.
@@ -1174,7 +1153,7 @@ x_get_window_property (display, window, property, data_ret, bytes_ret,
   BLOCK_INPUT;
   /* First probe the thing to find out how big it is.  */
   result = XGetWindowProperty (display, window, property,
-                              0, 0, False, AnyPropertyType,
+                              0L, 0L, False, AnyPropertyType,
                               actual_type_ret, actual_format_ret,
                               actual_size_ret,
                               &bytes_remaining, &tmp_data);
@@ -1204,7 +1183,7 @@ x_get_window_property (display, window, property, data_ret, bytes_ret,
 #endif
       result
        = XGetWindowProperty (display, window, property,
-                             offset/4, buffer_size/4,
+                             (long)offset/4, (long)buffer_size/4,
                              False,
                              AnyPropertyType,
                              actual_type_ret, actual_format_ret,