aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2017-04-12 07:27:23 -0700
committerPaul Eggert2017-04-12 07:27:53 -0700
commit8720f601e715e5f1d41f7cf863a525a1cc1bc12c (patch)
tree12a3bbfbd2e1a02f99e6d815a088ad446742bbb3 /src
parent88f43dc30cb8d71830e409973cafbaca13a66a45 (diff)
downloademacs-8720f601e715e5f1d41f7cf863a525a1cc1bc12c.tar.gz
emacs-8720f601e715e5f1d41f7cf863a525a1cc1bc12c.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/frame.c6
-rw-r--r--src/frame.h5
2 files changed, 3 insertions, 8 deletions
diff --git a/src/frame.c b/src/frame.c
index ed6c527d4d8..e5d80fa8257 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1461,9 +1461,6 @@ next_frame (Lisp_Object frame, Lisp_Object minibuf)
1461 Lisp_Object f, tail; 1461 Lisp_Object f, tail;
1462 int passed = 0; 1462 int passed = 0;
1463 1463
1464 /* There must always be at least one frame in Vframe_list. */
1465 eassert (CONSP (Vframe_list));
1466
1467 while (passed < 2) 1464 while (passed < 2)
1468 FOR_EACH_FRAME (tail, f) 1465 FOR_EACH_FRAME (tail, f)
1469 { 1466 {
@@ -1486,9 +1483,6 @@ prev_frame (Lisp_Object frame, Lisp_Object minibuf)
1486{ 1483{
1487 Lisp_Object f, tail, prev = Qnil; 1484 Lisp_Object f, tail, prev = Qnil;
1488 1485
1489 /* There must always be at least one frame in Vframe_list. */
1490 eassert (CONSP (Vframe_list));
1491
1492 FOR_EACH_FRAME (tail, f) 1486 FOR_EACH_FRAME (tail, f)
1493 { 1487 {
1494 if (EQ (frame, f) && !NILP (prev)) 1488 if (EQ (frame, f) && !NILP (prev))
diff --git a/src/frame.h b/src/frame.h
index 376df528466..84f9a05d774 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -1111,7 +1111,8 @@ default_pixels_per_inch_y (void)
1111/* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a 1111/* FOR_EACH_FRAME (LIST_VAR, FRAME_VAR) followed by a statement is a
1112 `for' loop which iterates over the elements of Vframe_list. The 1112 `for' loop which iterates over the elements of Vframe_list. The
1113 loop will set FRAME_VAR, a Lisp_Object, to each frame in 1113 loop will set FRAME_VAR, a Lisp_Object, to each frame in
1114 Vframe_list in succession and execute the statement. LIST_VAR 1114 Vframe_list in succession and execute the statement. Vframe_list
1115 should be nonempty, so the body is executed at least once. LIST_VAR
1115 should be a Lisp_Object too; it is used to iterate through the 1116 should be a Lisp_Object too; it is used to iterate through the
1116 Vframe_list. Note that this macro walks over child frames and 1117 Vframe_list. Note that this macro walks over child frames and
1117 the tooltip frame as well. 1118 the tooltip frame as well.
@@ -1121,7 +1122,7 @@ default_pixels_per_inch_y (void)
1121 something which executes the statement once. */ 1122 something which executes the statement once. */
1122 1123
1123#define FOR_EACH_FRAME(list_var, frame_var) \ 1124#define FOR_EACH_FRAME(list_var, frame_var) \
1124 for ((list_var) = Vframe_list; \ 1125 for ((list_var) = (eassume (CONSP (Vframe_list)), Vframe_list); \
1125 (CONSP (list_var) \ 1126 (CONSP (list_var) \
1126 && (frame_var = XCAR (list_var), true)); \ 1127 && (frame_var = XCAR (list_var), true)); \
1127 list_var = XCDR (list_var)) 1128 list_var = XCDR (list_var))