summaryrefslogtreecommitdiff
path: root/src/if_mzsch.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-24 22:04:11 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-24 22:04:11 +0200
commit2932359000b2f918d5fade79ea4d124d5943cd07 (patch)
tree1ca4fa98569a4d20ce066c7d6254404bcf431b47 /src/if_mzsch.c
parent6835dc61aebca2b602d85a9d63c449ace58683b4 (diff)
downloadvim-2932359000b2f918d5fade79ea4d124d5943cd07.zip
patch 7.4.2101
Problem: Looping over windows, buffers and tab pages is inconsistant. Solution: Use FOR_ALL_ macros everywhere. (Yegappan Lakshmanan)
Diffstat (limited to 'src/if_mzsch.c')
-rw-r--r--src/if_mzsch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/if_mzsch.c b/src/if_mzsch.c
index 645548f80..daec6b0a8 100644
--- a/src/if_mzsch.c
+++ b/src/if_mzsch.c
@@ -1916,7 +1916,7 @@ get_window_count(void *data UNUSED, int argc UNUSED, Scheme_Object **argv UNUSED
#ifdef FEAT_WINDOWS
win_T *w;
- for (w = firstwin; w != NULL; w = w->w_next)
+ FOR_ALL_WINDOWS(w)
#endif
++n;
return scheme_make_integer(n);
@@ -2197,7 +2197,7 @@ get_buffer_by_num(void *data, int argc, Scheme_Object **argv)
fnum = SCHEME_INT_VAL(GUARANTEE_INTEGER(prim->name, 0));
- for (buf = firstbuf; buf; buf = buf->b_next)
+ FOR_ALL_BUFFERS(buf)
if (buf->b_fnum == fnum)
return buffer_new(buf);
@@ -2220,7 +2220,7 @@ get_buffer_by_name(void *data, int argc, Scheme_Object **argv)
fname = GUARANTEED_STRING_ARG(prim->name, 0);
buffer = scheme_false;
- for (buf = firstbuf; buf; buf = buf->b_next)
+ FOR_ALL_BUFFERS(buf)
{
if (buf->b_ffname == NULL || buf->b_sfname == NULL)
/* empty string */
@@ -2283,7 +2283,7 @@ get_buffer_count(void *data UNUSED, int argc UNUSED, Scheme_Object **argv UNUSED
buf_T *b;
int n = 0;
- for (b = firstbuf; b; b = b->b_next) ++n;
+ FOR_ALL_BUFFERS(b) ++n;
return scheme_make_integer(n);
}