changeset 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 ad9922c079e4
children a89507976418
files src/ChangeLog src/coding.c src/fns.c src/keyboard.c src/lread.c src/macfns.c src/macterm.c src/window.c src/xfns.c
diffstat 9 files changed, 32 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Oct 16 15:49:43 2007 +0000
+++ b/src/ChangeLog	Tue Oct 16 16:28:39 2007 +0000
@@ -1,5 +1,16 @@
 2007-10-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* 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.
+
 	* alloc.c (Fpurecopy): Set the pvec tag on pseudo vectors.
 
 	* lisp.h (enum Lisp_Misc_Type): Del Lisp_Misc_Some_Buffer_Local_Value.
--- a/src/coding.c	Tue Oct 16 15:49:43 2007 +0000
+++ b/src/coding.c	Tue Oct 16 16:28:39 2007 +0000
@@ -5371,7 +5371,7 @@
 
   inhibit_pre_post_conversion = 0;
   Vlast_coding_system_used = XCAR (arg);
-  for (arg = XCDR (arg); ! NILP (arg); arg = XCDR (arg))
+  for (arg = XCDR (arg); CONSP (arg); arg = XCDR (arg))
     Fkill_buffer (XCAR (arg));
 
   UNGCPRO;
--- 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");
     }
--- a/src/keyboard.c	Tue Oct 16 15:49:43 2007 +0000
+++ b/src/keyboard.c	Tue Oct 16 16:28:39 2007 +0000
@@ -8538,7 +8538,7 @@
 	     to indicate that they came from a mouse menu,
 	     so that when present in last_nonmenu_event
 	     they won't confuse things.  */
-	  for (tem = XCDR (value); !NILP (tem); tem = XCDR (tem))
+	  for (tem = XCDR (value); CONSP (tem); tem = XCDR (tem))
 	    {
 	      record_menu_key (XCAR (tem));
 	      if (SYMBOLP (XCAR (tem))
--- a/src/lread.c	Tue Oct 16 15:49:43 2007 +0000
+++ b/src/lread.c	Tue Oct 16 16:28:39 2007 +0000
@@ -1100,7 +1100,7 @@
 {
 #ifndef WINDOWSNT
   Lisp_Object tail;
-  for (tail = load_descriptor_list; !NILP (tail); tail = XCDR (tail))
+  for (tail = load_descriptor_list; CONSP (tail); tail = XCDR (tail))
     emacs_close (XFASTINT (XCAR (tail)));
 #endif
 }
--- a/src/macfns.c	Tue Oct 16 15:49:43 2007 +0000
+++ b/src/macfns.c	Tue Oct 16 16:28:39 2007 +0000
@@ -2826,7 +2826,7 @@
 
   /* All remaining specified parameters, which have not been "used"
      by x_get_arg and friends, now go in the misc. alist of the frame.  */
-  for (tem = parameters; !NILP (tem); tem = XCDR (tem))
+  for (tem = parameters; CONSP (tem); tem = XCDR (tem))
     if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
       f->param_alist = Fcons (XCAR (tem), f->param_alist);
 
@@ -3402,7 +3402,7 @@
   Lisp_Object tail, result;
 
   result = Qnil;
-  for (tail = x_display_name_list; ! NILP (tail); tail = XCDR (tail))
+  for (tail = x_display_name_list; CONSP (tail); tail = XCDR (tail))
     result = Fcons (XCAR (XCAR (tail)), result);
 
   return result;
--- a/src/macterm.c	Tue Oct 16 15:49:43 2007 +0000
+++ b/src/macterm.c	Tue Oct 16 16:28:39 2007 +0000
@@ -8281,7 +8281,7 @@
 	  Lisp_Object rest = XCDR (XCDR (text_encoding_info));
 
 	  if (size > 0 || style == normal)
-	    for (; !NILP (rest); rest = XCDR (rest))
+	    for (; CONSP (rest); rest = XCDR (rest))
 	      add_mac_font_name (name, size, style, SDATA (XCAR (rest)));
 	}
     }
@@ -8356,7 +8356,7 @@
 		{
 		  Lisp_Object rest = XCDR (XCDR (text_encoding_info));
 
-		  for (; !NILP (rest); rest = XCDR (rest))
+		  for (; CONSP (rest); rest = XCDR (rest))
 		    add_mac_font_name (name, assc_entry->fontSize,
 				       assc_entry->fontStyle,
 				       SDATA (XCAR (rest)));
--- a/src/window.c	Tue Oct 16 15:49:43 2007 +0000
+++ b/src/window.c	Tue Oct 16 16:28:39 2007 +0000
@@ -2670,12 +2670,12 @@
 	{
 	  Lisp_Object child;
 
-	  for (child = w->prev; !NILP (child); child = XWINDOW (child)->prev)
+	  for (child = w->prev; WINDOWP (child); child = XWINDOW (child)->prev)
 	    if (!window_fixed_size_p (XWINDOW (child), width_p, 0))
 	      break;
 
 	  if (NILP (child))
-	    for (child = w->next; !NILP (child); child = XWINDOW (child)->next)
+	    for (child = w->next; WINDOWP (child); child = XWINDOW (child)->next)
 	      if (!window_fixed_size_p (XWINDOW (child), width_p, 0))
 		break;
 
@@ -4291,10 +4291,10 @@
 
   /* Find the total we can get from other siblings without deleting them.  */
   maximum = 0;
-  for (next = p->next; ! NILP (next); next = XWINDOW (next)->next)
+  for (next = p->next; WINDOWP (next); next = XWINDOW (next)->next)
     maximum += (*sizefun) (next) - window_min_size (XWINDOW (next),
 						    horiz_flag, 0, 0);
-  for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev)
+  for (prev = p->prev; WINDOWP (prev); prev = XWINDOW (prev)->prev)
     maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev),
 						    horiz_flag, 0, 0);
 
@@ -4442,10 +4442,10 @@
 	  Lisp_Object s;
 	  int n = 1;
 
-	  for (s = w->next; !NILP (s); s = XWINDOW (s)->next)
+	  for (s = w->next; WINDOWP (s); s = XWINDOW (s)->next)
 	    if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0))
 	      ++n;
-	  for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev)
+	  for (s = w->prev; WINDOWP (s); s = XWINDOW (s)->prev)
 	    if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0))
 	      ++n;
 
@@ -4701,7 +4701,7 @@
       /* Find the last child.  We are taking space from lowest windows
 	 first, so we iterate over children from the last child
 	 backwards.  */
-      for (child = w->vchild; !NILP (child); child = XWINDOW (child)->next)
+      for (child = w->vchild; WINDOWP (child); child = XWINDOW (child)->next)
 	last_child = child;
 
       /* Assign new heights.  We leave only MIN_SAFE_WINDOW_HEIGHT.  */
--- a/src/xfns.c	Tue Oct 16 15:49:43 2007 +0000
+++ b/src/xfns.c	Tue Oct 16 16:28:39 2007 +0000
@@ -3468,7 +3468,7 @@
 
   /* All remaining specified parameters, which have not been "used"
      by x_get_arg and friends, now go in the misc. alist of the frame.  */
-  for (tem = parms; !NILP (tem); tem = XCDR (tem))
+  for (tem = parms; CONSP (tem); tem = XCDR (tem))
     if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
       f->param_alist = Fcons (XCAR (tem), f->param_alist);
 
@@ -4156,7 +4156,7 @@
   Lisp_Object tail, result;
 
   result = Qnil;
-  for (tail = x_display_name_list; ! NILP (tail); tail = XCDR (tail))
+  for (tail = x_display_name_list; CONSP (tail); tail = XCDR (tail))
     result = Fcons (XCAR (XCAR (tail)), result);
 
   return result;