* frame.c (Fmodify_frame_parameters): Always check 2nd arg with
authorDmitry Antipov <dmantipov@yandex.ru>
Tue, 30 Jul 2013 04:35:44 +0000 (08:35 +0400)
committerDmitry Antipov <dmantipov@yandex.ru>
Tue, 30 Jul 2013 04:35:44 +0000 (08:35 +0400)
CHECK_LIST.  Rewrite the loop to avoid useless local variable.

src/ChangeLog
src/frame.c

index b7b2d5f..7352516 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-30  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * frame.c (Fmodify_frame_parameters): Always check 2nd arg with
+       CHECK_LIST.  Rewrite the loop to avoid useless local variable.
+
 2013-07-29  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * fns.c (toplevel): Remove comment before Fsafe_length because
index 95f5356..f8b7201 100644 (file)
@@ -2253,7 +2253,9 @@ use is not recommended.  Explicitly check for a frame-parameter instead.  */)
   (Lisp_Object frame, Lisp_Object alist)
 {
   struct frame *f = decode_live_frame (frame);
-  register Lisp_Object tail, prop, val;
+  register Lisp_Object prop, val;
+
+  CHECK_LIST (alist);
 
   /* I think this should be done with a hook.  */
 #ifdef HAVE_WINDOW_SYSTEM
@@ -2278,12 +2280,11 @@ use is not recommended.  Explicitly check for a frame-parameter instead.  */)
 
       /* Extract parm names and values into those vectors.  */
 
-      i = 0;
-      for (tail = alist; CONSP (tail); tail = XCDR (tail))
+      for (i = 0; CONSP (alist); alist = XCDR (alist))
        {
          Lisp_Object elt;
 
-         elt = XCAR (tail);
+         elt = XCAR (alist);
          parms[i] = Fcar (elt);
          values[i] = Fcdr (elt);
          i++;