Commit 8720f601 authored by Paul Eggert's avatar Paul Eggert Committed by Paul Eggert

Port recent frame changes to --enable-gcc-warnings

* src/frame.c (next_frame, prev_frame):
Remove now-redundant assertions.
* src/frame.h (FOR_EACH_FRAME): Assume Vframe_list is nonempty.
parent 88f43dc3
...@@ -1461,9 +1461,6 @@ next_frame (Lisp_Object frame, Lisp_Object minibuf) ...@@ -1461,9 +1461,6 @@ next_frame (Lisp_Object frame, Lisp_Object minibuf)
Lisp_Object f, tail; Lisp_Object f, tail;
int passed = 0; int passed = 0;
/* There must always be at least one frame in Vframe_list. */
eassert (CONSP (Vframe_list));
while (passed < 2) while (passed < 2)
FOR_EACH_FRAME (tail, f) FOR_EACH_FRAME (tail, f)
{ {
...@@ -1486,9 +1483,6 @@ prev_frame (Lisp_Object frame, Lisp_Object minibuf) ...@@ -1486,9 +1483,6 @@ prev_frame (Lisp_Object frame, Lisp_Object minibuf)
{ {
Lisp_Object f, tail, prev = Qnil; Lisp_Object f, tail, prev = Qnil;
/* There must always be at least one frame in Vframe_list. */
eassert (CONSP (Vframe_list));
FOR_EACH_FRAME (tail, f) FOR_EACH_FRAME (tail, f)
{ {
if (EQ (frame, f) && !NILP (prev)) if (EQ (frame, f) && !NILP (prev))
......
...@@ -1111,7 +1111,8 @@ default_pixels_per_inch_y (void) ...@@ -1111,7 +1111,8 @@ default_pixels_per_inch_y (void)
/* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a /* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
`for' loop which iterates over the elements of Vframe_list. The `for' loop which iterates over the elements of Vframe_list. The
loop will set FRAME_VAR, a Lisp_Object, to each frame in loop will set FRAME_VAR, a Lisp_Object, to each frame in
Vframe_list in succession and execute the statement. LIST_VAR Vframe_list in succession and execute the statement. Vframe_list
should be nonempty, so the body is executed at least once. LIST_VAR
should be a Lisp_Object too; it is used to iterate through the should be a Lisp_Object too; it is used to iterate through the
Vframe_list. Note that this macro walks over child frames and Vframe_list. Note that this macro walks over child frames and
the tooltip frame as well. the tooltip frame as well.
...@@ -1121,7 +1122,7 @@ default_pixels_per_inch_y (void) ...@@ -1121,7 +1122,7 @@ default_pixels_per_inch_y (void)
something which executes the statement once. */ something which executes the statement once. */
#define FOR_EACH_FRAME(list_var, frame_var) \ #define FOR_EACH_FRAME(list_var, frame_var) \
for ((list_var) = Vframe_list; \ for ((list_var) = (eassume (CONSP (Vframe_list)), Vframe_list); \
(CONSP (list_var) \ (CONSP (list_var) \
&& (frame_var = XCAR (list_var), true)); \ && (frame_var = XCAR (list_var), true)); \
list_var = XCDR (list_var)) list_var = XCDR (list_var))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment