diff src/fns.c @ 85330:0bc184c59770

* xfns.c (Fx_create_frame, Fx_display_list): * window.c (window_fixed_size_p, enlarge_window, shrink_window_lowest_first): * macterm.c (init_font_name_table): * macfns.c (Fx_create_frame, Fx_display_list): * lread.c (close_load_descs): * keyboard.c (read_char_x_menu_prompt): * fns.c (Fmember, Fmemql, Fdelete, Fset_char_table_parent): * coding.c (code_convert_region_unwind): Test the type of an object rather than just !NILP before extracting data from it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 16 Oct 2007 16:28:39 +0000
parents 5039706521c9
children 8e5b337fea59 1251cabc40b7
line wrap: on
line diff
--- a/src/fns.c	Tue Oct 16 15:49:43 2007 +0000
+++ b/src/fns.c	Tue Oct 16 16:28:39 2007 +0000
@@ -1451,7 +1451,7 @@
      Lisp_Object list;
 {
   register Lisp_Object tail;
-  for (tail = list; !NILP (tail); tail = XCDR (tail))
+  for (tail = list; CONSP (tail); tail = XCDR (tail))
     {
       register Lisp_Object tem;
       CHECK_LIST_CONS (tail, list);
@@ -1502,7 +1502,7 @@
   if (!FLOATP (elt))
     return Fmemq (elt, list);
 
-  for (tail = list; !NILP (tail); tail = XCDR (tail))
+  for (tail = list; CONSP (tail); tail = XCDR (tail))
     {
       register Lisp_Object tem;
       CHECK_LIST_CONS (tail, list);
@@ -1806,7 +1806,7 @@
     {
       Lisp_Object tail, prev;
 
-      for (tail = seq, prev = Qnil; !NILP (tail); tail = XCDR (tail))
+      for (tail = seq, prev = Qnil; CONSP (tail); tail = XCDR (tail))
 	{
 	  CHECK_LIST_CONS (tail, seq);
 
@@ -2440,7 +2440,8 @@
     {
       CHECK_CHAR_TABLE (parent);
 
-      for (temp = parent; !NILP (temp); temp = XCHAR_TABLE (temp)->parent)
+      for (temp = parent; CHAR_TABLE_P (temp);
+	   temp = XCHAR_TABLE (temp)->parent)
 	if (EQ (temp, char_table))
 	  error ("Attempt to make a chartable be its own parent");
     }