FOR_ALL_BUFFERS use locally declared buffer pointer

This commit is contained in:
Wayne Rowcliffe
2014-08-10 22:56:58 -05:00
parent 8cf45786b1
commit 888a31ba45
17 changed files with 63 additions and 88 deletions

View File

@@ -5399,7 +5399,6 @@ static int list_join(garray_T *gap, list_T *l, char_u *sep, int echo_style, int
int garbage_collect(void)
{
int copyID;
buf_T *buf;
win_T *wp;
funccall_T *fc, **pfc;
int did_free;
@@ -7208,13 +7207,15 @@ static buf_T *find_buffer(typval_T *avar)
if (buf == NULL) {
/* No full path name match, try a match with a URL or a "nofile"
* buffer, these don't use the full path. */
FOR_ALL_BUFFERS(buf) {
if (buf->b_fname != NULL
&& (path_with_url(buf->b_fname)
|| bt_nofile(buf)
FOR_ALL_BUFFERS(bp) {
if (bp->b_fname != NULL
&& (path_with_url(bp->b_fname)
|| bt_nofile(bp)
)
&& STRCMP(buf->b_fname, avar->vval.v_string) == 0)
&& STRCMP(bp->b_fname, avar->vval.v_string) == 0) {
buf = bp;
break;
}
}
}
}
@@ -10617,7 +10618,6 @@ static void f_keys(typval_T *argvars, typval_T *rettv)
static void f_last_buffer_nr(typval_T *argvars, typval_T *rettv)
{
int n = 0;
buf_T *buf;
FOR_ALL_BUFFERS(buf) {
if (n < buf->b_fnum) {