aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2007-06-29 03:37:33 +0000
committerStefan Monnier2007-06-29 03:37:33 +0000
commit8e50cc2df8df6f773422ab11805704eaa4bba016 (patch)
tree5041fa64f3f1bc6d4ffd1465a88a40055b7b39ab /src
parentdf2d551eba1af9966308bb70da6dd5f4e03b650e (diff)
downloademacs-8e50cc2df8df6f773422ab11805704eaa4bba016.tar.gz
emacs-8e50cc2df8df6f773422ab11805704eaa4bba016.zip
Replace uses of GC_* macros with the non-GC_ versions.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog32
-rw-r--r--src/alloc.c42
-rw-r--r--src/buffer.c4
-rw-r--r--src/buffer.h2
-rw-r--r--src/data.c24
-rw-r--r--src/fileio.c2
-rw-r--r--src/filelock.c2
-rw-r--r--src/fns.c12
-rw-r--r--src/frame.h2
-rw-r--r--src/macterm.c16
-rw-r--r--src/print.c4
-rw-r--r--src/process.c20
-rw-r--r--src/w32fns.c11
-rw-r--r--src/w32menu.c4
-rw-r--r--src/w32term.c20
-rw-r--r--src/xfns.c20
-rw-r--r--src/xmenu.c8
-rw-r--r--src/xterm.c30
18 files changed, 140 insertions, 115 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 51975848e71..bfc4c3ac5f0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,35 @@
12007-06-29 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * lisp.h (XGCTYPE, GC_HASH_TABLE_P, GC_NILP, GC_NUMBERP, GC_NATNUMP)
4 (GC_INTEGERP, GC_SYMBOLP, GC_MISCP, GC_VECTORLIKEP, GC_STRINGP)
5 (GC_CONSP, GC_FLOATP, GC_VECTORP, GC_OVERLAYP, GC_MARKERP)
6 (GC_INTFWDP, GC_BOOLFWDP, GC_OBJFWDP, GC_BUFFER_OBJFWDP)
7 (GC_BUFFER_LOCAL_VALUEP, GC_SOME_BUFFER_LOCAL_VALUEP)
8 (GC_KBOARD_OBJFWDP, GC_PSEUDOVECTORP, GC_WINDOW_CONFIGURATIONP)
9 (GC_PROCESSP, GC_WINDOWP, GC_SUBRP, GC_COMPILEDP, GC_BUFFERP)
10 (GC_SUB_CHAR_TABLE_P, GC_CHAR_TABLE_P, GC_BOOL_VECTOR_P, GC_FRAMEP)
11 (GC_EQ): Remove since they've been identical to their non-GC_
12 alter-egos ever since the markbit was eradicated.
13
14 * src/alloc.c:
15 * src/buffer.c:
16 * src/buffer.h:
17 * src/data.c:
18 * src/fileio.c:
19 * src/filelock.c:
20 * src/fns.c:
21 * src/frame.h:
22 * src/lisp.h:
23 * src/macterm.c:
24 * src/print.c:
25 * src/process.c:
26 * src/w32fns.c:
27 * src/w32menu.c:
28 * src/w32term.c:
29 * src/xfns.c:
30 * src/xmenu.c:
31 * src/xterm.c: Replace uses of GC_* macros with the non-GC_ versions.
32
12007-06-16 Eli Zaretskii <eliz@gnu.org> 332007-06-16 Eli Zaretskii <eliz@gnu.org>
2 34
3 * w32menu.c (add_menu_item): Escape `&' characters in menu items 35 * w32menu.c (add_menu_item): Escape `&' characters in menu items
diff --git a/src/alloc.c b/src/alloc.c
index 5e9979d1f6e..d5de5f7296b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4160,7 +4160,7 @@ mark_maybe_object (obj)
4160 { 4160 {
4161 int mark_p = 0; 4161 int mark_p = 0;
4162 4162
4163 switch (XGCTYPE (obj)) 4163 switch (XTYPE (obj))
4164 { 4164 {
4165 case Lisp_String: 4165 case Lisp_String:
4166 mark_p = (live_string_p (m, po) 4166 mark_p = (live_string_p (m, po)
@@ -4180,13 +4180,13 @@ mark_maybe_object (obj)
4180 break; 4180 break;
4181 4181
4182 case Lisp_Vectorlike: 4182 case Lisp_Vectorlike:
4183 /* Note: can't check GC_BUFFERP before we know it's a 4183 /* Note: can't check BUFFERP before we know it's a
4184 buffer because checking that dereferences the pointer 4184 buffer because checking that dereferences the pointer
4185 PO which might point anywhere. */ 4185 PO which might point anywhere. */
4186 if (live_vector_p (m, po)) 4186 if (live_vector_p (m, po))
4187 mark_p = !GC_SUBRP (obj) && !VECTOR_MARKED_P (XVECTOR (obj)); 4187 mark_p = !SUBRP (obj) && !VECTOR_MARKED_P (XVECTOR (obj));
4188 else if (live_buffer_p (m, po)) 4188 else if (live_buffer_p (m, po))
4189 mark_p = GC_BUFFERP (obj) && !VECTOR_MARKED_P (XBUFFER (obj)); 4189 mark_p = BUFFERP (obj) && !VECTOR_MARKED_P (XBUFFER (obj));
4190 break; 4190 break;
4191 4191
4192 case Lisp_Misc: 4192 case Lisp_Misc:
@@ -4276,7 +4276,7 @@ mark_maybe_pointer (p)
4276 { 4276 {
4277 Lisp_Object tem; 4277 Lisp_Object tem;
4278 XSETVECTOR (tem, p); 4278 XSETVECTOR (tem, p);
4279 if (!GC_SUBRP (tem) && !VECTOR_MARKED_P (XVECTOR (tem))) 4279 if (!SUBRP (tem) && !VECTOR_MARKED_P (XVECTOR (tem)))
4280 obj = tem; 4280 obj = tem;
4281 } 4281 }
4282 break; 4282 break;
@@ -4285,7 +4285,7 @@ mark_maybe_pointer (p)
4285 abort (); 4285 abort ();
4286 } 4286 }
4287 4287
4288 if (!GC_NILP (obj)) 4288 if (!NILP (obj))
4289 mark_object (obj); 4289 mark_object (obj);
4290 } 4290 }
4291} 4291}
@@ -5188,8 +5188,8 @@ returns nil, because real GC can't be done. */)
5188 prev = Qnil; 5188 prev = Qnil;
5189 while (CONSP (tail)) 5189 while (CONSP (tail))
5190 { 5190 {
5191 if (GC_CONSP (XCAR (tail)) 5191 if (CONSP (XCAR (tail))
5192 && GC_MARKERP (XCAR (XCAR (tail))) 5192 && MARKERP (XCAR (XCAR (tail)))
5193 && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit) 5193 && !XMARKER (XCAR (XCAR (tail)))->gcmarkbit)
5194 { 5194 {
5195 if (NILP (prev)) 5195 if (NILP (prev))
@@ -5338,7 +5338,7 @@ mark_glyph_matrix (matrix)
5338 struct glyph *end_glyph = glyph + row->used[area]; 5338 struct glyph *end_glyph = glyph + row->used[area];
5339 5339
5340 for (; glyph < end_glyph; ++glyph) 5340 for (; glyph < end_glyph; ++glyph)
5341 if (GC_STRINGP (glyph->object) 5341 if (STRINGP (glyph->object)
5342 && !STRING_MARKED_P (XSTRING (glyph->object))) 5342 && !STRING_MARKED_P (XSTRING (glyph->object)))
5343 mark_object (glyph->object); 5343 mark_object (glyph->object);
5344 } 5344 }
@@ -5471,7 +5471,7 @@ mark_object (arg)
5471 5471
5472#endif /* not GC_CHECK_MARKED_OBJECTS */ 5472#endif /* not GC_CHECK_MARKED_OBJECTS */
5473 5473
5474 switch (SWITCH_ENUM_CAST (XGCTYPE (obj))) 5474 switch (SWITCH_ENUM_CAST (XTYPE (obj)))
5475 { 5475 {
5476 case Lisp_String: 5476 case Lisp_String:
5477 { 5477 {
@@ -5490,13 +5490,13 @@ mark_object (arg)
5490 case Lisp_Vectorlike: 5490 case Lisp_Vectorlike:
5491#ifdef GC_CHECK_MARKED_OBJECTS 5491#ifdef GC_CHECK_MARKED_OBJECTS
5492 m = mem_find (po); 5492 m = mem_find (po);
5493 if (m == MEM_NIL && !GC_SUBRP (obj) 5493 if (m == MEM_NIL && !SUBRP (obj)
5494 && po != &buffer_defaults 5494 && po != &buffer_defaults
5495 && po != &buffer_local_symbols) 5495 && po != &buffer_local_symbols)
5496 abort (); 5496 abort ();
5497#endif /* GC_CHECK_MARKED_OBJECTS */ 5497#endif /* GC_CHECK_MARKED_OBJECTS */
5498 5498
5499 if (GC_BUFFERP (obj)) 5499 if (BUFFERP (obj))
5500 { 5500 {
5501 if (!VECTOR_MARKED_P (XBUFFER (obj))) 5501 if (!VECTOR_MARKED_P (XBUFFER (obj)))
5502 { 5502 {
@@ -5513,9 +5513,9 @@ mark_object (arg)
5513 mark_buffer (obj); 5513 mark_buffer (obj);
5514 } 5514 }
5515 } 5515 }
5516 else if (GC_SUBRP (obj)) 5516 else if (SUBRP (obj))
5517 break; 5517 break;
5518 else if (GC_COMPILEDP (obj)) 5518 else if (COMPILEDP (obj))
5519 /* We could treat this just like a vector, but it is better to 5519 /* We could treat this just like a vector, but it is better to
5520 save the COMPILED_CONSTANTS element for last and avoid 5520 save the COMPILED_CONSTANTS element for last and avoid
5521 recursion there. */ 5521 recursion there. */
@@ -5538,7 +5538,7 @@ mark_object (arg)
5538 obj = ptr->contents[COMPILED_CONSTANTS]; 5538 obj = ptr->contents[COMPILED_CONSTANTS];
5539 goto loop; 5539 goto loop;
5540 } 5540 }
5541 else if (GC_FRAMEP (obj)) 5541 else if (FRAMEP (obj))
5542 { 5542 {
5543 register struct frame *ptr = XFRAME (obj); 5543 register struct frame *ptr = XFRAME (obj);
5544 5544
@@ -5570,7 +5570,7 @@ mark_object (arg)
5570 mark_object (ptr->current_tool_bar_string); 5570 mark_object (ptr->current_tool_bar_string);
5571#endif /* HAVE_WINDOW_SYSTEM */ 5571#endif /* HAVE_WINDOW_SYSTEM */
5572 } 5572 }
5573 else if (GC_BOOL_VECTOR_P (obj)) 5573 else if (BOOL_VECTOR_P (obj))
5574 { 5574 {
5575 register struct Lisp_Vector *ptr = XVECTOR (obj); 5575 register struct Lisp_Vector *ptr = XVECTOR (obj);
5576 5576
@@ -5579,7 +5579,7 @@ mark_object (arg)
5579 CHECK_LIVE (live_vector_p); 5579 CHECK_LIVE (live_vector_p);
5580 VECTOR_MARK (ptr); /* Else mark it */ 5580 VECTOR_MARK (ptr); /* Else mark it */
5581 } 5581 }
5582 else if (GC_WINDOWP (obj)) 5582 else if (WINDOWP (obj))
5583 { 5583 {
5584 register struct Lisp_Vector *ptr = XVECTOR (obj); 5584 register struct Lisp_Vector *ptr = XVECTOR (obj);
5585 struct window *w = XWINDOW (obj); 5585 struct window *w = XWINDOW (obj);
@@ -5611,7 +5611,7 @@ mark_object (arg)
5611 mark_glyph_matrix (w->desired_matrix); 5611 mark_glyph_matrix (w->desired_matrix);
5612 } 5612 }
5613 } 5613 }
5614 else if (GC_HASH_TABLE_P (obj)) 5614 else if (HASH_TABLE_P (obj))
5615 { 5615 {
5616 struct Lisp_Hash_Table *h = XHASH_TABLE (obj); 5616 struct Lisp_Hash_Table *h = XHASH_TABLE (obj);
5617 5617
@@ -5640,7 +5640,7 @@ mark_object (arg)
5640 5640
5641 /* If hash table is not weak, mark all keys and values. 5641 /* If hash table is not weak, mark all keys and values.
5642 For weak tables, mark only the vector. */ 5642 For weak tables, mark only the vector. */
5643 if (GC_NILP (h->weak)) 5643 if (NILP (h->weak))
5644 mark_object (h->key_and_value); 5644 mark_object (h->key_and_value);
5645 else 5645 else
5646 VECTOR_MARK (XVECTOR (h->key_and_value)); 5646 VECTOR_MARK (XVECTOR (h->key_and_value));
@@ -5864,7 +5864,7 @@ survives_gc_p (obj)
5864{ 5864{
5865 int survives_p; 5865 int survives_p;
5866 5866
5867 switch (XGCTYPE (obj)) 5867 switch (XTYPE (obj))
5868 { 5868 {
5869 case Lisp_Int: 5869 case Lisp_Int:
5870 survives_p = 1; 5870 survives_p = 1;
@@ -5883,7 +5883,7 @@ survives_gc_p (obj)
5883 break; 5883 break;
5884 5884
5885 case Lisp_Vectorlike: 5885 case Lisp_Vectorlike:
5886 survives_p = GC_SUBRP (obj) || VECTOR_MARKED_P (XVECTOR (obj)); 5886 survives_p = SUBRP (obj) || VECTOR_MARKED_P (XVECTOR (obj));
5887 break; 5887 break;
5888 5888
5889 case Lisp_Cons: 5889 case Lisp_Cons:
diff --git a/src/buffer.c b/src/buffer.c
index 331df150f62..5e4b091dfa2 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2867,7 +2867,7 @@ overlay_touches_p (pos)
2867 int endpos; 2867 int endpos;
2868 2868
2869 XSETMISC (overlay ,tail); 2869 XSETMISC (overlay ,tail);
2870 if (!GC_OVERLAYP (overlay)) 2870 if (!OVERLAYP (overlay))
2871 abort (); 2871 abort ();
2872 2872
2873 endpos = OVERLAY_POSITION (OVERLAY_END (overlay)); 2873 endpos = OVERLAY_POSITION (OVERLAY_END (overlay));
@@ -2882,7 +2882,7 @@ overlay_touches_p (pos)
2882 int startpos; 2882 int startpos;
2883 2883
2884 XSETMISC (overlay, tail); 2884 XSETMISC (overlay, tail);
2885 if (!GC_OVERLAYP (overlay)) 2885 if (!OVERLAYP (overlay))
2886 abort (); 2886 abort ();
2887 2887
2888 startpos = OVERLAY_POSITION (OVERLAY_START (overlay)); 2888 startpos = OVERLAY_POSITION (OVERLAY_START (overlay));
diff --git a/src/buffer.h b/src/buffer.h
index 06532ce2f5c..5db11854946 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -919,7 +919,7 @@ extern Lisp_Object Vtransient_mark_mode;
919 We assume you know which buffer it's pointing into. */ 919 We assume you know which buffer it's pointing into. */
920 920
921#define OVERLAY_POSITION(P) \ 921#define OVERLAY_POSITION(P) \
922 (GC_MARKERP (P) ? marker_position (P) : (abort (), 0)) 922 (MARKERP (P) ? marker_position (P) : (abort (), 0))
923 923
924 924
925/*********************************************************************** 925/***********************************************************************
diff --git a/src/data.c b/src/data.c
index 32e5a6892aa..dd5bc0bcb21 100644
--- a/src/data.c
+++ b/src/data.c
@@ -115,7 +115,7 @@ wrong_type_argument (predicate, value)
115{ 115{
116 /* If VALUE is not even a valid Lisp object, abort here 116 /* If VALUE is not even a valid Lisp object, abort here
117 where we can get a backtrace showing where it came from. */ 117 where we can get a backtrace showing where it came from. */
118 if ((unsigned int) XGCTYPE (value) >= Lisp_Type_Limit) 118 if ((unsigned int) XTYPE (value) >= Lisp_Type_Limit)
119 abort (); 119 abort ();
120 120
121 xsignal2 (Qwrong_type_argument, predicate, value); 121 xsignal2 (Qwrong_type_argument, predicate, value);
@@ -187,7 +187,7 @@ for example, (type-of 1) returns `integer'. */)
187 (object) 187 (object)
188 Lisp_Object object; 188 Lisp_Object object;
189{ 189{
190 switch (XGCTYPE (object)) 190 switch (XTYPE (object))
191 { 191 {
192 case Lisp_Int: 192 case Lisp_Int:
193 return Qinteger; 193 return Qinteger;
@@ -214,25 +214,25 @@ for example, (type-of 1) returns `integer'. */)
214 abort (); 214 abort ();
215 215
216 case Lisp_Vectorlike: 216 case Lisp_Vectorlike:
217 if (GC_WINDOW_CONFIGURATIONP (object)) 217 if (WINDOW_CONFIGURATIONP (object))
218 return Qwindow_configuration; 218 return Qwindow_configuration;
219 if (GC_PROCESSP (object)) 219 if (PROCESSP (object))
220 return Qprocess; 220 return Qprocess;
221 if (GC_WINDOWP (object)) 221 if (WINDOWP (object))
222 return Qwindow; 222 return Qwindow;
223 if (GC_SUBRP (object)) 223 if (SUBRP (object))
224 return Qsubr; 224 return Qsubr;
225 if (GC_COMPILEDP (object)) 225 if (COMPILEDP (object))
226 return Qcompiled_function; 226 return Qcompiled_function;
227 if (GC_BUFFERP (object)) 227 if (BUFFERP (object))
228 return Qbuffer; 228 return Qbuffer;
229 if (GC_CHAR_TABLE_P (object)) 229 if (CHAR_TABLE_P (object))
230 return Qchar_table; 230 return Qchar_table;
231 if (GC_BOOL_VECTOR_P (object)) 231 if (BOOL_VECTOR_P (object))
232 return Qbool_vector; 232 return Qbool_vector;
233 if (GC_FRAMEP (object)) 233 if (FRAMEP (object))
234 return Qframe; 234 return Qframe;
235 if (GC_HASH_TABLE_P (object)) 235 if (HASH_TABLE_P (object))
236 return Qhash_table; 236 return Qhash_table;
237 return Qvector; 237 return Qvector;
238 238
diff --git a/src/fileio.c b/src/fileio.c
index 90ee5064c07..55aaeaa6897 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5843,7 +5843,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
5843 couldn't handle some ange-ftp'd file. */ 5843 couldn't handle some ange-ftp'd file. */
5844 5844
5845 for (do_handled_files = 0; do_handled_files < 2; do_handled_files++) 5845 for (do_handled_files = 0; do_handled_files < 2; do_handled_files++)
5846 for (tail = Vbuffer_alist; GC_CONSP (tail); tail = XCDR (tail)) 5846 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
5847 { 5847 {
5848 buf = XCDR (XCAR (tail)); 5848 buf = XCDR (XCAR (tail));
5849 b = XBUFFER (buf); 5849 b = XBUFFER (buf);
diff --git a/src/filelock.c b/src/filelock.c
index 261a644ccde..de6de7bb8eb 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -666,7 +666,7 @@ unlock_all_files ()
666 register Lisp_Object tail; 666 register Lisp_Object tail;
667 register struct buffer *b; 667 register struct buffer *b;
668 668
669 for (tail = Vbuffer_alist; GC_CONSP (tail); tail = XCDR (tail)) 669 for (tail = Vbuffer_alist; CONSP (tail); tail = XCDR (tail))
670 { 670 {
671 b = XBUFFER (XCDR (XCAR (tail))); 671 b = XBUFFER (XCDR (XCAR (tail)));
672 if (STRINGP (b->file_truename) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b)) 672 if (STRINGP (b->file_truename) && BUF_SAVE_MODIFF (b) < BUF_MODIFF (b))
diff --git a/src/fns.c b/src/fns.c
index 626aaa62821..4967569f023 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3831,7 +3831,7 @@ hashfn_eq (h, key)
3831 struct Lisp_Hash_Table *h; 3831 struct Lisp_Hash_Table *h;
3832 Lisp_Object key; 3832 Lisp_Object key;
3833{ 3833{
3834 unsigned hash = XUINT (key) ^ XGCTYPE (key); 3834 unsigned hash = XUINT (key) ^ XTYPE (key);
3835 xassert ((hash & ~INTMASK) == 0); 3835 xassert ((hash & ~INTMASK) == 0);
3836 return hash; 3836 return hash;
3837} 3837}
@@ -3850,7 +3850,7 @@ hashfn_eql (h, key)
3850 if (FLOATP (key)) 3850 if (FLOATP (key))
3851 hash = sxhash (key, 0); 3851 hash = sxhash (key, 0);
3852 else 3852 else
3853 hash = XUINT (key) ^ XGCTYPE (key); 3853 hash = XUINT (key) ^ XTYPE (key);
3854 xassert ((hash & ~INTMASK) == 0); 3854 xassert ((hash & ~INTMASK) == 0);
3855 return hash; 3855 return hash;
3856} 3856}
@@ -4271,7 +4271,7 @@ sweep_weak_table (h, remove_entries_p)
4271 /* Follow collision chain, removing entries that 4271 /* Follow collision chain, removing entries that
4272 don't survive this garbage collection. */ 4272 don't survive this garbage collection. */
4273 prev = Qnil; 4273 prev = Qnil;
4274 for (idx = HASH_INDEX (h, bucket); !GC_NILP (idx); idx = next) 4274 for (idx = HASH_INDEX (h, bucket); !NILP (idx); idx = next)
4275 { 4275 {
4276 int i = XFASTINT (idx); 4276 int i = XFASTINT (idx);
4277 int key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i)); 4277 int key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i));
@@ -4296,7 +4296,7 @@ sweep_weak_table (h, remove_entries_p)
4296 if (remove_p) 4296 if (remove_p)
4297 { 4297 {
4298 /* Take out of collision chain. */ 4298 /* Take out of collision chain. */
4299 if (GC_NILP (prev)) 4299 if (NILP (prev))
4300 HASH_INDEX (h, bucket) = next; 4300 HASH_INDEX (h, bucket) = next;
4301 else 4301 else
4302 HASH_NEXT (h, XFASTINT (prev)) = next; 4302 HASH_NEXT (h, XFASTINT (prev)) = next;
@@ -4360,7 +4360,7 @@ sweep_weak_hash_tables ()
4360 do 4360 do
4361 { 4361 {
4362 marked = 0; 4362 marked = 0;
4363 for (table = Vweak_hash_tables; !GC_NILP (table); table = h->next_weak) 4363 for (table = Vweak_hash_tables; !NILP (table); table = h->next_weak)
4364 { 4364 {
4365 h = XHASH_TABLE (table); 4365 h = XHASH_TABLE (table);
4366 if (h->size & ARRAY_MARK_FLAG) 4366 if (h->size & ARRAY_MARK_FLAG)
@@ -4370,7 +4370,7 @@ sweep_weak_hash_tables ()
4370 while (marked); 4370 while (marked);
4371 4371
4372 /* Remove tables and entries that aren't used. */ 4372 /* Remove tables and entries that aren't used. */
4373 for (table = Vweak_hash_tables, used = Qnil; !GC_NILP (table); table = next) 4373 for (table = Vweak_hash_tables, used = Qnil; !NILP (table); table = next)
4374 { 4374 {
4375 h = XHASH_TABLE (table); 4375 h = XHASH_TABLE (table);
4376 next = h->next_weak; 4376 next = h->next_weak;
diff --git a/src/frame.h b/src/frame.h
index 4a97a6095e0..c8b5438ddb5 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -498,7 +498,7 @@ struct frame
498 498
499typedef struct frame *FRAME_PTR; 499typedef struct frame *FRAME_PTR;
500 500
501#define XFRAME(p) (eassert (GC_FRAMEP(p)),(struct frame *) XPNTR (p)) 501#define XFRAME(p) (eassert (FRAMEP(p)),(struct frame *) XPNTR (p))
502#define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME)) 502#define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME))
503 503
504/* Given a window, return its frame as a Lisp_Object. */ 504/* Given a window, return its frame as a Lisp_Object. */
diff --git a/src/macterm.c b/src/macterm.c
index d770f867ff7..a5bf2365145 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -3069,8 +3069,8 @@ x_frame_of_widget (widget)
3069 3069
3070 /* Look for a frame with that top-level widget. Allocate the color 3070 /* Look for a frame with that top-level widget. Allocate the color
3071 on that frame to get the right gamma correction value. */ 3071 on that frame to get the right gamma correction value. */
3072 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) 3072 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
3073 if (GC_FRAMEP (XCAR (tail)) 3073 if (FRAMEP (XCAR (tail))
3074 && (f = XFRAME (XCAR (tail)), 3074 && (f = XFRAME (XCAR (tail)),
3075 (f->output_data.nothing != 1 3075 (f->output_data.nothing != 1
3076 && FRAME_X_DISPLAY_INFO (f) == dpyinfo)) 3076 && FRAME_X_DISPLAY_INFO (f) == dpyinfo))
@@ -4402,9 +4402,9 @@ mac_focus_changed (type, dpyinfo, frame, bufp)
4402 4402
4403 /* Don't stop displaying the initial startup message 4403 /* Don't stop displaying the initial startup message
4404 for a switch-frame event we don't need. */ 4404 for a switch-frame event we don't need. */
4405 if (GC_NILP (Vterminal_frame) 4405 if (NILP (Vterminal_frame)
4406 && GC_CONSP (Vframe_list) 4406 && CONSP (Vframe_list)
4407 && !GC_NILP (XCDR (Vframe_list))) 4407 && !NILP (XCDR (Vframe_list)))
4408 { 4408 {
4409 bufp->kind = FOCUS_IN_EVENT; 4409 bufp->kind = FOCUS_IN_EVENT;
4410 XSETFRAME (bufp->frame_or_window, frame); 4410 XSETFRAME (bufp->frame_or_window, frame);
@@ -4477,7 +4477,7 @@ x_frame_rehighlight (dpyinfo)
4477 if (dpyinfo->x_focus_frame) 4477 if (dpyinfo->x_focus_frame)
4478 { 4478 {
4479 dpyinfo->x_highlight_frame 4479 dpyinfo->x_highlight_frame
4480 = ((GC_FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame))) 4480 = ((FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame)))
4481 ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame)) 4481 ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame))
4482 : dpyinfo->x_focus_frame); 4482 : dpyinfo->x_focus_frame);
4483 if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame)) 4483 if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame))
@@ -5507,7 +5507,7 @@ x_scroll_bar_handle_click (bar, part_code, er, bufp)
5507{ 5507{
5508 int win_y, top_range; 5508 int win_y, top_range;
5509 5509
5510 if (! GC_WINDOWP (bar->window)) 5510 if (! WINDOWP (bar->window))
5511 abort (); 5511 abort ();
5512 5512
5513 bufp->kind = SCROLL_BAR_CLICK_EVENT; 5513 bufp->kind = SCROLL_BAR_CLICK_EVENT;
@@ -5582,7 +5582,7 @@ x_scroll_bar_note_movement (bar, y_pos, t)
5582 XSETVECTOR (last_mouse_scroll_bar, bar); 5582 XSETVECTOR (last_mouse_scroll_bar, bar);
5583 5583
5584 /* If we're dragging the bar, display it. */ 5584 /* If we're dragging the bar, display it. */
5585 if (! GC_NILP (bar->dragging)) 5585 if (! NILP (bar->dragging))
5586 { 5586 {
5587 /* Where should the handle be now? */ 5587 /* Where should the handle be now? */
5588 int new_start = y_pos - 24; 5588 int new_start = y_pos - 24;
diff --git a/src/print.c b/src/print.c
index 855bcce6ef6..524207ce298 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1425,7 +1425,7 @@ print_preprocess (obj)
1425 print_number_index++; 1425 print_number_index++;
1426 } 1426 }
1427 1427
1428 switch (XGCTYPE (obj)) 1428 switch (XTYPE (obj))
1429 { 1429 {
1430 case Lisp_String: 1430 case Lisp_String:
1431 /* A string may have text properties, which can be circular. */ 1431 /* A string may have text properties, which can be circular. */
@@ -1626,7 +1626,7 @@ print_object (obj, printcharfun, escapeflag)
1626 } 1626 }
1627#endif /* MAX_PRINT_CHARS */ 1627#endif /* MAX_PRINT_CHARS */
1628 1628
1629 switch (XGCTYPE (obj)) 1629 switch (XTYPE (obj))
1630 { 1630 {
1631 case Lisp_Int: 1631 case Lisp_Int:
1632 if (sizeof (int) == sizeof (EMACS_INT)) 1632 if (sizeof (int) == sizeof (EMACS_INT))
diff --git a/src/process.c b/src/process.c
index be88ba25123..067eae7f286 100644
--- a/src/process.c
+++ b/src/process.c
@@ -176,8 +176,8 @@ extern Lisp_Object QCfilter;
176 Qt nor Qnil but is instead a property list (KEY VAL ...). */ 176 Qt nor Qnil but is instead a property list (KEY VAL ...). */
177 177
178#ifdef HAVE_SOCKETS 178#ifdef HAVE_SOCKETS
179#define NETCONN_P(p) (GC_CONSP (XPROCESS (p)->childp)) 179#define NETCONN_P(p) (CONSP (XPROCESS (p)->childp))
180#define NETCONN1_P(p) (GC_CONSP ((p)->childp)) 180#define NETCONN1_P(p) (CONSP ((p)->childp))
181#else 181#else
182#define NETCONN_P(p) 0 182#define NETCONN_P(p) 0
183#define NETCONN1_P(p) 0 183#define NETCONN1_P(p) 0
@@ -6372,10 +6372,10 @@ kill_buffer_processes (buffer)
6372{ 6372{
6373 Lisp_Object tail, proc; 6373 Lisp_Object tail, proc;
6374 6374
6375 for (tail = Vprocess_alist; GC_CONSP (tail); tail = XCDR (tail)) 6375 for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
6376 { 6376 {
6377 proc = XCDR (XCAR (tail)); 6377 proc = XCDR (XCAR (tail));
6378 if (GC_PROCESSP (proc) 6378 if (PROCESSP (proc)
6379 && (NILP (buffer) || EQ (XPROCESS (proc)->buffer, buffer))) 6379 && (NILP (buffer) || EQ (XPROCESS (proc)->buffer, buffer)))
6380 { 6380 {
6381 if (NETCONN_P (proc)) 6381 if (NETCONN_P (proc))
@@ -6470,11 +6470,11 @@ sigchld_handler (signo)
6470 /* Find the process that signaled us, and record its status. */ 6470 /* Find the process that signaled us, and record its status. */
6471 6471
6472 /* The process can have been deleted by Fdelete_process. */ 6472 /* The process can have been deleted by Fdelete_process. */
6473 for (tail = deleted_pid_list; GC_CONSP (tail); tail = XCDR (tail)) 6473 for (tail = deleted_pid_list; CONSP (tail); tail = XCDR (tail))
6474 { 6474 {
6475 Lisp_Object xpid = XCAR (tail); 6475 Lisp_Object xpid = XCAR (tail);
6476 if ((GC_INTEGERP (xpid) && pid == (pid_t) XINT (xpid)) 6476 if ((INTEGERP (xpid) && pid == (pid_t) XINT (xpid))
6477 || (GC_FLOATP (xpid) && pid == (pid_t) XFLOAT_DATA (xpid))) 6477 || (FLOATP (xpid) && pid == (pid_t) XFLOAT_DATA (xpid)))
6478 { 6478 {
6479 XSETCAR (tail, Qnil); 6479 XSETCAR (tail, Qnil);
6480 goto sigchld_end_of_loop; 6480 goto sigchld_end_of_loop;
@@ -6483,11 +6483,11 @@ sigchld_handler (signo)
6483 6483
6484 /* Otherwise, if it is asynchronous, it is in Vprocess_alist. */ 6484 /* Otherwise, if it is asynchronous, it is in Vprocess_alist. */
6485 p = 0; 6485 p = 0;
6486 for (tail = Vprocess_alist; GC_CONSP (tail); tail = XCDR (tail)) 6486 for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
6487 { 6487 {
6488 proc = XCDR (XCAR (tail)); 6488 proc = XCDR (XCAR (tail));
6489 p = XPROCESS (proc); 6489 p = XPROCESS (proc);
6490 if (GC_EQ (p->childp, Qt) && p->pid == pid) 6490 if (EQ (p->childp, Qt) && p->pid == pid)
6491 break; 6491 break;
6492 p = 0; 6492 p = 0;
6493 } 6493 }
@@ -6495,7 +6495,7 @@ sigchld_handler (signo)
6495 /* Look for an asynchronous process whose pid hasn't been filled 6495 /* Look for an asynchronous process whose pid hasn't been filled
6496 in yet. */ 6496 in yet. */
6497 if (p == 0) 6497 if (p == 0)
6498 for (tail = Vprocess_alist; GC_CONSP (tail); tail = XCDR (tail)) 6498 for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
6499 { 6499 {
6500 proc = XCDR (XCAR (tail)); 6500 proc = XCDR (XCAR (tail));
6501 p = XPROCESS (proc); 6501 p = XPROCESS (proc);
diff --git a/src/w32fns.c b/src/w32fns.c
index 9af6b51608c..fbdb11ca922 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -386,10 +386,10 @@ x_window_to_frame (dpyinfo, wdesc)
386 Lisp_Object tail, frame; 386 Lisp_Object tail, frame;
387 struct frame *f; 387 struct frame *f;
388 388
389 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) 389 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
390 { 390 {
391 frame = XCAR (tail); 391 frame = XCAR (tail);
392 if (!GC_FRAMEP (frame)) 392 if (!FRAMEP (frame))
393 continue; 393 continue;
394 f = XFRAME (frame); 394 f = XFRAME (frame);
395 if (!FRAME_W32_P (f) || FRAME_W32_DISPLAY_INFO (f) != dpyinfo) 395 if (!FRAME_W32_P (f) || FRAME_W32_DISPLAY_INFO (f) != dpyinfo)
@@ -2466,8 +2466,8 @@ register_hot_keys (hwnd)
2466{ 2466{
2467 Lisp_Object keylist; 2467 Lisp_Object keylist;
2468 2468
2469 /* Use GC_CONSP, since we are called asynchronously. */ 2469 /* Use CONSP, since we are called asynchronously. */
2470 for (keylist = w32_grabbed_keys; GC_CONSP (keylist); keylist = XCDR (keylist)) 2470 for (keylist = w32_grabbed_keys; CONSP (keylist); keylist = XCDR (keylist))
2471 { 2471 {
2472 Lisp_Object key = XCAR (keylist); 2472 Lisp_Object key = XCAR (keylist);
2473 2473
@@ -2486,8 +2486,7 @@ unregister_hot_keys (hwnd)
2486{ 2486{
2487 Lisp_Object keylist; 2487 Lisp_Object keylist;
2488 2488
2489 /* Use GC_CONSP, since we are called asynchronously. */ 2489 for (keylist = w32_grabbed_keys; CONSP (keylist); keylist = XCDR (keylist))
2490 for (keylist = w32_grabbed_keys; GC_CONSP (keylist); keylist = XCDR (keylist))
2491 { 2490 {
2492 Lisp_Object key = XCAR (keylist); 2491 Lisp_Object key = XCAR (keylist);
2493 2492
diff --git a/src/w32menu.c b/src/w32menu.c
index 3169be007ba..f33442244ce 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -259,10 +259,10 @@ menubar_id_to_frame (id)
259 Lisp_Object tail, frame; 259 Lisp_Object tail, frame;
260 FRAME_PTR f; 260 FRAME_PTR f;
261 261
262 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) 262 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
263 { 263 {
264 frame = XCAR (tail); 264 frame = XCAR (tail);
265 if (!GC_FRAMEP (frame)) 265 if (!FRAMEP (frame))
266 continue; 266 continue;
267 f = XFRAME (frame); 267 f = XFRAME (frame);
268 if (!FRAME_WINDOW_P (f)) 268 if (!FRAME_WINDOW_P (f))
diff --git a/src/w32term.c b/src/w32term.c
index 63ee3d62e57..bd7f36c1094 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -3316,9 +3316,9 @@ x_focus_changed (type, state, dpyinfo, frame, bufp)
3316 3316
3317 /* Don't stop displaying the initial startup message 3317 /* Don't stop displaying the initial startup message
3318 for a switch-frame event we don't need. */ 3318 for a switch-frame event we don't need. */
3319 if (GC_NILP (Vterminal_frame) 3319 if (NILP (Vterminal_frame)
3320 && GC_CONSP (Vframe_list) 3320 && CONSP (Vframe_list)
3321 && !GC_NILP (XCDR (Vframe_list))) 3321 && !NILP (XCDR (Vframe_list)))
3322 { 3322 {
3323 bufp->kind = FOCUS_IN_EVENT; 3323 bufp->kind = FOCUS_IN_EVENT;
3324 XSETFRAME (bufp->frame_or_window, frame); 3324 XSETFRAME (bufp->frame_or_window, frame);
@@ -3404,7 +3404,7 @@ x_frame_rehighlight (dpyinfo)
3404 if (dpyinfo->w32_focus_frame) 3404 if (dpyinfo->w32_focus_frame)
3405 { 3405 {
3406 dpyinfo->x_highlight_frame 3406 dpyinfo->x_highlight_frame
3407 = ((GC_FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->w32_focus_frame))) 3407 = ((FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->w32_focus_frame)))
3408 ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->w32_focus_frame)) 3408 ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->w32_focus_frame))
3409 : dpyinfo->w32_focus_frame); 3409 : dpyinfo->w32_focus_frame);
3410 if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame)) 3410 if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame))
@@ -3872,15 +3872,13 @@ x_window_to_scroll_bar (window_id)
3872{ 3872{
3873 Lisp_Object tail; 3873 Lisp_Object tail;
3874 3874
3875 for (tail = Vframe_list; 3875 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
3876 XGCTYPE (tail) == Lisp_Cons;
3877 tail = XCDR (tail))
3878 { 3876 {
3879 Lisp_Object frame, bar, condemned; 3877 Lisp_Object frame, bar, condemned;
3880 3878
3881 frame = XCAR (tail); 3879 frame = XCAR (tail);
3882 /* All elements of Vframe_list should be frames. */ 3880 /* All elements of Vframe_list should be frames. */
3883 if (! GC_FRAMEP (frame)) 3881 if (! FRAMEP (frame))
3884 abort (); 3882 abort ();
3885 3883
3886 /* Scan this frame's scroll bar list for a scroll bar with the 3884 /* Scan this frame's scroll bar list for a scroll bar with the
@@ -3889,9 +3887,9 @@ x_window_to_scroll_bar (window_id)
3889 for (bar = FRAME_SCROLL_BARS (XFRAME (frame)); 3887 for (bar = FRAME_SCROLL_BARS (XFRAME (frame));
3890 /* This trick allows us to search both the ordinary and 3888 /* This trick allows us to search both the ordinary and
3891 condemned scroll bar lists with one loop. */ 3889 condemned scroll bar lists with one loop. */
3892 ! GC_NILP (bar) || (bar = condemned, 3890 ! NILP (bar) || (bar = condemned,
3893 condemned = Qnil, 3891 condemned = Qnil,
3894 ! GC_NILP (bar)); 3892 ! NILP (bar));
3895 bar = XSCROLL_BAR (bar)->next) 3893 bar = XSCROLL_BAR (bar)->next)
3896 if (SCROLL_BAR_W32_WINDOW (XSCROLL_BAR (bar)) == window_id) 3894 if (SCROLL_BAR_W32_WINDOW (XSCROLL_BAR (bar)) == window_id)
3897 return XSCROLL_BAR (bar); 3895 return XSCROLL_BAR (bar);
@@ -4363,7 +4361,7 @@ w32_scroll_bar_handle_click (bar, msg, emacs_event)
4363 W32Msg *msg; 4361 W32Msg *msg;
4364 struct input_event *emacs_event; 4362 struct input_event *emacs_event;
4365{ 4363{
4366 if (! GC_WINDOWP (bar->window)) 4364 if (! WINDOWP (bar->window))
4367 abort (); 4365 abort ();
4368 4366
4369 emacs_event->kind = W32_SCROLL_BAR_CLICK_EVENT; 4367 emacs_event->kind = W32_SCROLL_BAR_CLICK_EVENT;
diff --git a/src/xfns.c b/src/xfns.c
index e4eeb737205..c90c4eb9cfc 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -308,10 +308,10 @@ x_window_to_frame (dpyinfo, wdesc)
308 308
309 if (wdesc == None) return 0; 309 if (wdesc == None) return 0;
310 310
311 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) 311 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
312 { 312 {
313 frame = XCAR (tail); 313 frame = XCAR (tail);
314 if (!GC_FRAMEP (frame)) 314 if (!FRAMEP (frame))
315 continue; 315 continue;
316 f = XFRAME (frame); 316 f = XFRAME (frame);
317 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) 317 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
@@ -360,10 +360,10 @@ x_any_window_to_frame (dpyinfo, wdesc)
360 if (wdesc == None) return NULL; 360 if (wdesc == None) return NULL;
361 361
362 found = NULL; 362 found = NULL;
363 for (tail = Vframe_list; GC_CONSP (tail) && !found; tail = XCDR (tail)) 363 for (tail = Vframe_list; CONSP (tail) && !found; tail = XCDR (tail))
364 { 364 {
365 frame = XCAR (tail); 365 frame = XCAR (tail);
366 if (!GC_FRAMEP (frame)) 366 if (!FRAMEP (frame))
367 continue; 367 continue;
368 368
369 f = XFRAME (frame); 369 f = XFRAME (frame);
@@ -415,10 +415,10 @@ x_non_menubar_window_to_frame (dpyinfo, wdesc)
415 415
416 if (wdesc == None) return 0; 416 if (wdesc == None) return 0;
417 417
418 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) 418 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
419 { 419 {
420 frame = XCAR (tail); 420 frame = XCAR (tail);
421 if (!GC_FRAMEP (frame)) 421 if (!FRAMEP (frame))
422 continue; 422 continue;
423 f = XFRAME (frame); 423 f = XFRAME (frame);
424 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) 424 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
@@ -463,10 +463,10 @@ x_menubar_window_to_frame (dpyinfo, wdesc)
463 463
464 if (wdesc == None) return 0; 464 if (wdesc == None) return 0;
465 465
466 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) 466 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
467 { 467 {
468 frame = XCAR (tail); 468 frame = XCAR (tail);
469 if (!GC_FRAMEP (frame)) 469 if (!FRAMEP (frame))
470 continue; 470 continue;
471 f = XFRAME (frame); 471 f = XFRAME (frame);
472 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) 472 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
@@ -510,10 +510,10 @@ x_top_window_to_frame (dpyinfo, wdesc)
510 510
511 if (wdesc == None) return 0; 511 if (wdesc == None) return 0;
512 512
513 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) 513 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
514 { 514 {
515 frame = XCAR (tail); 515 frame = XCAR (tail);
516 if (!GC_FRAMEP (frame)) 516 if (!FRAMEP (frame))
517 continue; 517 continue;
518 f = XFRAME (frame); 518 f = XFRAME (frame);
519 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) 519 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo)
diff --git a/src/xmenu.c b/src/xmenu.c
index 16ff30334d3..be8a758d442 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -248,10 +248,10 @@ menubar_id_to_frame (id)
248 Lisp_Object tail, frame; 248 Lisp_Object tail, frame;
249 FRAME_PTR f; 249 FRAME_PTR f;
250 250
251 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) 251 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
252 { 252 {
253 frame = XCAR (tail); 253 frame = XCAR (tail);
254 if (!GC_FRAMEP (frame)) 254 if (!FRAMEP (frame))
255 continue; 255 continue;
256 f = XFRAME (frame); 256 f = XFRAME (frame);
257 if (!FRAME_WINDOW_P (f)) 257 if (!FRAME_WINDOW_P (f))
@@ -1556,10 +1556,10 @@ show_help_event (f, widget, help)
1556 xt_or_gtk_widget frame_widget = XtParent (widget); 1556 xt_or_gtk_widget frame_widget = XtParent (widget);
1557 Lisp_Object tail; 1557 Lisp_Object tail;
1558 1558
1559 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) 1559 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
1560 { 1560 {
1561 frame = XCAR (tail); 1561 frame = XCAR (tail);
1562 if (GC_FRAMEP (frame) 1562 if (FRAMEP (frame)
1563 && (f = XFRAME (frame), 1563 && (f = XFRAME (frame),
1564 FRAME_X_P (f) && f->output_data.x->widget == frame_widget)) 1564 FRAME_X_P (f) && f->output_data.x->widget == frame_widget))
1565 break; 1565 break;
diff --git a/src/xterm.c b/src/xterm.c
index 772f7ea7bae..51d40f2a4d4 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1562,8 +1562,8 @@ x_frame_of_widget (widget)
1562 1562
1563 /* Look for a frame with that top-level widget. Allocate the color 1563 /* Look for a frame with that top-level widget. Allocate the color
1564 on that frame to get the right gamma correction value. */ 1564 on that frame to get the right gamma correction value. */
1565 for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail)) 1565 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
1566 if (GC_FRAMEP (XCAR (tail)) 1566 if (FRAMEP (XCAR (tail))
1567 && (f = XFRAME (XCAR (tail)), 1567 && (f = XFRAME (XCAR (tail)),
1568 (f->output_data.nothing != 1 1568 (f->output_data.nothing != 1
1569 && FRAME_X_DISPLAY_INFO (f) == dpyinfo)) 1569 && FRAME_X_DISPLAY_INFO (f) == dpyinfo))
@@ -3473,9 +3473,9 @@ x_focus_changed (type, state, dpyinfo, frame, bufp)
3473 3473
3474 /* Don't stop displaying the initial startup message 3474 /* Don't stop displaying the initial startup message
3475 for a switch-frame event we don't need. */ 3475 for a switch-frame event we don't need. */
3476 if (GC_NILP (Vterminal_frame) 3476 if (NILP (Vterminal_frame)
3477 && GC_CONSP (Vframe_list) 3477 && CONSP (Vframe_list)
3478 && !GC_NILP (XCDR (Vframe_list))) 3478 && !NILP (XCDR (Vframe_list)))
3479 { 3479 {
3480 bufp->kind = FOCUS_IN_EVENT; 3480 bufp->kind = FOCUS_IN_EVENT;
3481 XSETFRAME (bufp->frame_or_window, frame); 3481 XSETFRAME (bufp->frame_or_window, frame);
@@ -3585,7 +3585,7 @@ x_frame_rehighlight (dpyinfo)
3585 if (dpyinfo->x_focus_frame) 3585 if (dpyinfo->x_focus_frame)
3586 { 3586 {
3587 dpyinfo->x_highlight_frame 3587 dpyinfo->x_highlight_frame
3588 = ((GC_FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame))) 3588 = ((FRAMEP (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame)))
3589 ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame)) 3589 ? XFRAME (FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame))
3590 : dpyinfo->x_focus_frame); 3590 : dpyinfo->x_focus_frame);
3591 if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame)) 3591 if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame))
@@ -4130,15 +4130,13 @@ x_window_to_scroll_bar (display, window_id)
4130 window_id = (Window) xg_get_scroll_id_for_window (display, window_id); 4130 window_id = (Window) xg_get_scroll_id_for_window (display, window_id);
4131#endif /* USE_GTK && USE_TOOLKIT_SCROLL_BARS */ 4131#endif /* USE_GTK && USE_TOOLKIT_SCROLL_BARS */
4132 4132
4133 for (tail = Vframe_list; 4133 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
4134 XGCTYPE (tail) == Lisp_Cons;
4135 tail = XCDR (tail))
4136 { 4134 {
4137 Lisp_Object frame, bar, condemned; 4135 Lisp_Object frame, bar, condemned;
4138 4136
4139 frame = XCAR (tail); 4137 frame = XCAR (tail);
4140 /* All elements of Vframe_list should be frames. */ 4138 /* All elements of Vframe_list should be frames. */
4141 if (! GC_FRAMEP (frame)) 4139 if (! FRAMEP (frame))
4142 abort (); 4140 abort ();
4143 4141
4144 /* Scan this frame's scroll bar list for a scroll bar with the 4142 /* Scan this frame's scroll bar list for a scroll bar with the
@@ -4147,9 +4145,9 @@ x_window_to_scroll_bar (display, window_id)
4147 for (bar = FRAME_SCROLL_BARS (XFRAME (frame)); 4145 for (bar = FRAME_SCROLL_BARS (XFRAME (frame));
4148 /* This trick allows us to search both the ordinary and 4146 /* This trick allows us to search both the ordinary and
4149 condemned scroll bar lists with one loop. */ 4147 condemned scroll bar lists with one loop. */
4150 ! GC_NILP (bar) || (bar = condemned, 4148 ! NILP (bar) || (bar = condemned,
4151 condemned = Qnil, 4149 condemned = Qnil,
4152 ! GC_NILP (bar)); 4150 ! NILP (bar));
4153 bar = XSCROLL_BAR (bar)->next) 4151 bar = XSCROLL_BAR (bar)->next)
4154 if (SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)) == window_id && 4152 if (SCROLL_BAR_X_WINDOW (XSCROLL_BAR (bar)) == window_id &&
4155 FRAME_X_DISPLAY (XFRAME (frame)) == display) 4153 FRAME_X_DISPLAY (XFRAME (frame)) == display)
@@ -4171,9 +4169,7 @@ x_window_to_menu_bar (window)
4171{ 4169{
4172 Lisp_Object tail; 4170 Lisp_Object tail;
4173 4171
4174 for (tail = Vframe_list; 4172 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
4175 XGCTYPE (tail) == Lisp_Cons;
4176 tail = XCDR (tail))
4177 { 4173 {
4178 Lisp_Object frame = XCAR (tail); 4174 Lisp_Object frame = XCAR (tail);
4179 Widget menu_bar = XFRAME (frame)->output_data.x->menubar_widget; 4175 Widget menu_bar = XFRAME (frame)->output_data.x->menubar_widget;
@@ -5559,7 +5555,7 @@ x_scroll_bar_handle_click (bar, event, emacs_event)
5559 XEvent *event; 5555 XEvent *event;
5560 struct input_event *emacs_event; 5556 struct input_event *emacs_event;
5561{ 5557{
5562 if (! GC_WINDOWP (bar->window)) 5558 if (! WINDOWP (bar->window))
5563 abort (); 5559 abort ();
5564 5560
5565 emacs_event->kind = SCROLL_BAR_CLICK_EVENT; 5561 emacs_event->kind = SCROLL_BAR_CLICK_EVENT;
@@ -5654,7 +5650,7 @@ x_scroll_bar_note_movement (bar, event)
5654 XSETVECTOR (last_mouse_scroll_bar, bar); 5650 XSETVECTOR (last_mouse_scroll_bar, bar);
5655 5651
5656 /* If we're dragging the bar, display it. */ 5652 /* If we're dragging the bar, display it. */
5657 if (! GC_NILP (bar->dragging)) 5653 if (! NILP (bar->dragging))
5658 { 5654 {
5659 /* Where should the handle be now? */ 5655 /* Where should the handle be now? */
5660 int new_start = event->xmotion.y - XINT (bar->dragging); 5656 int new_start = event->xmotion.y - XINT (bar->dragging);