diff src/misc1.c @ 9649:fd9727ae3c49 v7.4.2101

commit https://github.com/vim/vim/commit/2932359000b2f918d5fade79ea4d124d5943cd07 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 24 22:04:11 2016 +0200 patch 7.4.2101 Problem: Looping over windows, buffers and tab pages is inconsistant. Solution: Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Sun, 24 Jul 2016 22:15:07 +0200
parents b2aada04d84e
children 7b39615c0db1
line wrap: on
line diff
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -2814,7 +2814,7 @@ changed_bytes(linenr_T lnum, colnr_T col
 	win_T	    *wp;
 	linenr_T    wlnum;
 
-	for (wp = firstwin; wp != NULL; wp = wp->w_next)
+	FOR_ALL_WINDOWS(wp)
 	    if (wp->w_p_diff && wp != curwin)
 	    {
 		redraw_win_later(wp, VALID);
@@ -2924,7 +2924,7 @@ changed_lines(
 	win_T	    *wp;
 	linenr_T    wlnum;
 
-	for (wp = firstwin; wp != NULL; wp = wp->w_next)
+	FOR_ALL_WINDOWS(wp)
 	    if (wp->w_p_diff && wp != curwin)
 	    {
 		redraw_win_later(wp, VALID);
@@ -3213,7 +3213,7 @@ check_status(buf_T *buf)
 {
     win_T	*wp;
 
-    for (wp = firstwin; wp != NULL; wp = wp->w_next)
+    FOR_ALL_WINDOWS(wp)
 	if (wp->w_buffer == buf && wp->w_status_height)
 	{
 	    wp->w_redr_status = TRUE;
@@ -9475,7 +9475,7 @@ preserve_exit(void)
 
     ml_close_notmod();		    /* close all not-modified buffers */
 
-    for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+    FOR_ALL_BUFFERS(buf)
     {
 	if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL)
 	{