Silence some byte-compiler warnings in ERC
[bpt/emacs.git] / src / fns.c
index 4c8693b..7ec0056 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -1451,7 +1451,7 @@ The value is actually the tail of LIST whose car is ELT.  */)
      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 @@ The value is actually the tail of LIST whose car is ELT.  */)
   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 @@ to be sure of changing the value of `foo'.  */)
     {
       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);
 
@@ -2060,7 +2060,7 @@ The PLIST is modified by side effects.  */)
       prev = tail;
       QUIT;
     }
-  newcell = Fcons (prop, Fcons (val, Qnil));
+  newcell = Fcons (prop, Fcons (val, NILP (prev) ? plist : XCDR (XCDR (prev))));
   if (NILP (prev))
     return newcell;
   else
@@ -2440,7 +2440,8 @@ Return PARENT.  PARENT must be either nil or another char-table.  */)
     {
       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");
     }