changeset 2964:a0ff2bc5dd05

(x_window_to_frame): Use XGCTYPE.
author Richard M. Stallman <rms@gnu.org>
date Sat, 22 May 1993 22:04:07 +0000
parents 3bba63e62e58
children 5314fdcd87bc
files src/xfns.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Sat May 22 22:02:35 1993 +0000
+++ b/src/xfns.c	Sat May 22 22:04:07 1993 +0000
@@ -198,6 +198,8 @@
 /* Return the Emacs frame-object corresponding to an X window.
    It could be the frame's main window or an icon window.  */
 
+/* This function can be called during GC, so use XGCTYPE.  */
+
 struct frame *
 x_window_to_frame (wdesc)
      int wdesc;
@@ -205,10 +207,11 @@
   Lisp_Object tail, frame;
   struct frame *f;
 
-  for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
+  for (tail = Vframe_list; XGCTYPE (tail) == Lisp_Cons;
+       tail = XCONS (tail)->cdr)
     {
       frame = XCONS (tail)->car;
-      if (XTYPE (frame) != Lisp_Frame)
+      if (XGCTYPE (frame) != Lisp_Frame)
         continue;
       f = XFRAME (frame);
       if (FRAME_X_WINDOW (f) == wdesc